[Haskell-cafe] Usage question with TemplateHaskell and Generic
magicloud.magiclouds at gmail.com
Sun Nov 6 15:35:42 CET 2011
I'd like to simpler the work of deriving MyClass. And I have two
ways to do: TemplateHaskell "$(derivingMyClass)", or Generic "deriving
Since I need to get the type name in the deriving, then I met this
question: If I have "data A b = C b", then with TemplateHaskell, the
type would be "VarT b", which means at compile time, I cannot get the
exact type, so the type name would be "b".
So I wonder if this could be resolved by TemplateHaskell, or Generic
is the only choice.
PS: I have not tried to do this in Generic.
More information about the Haskell-Cafe