[Haskell-cafe] reifying based-on type of a newtype or data

John Lato jwlato at gmail.com
Wed Oct 30 02:53:29 UTC 2013


The Scrap Your Boilerplate (SYB) papers are probably the best resource for
Data.Data.  I'm not aware of a similar resource on GHC Generics.

I think the problem you had is that your original question is a very small
fragment of the problems generics are meant to solve.  For people used to
generics systems (Oleg, not really me!), your question is near-trivial.
But you need a decent familiarity with the whole apparatus to see how to
use any of it.

(I still think 'mapQ typeOf' is likely to be the most concise solution).



On Tue, Oct 29, 2013 at 5:19 AM, AntC <anthony_clayden at clear.net.nz> wrote:

> > <oleg <at> okmij.org> writes:
>
> > ...
> >
> > It is easy to answer the original question about someFoo
> >
> > ...
>
> So it is! (For some value of `easy` ;-)
>
> Thank you both Oleg and John.
>
> Is all that documented somewhere 'official'?
> (I did try various searches and wikis, and look at Data.Data on Hackage.
>  But nothing seemed to hang together enough.
>  Perhaps my question is an unusual use case?)
>
> AntC
>
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20131029/3b147677/attachment.html>


More information about the Haskell-Cafe mailing list