#1356: "derive instance" panics ghc-6.7.20070404
----------------------------------+-----------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: igloo
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 6.7
Severity: normal | Resolution: worksforme
Keywords: deriving instance | Difficulty: Unknown
Os: MacOS X | Testcase:
Architecture: powerpc |
----------------------------------+-----------------------------------------
Changes (by guest):
* resolution: => worksforme
* status: new => closed
Comment:
Yes, this works for me for the simple example (ghc 6.7.20070517) on the
simple example below. I'll keep working to find a reproducer that gets at
the root cause of the panic. Everything's working if I add the Data and
Typeable class in my copy of parsec's SourcePos, but we panic if I use
"derive instance" - some weird feature interaction with some other thing I
use (but do not use in the simple example?).
Thanks,
- Reto
module Main where
import Data.Generics
import Text.ParserCombinators.Parsec.Pos as PPos
derive instance Data PPos.SourcePos
derive instance Typeable PPos.SourcePos
data AST = AST [AST]
| SomeNode PPos.SourcePos String
| OtherNode PPos.SourcePos Int
deriving (Eq, Ord, Show, Data, Typeable)
f = everywhere $ mkT touch
where touch (SomeNode p s) = SomeNode p $ s ++ "-touched"
touch (OtherNode p i) = OtherNode p $ i + 1
main = do putStrLn $ show (f [SomeNode p "foo",
OtherNode p 41])
where p = newPos "file" 0 0
{- [SomeNode "file" (line 0, column 0) "foo-touched",
OtherNode "file" (line 0, column 0) 42] -}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1356>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs