Happy to see progress being made here. I think Ryan and others have spoken
to any issues I would otherwise raise with the implementation itself.
Currently I find myself reaching for unsafeCoerce over magicDict in most
situations, and I'd really like to be able to stop doing that!

I'm +1 on the name being something `reify`-ish, to avoid flipping the
direction on the vocabulary. It is reifying a value as a dictionary.
Something like `reifyValue` or `reifyAsDict` would avoid confusion as the
dict isn't being reified, the value is. Both are a little clunky, but it is
a very rare operation. It is also worth considering possibly mangling the
name with a # or an 'unsafe' in the name to give casual users pause.

-Edward

On Thu, Apr 22, 2021 at 12:18 PM Krzysztof Gogolewski <
krz.gogolew...@gmail.com> wrote:

> How about 'reifyDict'? The reflection library uses 'reify' to create a
> dictionary and 'reflect' to extract a value out of it.
>
>
> https://hackage.haskell.org/package/reflection-2.1.6/docs/Data-Reflection.html#v:reify
>
> On Thu, Apr 22, 2021 at 3:27 PM Spiwack, Arnaud <arnaud.spiw...@tweag.io>
> wrote:
> >
> > Let me upvote `reflectDict`.
> >
> > On Thu, Apr 22, 2021 at 12:41 PM Simon Peyton Jones via ghc-devs <
> ghc-devs@haskell.org> wrote:
> >>
> >> Ed, and other ghc-devs
> >>
> >> We are busy tidying up magicDict, and making it much more type-safe: see
> >>
> >> https://gitlab.haskell.org/ghc/ghc/-/issues/16646
> >> https://gitlab.haskell.org/ghc/ghc/-/merge_requests/5573
> >>
> >> As part of that change we’re think of changing its
> currently-rather-obscure name.  I rather favour “reflectDict”.  Any other
> views?
> >>
> >> Simon
> >>
> >> _______________________________________________
> >> ghc-devs mailing list
> >> ghc-devs@haskell.org
> >> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
> >
> > _______________________________________________
> > ghc-devs mailing list
> > ghc-devs@haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
> _______________________________________________
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
_______________________________________________
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Reply via email to