RE: [Template-haskell] Splicing in class declarations doesn't work
Fixed, thank you. Simon | -----Original Message----- | From: template-haskell-admin@haskell.org [mailto:template-haskell-admin@haskell.org] On Behalf Of | Andre Pang | Sent: 17 May 2003 18:41 | To: template-haskell@haskell.org | Subject: [Template-haskell] Splicing in class declarations doesn't work | | Hallo all, | | I think I've found a bug with declaring classes, or more specifically, | declaring functions which instances of the classes are required to | implement. Splicing in the following code works fine: | | spliceTest = [d| class Foo f where {} |] | | However, splicing in this code doesn't work: | | spliceTestDeux = [d| class Bar b where { baz :: Int -> Int } |] | | 3:30 ~/th/newnew % ghci -fglasgow-exts -ddump-splices | ObjCTypesTHTest.hs | ... | ObjCTypesTHTest.hs:1: Splicing declarations | spliceTest ======> class Foo f'0 | ObjCTypesTHTest.hs:1: Splicing declarations | spliceTestDeux | ======> | class Bar b'1 where { baz :: GHC.Base.Int -> GHC.Base.Int; } | | Variable not in scope: `baz' | | Misplaced type signature: baz :: Int -> Int | Failed, modules loaded: ObjCTypesTH. | *ObjCTypesTH> | | Splicing in a "raw" declaration: | | spliceTestDeux :: Q [Dec] | spliceTestDeux = return | [ Class [] "Bar" ["b"] [Proto "baz" (tappsArr [intCon, intCon])] ] | where | intCon = Tcon (TconName "Int") | | doesn't work either (with exactly the same error message). | | (BTW, should I send TH-related bugs to template-haskell, put them in | the bug tracker, or both?) | | Thanks again, | | | -- | % Andre Pang : trust.in.love.to.savee | | _______________________________________________ | template-haskell mailing list | template-haskell@haskell.org | http://www.haskell.org/mailman/listinfo/template-haskell
participants (1)
-
Simon Peyton-Jones