Hello,

I am a bit unclear on what you mean by "programatically": do you mean from within GHC or is that using something like Template Haskell?

-Iavor


On Thu, Jun 26, 2014 at 3:33 PM, Gabor Greif <ggreif@gmail.com> wrote:
Hello devs,

I have

{{{
data D (n :: Symbol)
}}}

in my module, and I want to obtain a type

{{{
D "YAY!"
}}}

programmatically. Where can I find code that performs this (or
something similar)?

1) I have to look up |D| in the current TyEnv (what if it is in a
specific module?),
2) I have to build the type index (of kind Symbol), this involves
FastString, looks non-trivial,
3) Apply 1) on 2), this is easy.

Any hints welcome!

Thanks and cheers,

    Gabor


PS: some morsels I have so far:

for 1)
compiler/prelude/PrelNames.lhs:gHC_GENERICS    = mkBaseModule (fsLit
"GHC.Generics")
_______________________________________________
ghc-devs mailing list
ghc-devs@haskell.org
http://www.haskell.org/mailman/listinfo/ghc-devs