#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            |  
----------------------------------+-----------------------------------------
Comment (by guest):

 Ups, here's the properly formated source that works:

 {{{
 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

Reply via email to