
Hi, In this case, you have two 'FooT' names: one is the Type and the other is the Constructor. Perhaps Template Haskell is capturing the wrong one inside the quote (probably the constructor). When you have name shadowing, you should always use a lookup function. You can find these lookup functions in the Template Haskell library. In the meantime, just for a quick test, you can try to change the name of the constructor to something else to avoid capturing, and you can see if the rest of the code works. Jose On Tue, Aug 20, 2013 at 02:00:29PM -0700, David Fox wrote:
This file gives me the error "Cycle in type synonym declarations" Can anyone tell me why? I'm just trying to write a function to create a type that is a FooT with the type parameter fixed.
{-# LANGUAGE TemplateHaskell #-} import Language.Haskell.TH (Q, Dec, TypeQ)
data FooT a = FooT a
foo :: TypeQ -> Q [Dec] foo t = [d| type Bar = FooT $t |]
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe