[GHC] #11129: Nested TH not allowed in declarations
GHC
ghc-devs at haskell.org
Mon Nov 23 17:09:55 UTC 2015
#11129: Nested TH not allowed in declarations
-------------------------------------+-------------------------------------
Reporter: andrewthad | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.10.2
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
I tried to do the following with the `singletons` and `derive` libraries:
{{{#!hs
$(singletons [d|
data CrudRoute = AddR | EditR | DeleteR | ViewR
deriving (Eq,Ord,Enum,Bounded,Show)
data MyRoute = UsersR | ProfileR | RenameR | DogR CrudRoute
deriving (Eq,Ord,Show)
$( derive makeEnum ''MyRoute )
|])
}}}
GHC fails with the following error message:
Splices within declaration brackets not (yet) handled by Template Haskell
Here is the github issue where this originated:
https://github.com/goldfirere/singletons/issues/135#issuecomment-158936027
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11129>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list