ghc-devs
| Sent: 19 October 2017 18:13
| To: ghc-devs@haskell.org
| Subject: Re: Determine instance method from class method callsite
|
| I have the same problem with a compiler plugin that I am writing.
|
| In GHC Core I need to get from a dict-fun identifier (e.g.
| $fMyClassDouble
I have the same problem with a compiler plugin that I am writing.
In GHC Core I need to get from a dict-fun identifier (e.g.
$fMyClassDouble to the type class instance bindr (starting with $c).
lookupInstEnv from the InstEnv module seemed to do it, but it seems to
look up the matching key
nt. maybe others can help?
>
>
>
> Simon
>
>
>
> *From:* Robin Palotai [mailto:palotai.ro...@gmail.com]
> *Sent:* 05 October 2017 11:17
> *To:* Simon Peyton Jones <simo...@microsoft.com>
> *Cc:* GHC developers <ghc-devs@haskell.org>; haskell <
> has
ptember 2017 06:39
To: GHC developers <ghc-devs@haskell.org<mailto:ghc-devs@haskell.org>>; haskell
<haskell-c...@haskell.org<mailto:haskell-c...@haskell.org>>
Subject: Determine instance method from class method callsite
Sorry, I messed up subject and mailing list. Cop
gt;
>
> Simon
>
> *From:* ghc-devs [mailto:ghc-devs-boun...@haskell.org] *On Behalf Of *Robin
> Palotai
> *Sent:* 19 September 2017 06:39
> *To:* GHC developers <ghc-devs@haskell.org>; haskell <
> haskell-c...@haskell.org>
> *Subject:* Determine instance meth
Email
is quickly lost.
Simon
From: ghc-devs [mailto:ghc-devs-boun...@haskell.org] On Behalf Of Robin Palotai
Sent: 19 September 2017 06:39
To: GHC developers <ghc-devs@haskell.org>; haskell <haskell-c...@haskell.org>
Subject: Determine instance method from class method callsite
Sorry, I
My conclusion so far: there's no royal way. One can get the instance
dictionary DFunId pretty easy, but then access to the Typechecked AST of
the instance declaration is really needed to find all the method bindings
$c... (that get applied when constructing the dictionary $d...).
2017-09-19 7:38
Sorry, I messed up subject and mailing list. Copying to both list now after
the mistake (wanted only ghc-devs for specificity).
Thanks!
2017-09-19 7:36 GMT+02:00 Robin Palotai :
> Hello GHC devs,
>
> Before inventing the wheel, want to check if there is a GHC API way to