lookupRdrNameInModuleForPlugins with constructors

Conal Elliott conal at conal.net
Wed Mar 23 00:40:53 UTC 2016


Got it. Silly me. Thanks!!  - Conal

On Tue, Mar 22, 2016 at 5:25 PM, Andrew Farmer <xichekolas at gmail.com> wrote:

> Er, dictionary... sorry, mkDataOccFS
>
> On Tue, Mar 22, 2016 at 5:24 PM, Andrew Farmer <xichekolas at gmail.com>
> wrote:
> > mkVarUnqual calls mkVarOccFS, which constructs an OccName in the
> > varName namespace. You need to construct your RdrName via mkTyVarOcc,
> > which picks the Type/Class namespace.
> >
> > On Tue, Mar 22, 2016 at 5:09 PM, Conal Elliott <conal at conal.net> wrote:
> >> I'm trying to construct a dictionary in a GHC plugin. I'm stuck on
> finding
> >> the constructor for the dictionary. When I use `-ddump-simpl` on the
> module
> >> that defines the class, I see "Circat.Rep.C:HasRep". To try finding that
> >> constructor, I say
> >>
> >>> lookupRdrNameInModuleForPlugins hsc_env
> >>>   (mkModuleName "Circat.Rep") (mkVarUnqual "C:HasRep")
> >>
> >> However, I keep getting `Nothing` as a result. (Same without the "C:".)
> I've
> >> also had this same difficulty when looking up constructors for algebraic
> >> data types and when looking up TyCons. For regular value Ids, lookup
> >> succeeds.
> >>
> >> What am I missing?
> >>
> >> Thanks, - Conal
> >>
> >> _______________________________________________
> >> ghc-devs mailing list
> >> ghc-devs at haskell.org
> >> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
> >>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20160322/d34327a0/attachment.html>


More information about the ghc-devs mailing list