TypeLits question, how to build a Type Application with Symbol index

Iavor Diatchki iavor.diatchki at gmail.com
Fri Jun 27 21:56:01 UTC 2014


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 at 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 at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20140627/e9ee870b/attachment.html>


More information about the ghc-devs mailing list