|
Template bug 2: msg#00009lang.haskell.glasgow.bugs
Windows XP D:\Tools\ghc>ghc-6.2.1\bin\ghc.exe -fglasgow-exts --make foo.hs Chasing modules from: foo.hs Compiling Any ( ./Any.hs, ./Any.o ) Compiling Foo ( foo.hs, foo.o ) Loading package base ... linking ... done. Loading package haskell98 ... linking ... done. Loading package haskell-src ... linking ... done. ghc.exe: panic! (the `impossible' happened, GHC version 6.2.1): Malformed predicate module Any where import Language.Haskell.THSyntax genAny :: DecQ -> Q [Dec] genAny decl = do{ d <- decl ; case d of ClassD _ name _ decls -> sequenceQ [genAnyClass (name) decls] _ -> error "genAny can be applied to classes only" } genAnyClass :: String -> [Dec] -> DecQ genAnyClass name decls = do{ returnQ (DataD [forall] anyName [] [constructor] []) } where anyName = "Any" ++ name ++ "1111" constructor = NormalC anyName [(NotStrict, VarT "a")] forall = ForallT [] [] (VarT "a") module Foo where import Any class MyInterface a where foo :: a -> Int foo1 :: Int -> a -> Int $(genAny (reifyDecl MyInterface))
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Template haskell bug 1, Mike Aizatsky |
|---|---|
| Next by Date: | Panic, Arjan van IJzendoorn |
| Previous by Thread: | Template haskell bug 1, Mike Aizatsky |
| Next by Thread: | Panic, Arjan van IJzendoorn |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |