david at well-typed.com
Sun Sep 3 04:33:21 UTC 2017
Ah, nice. I was actually exploring the vague general idea behind that approach earlier this evening. Magalhães (unsurprisingly) has developed it much much further.
David FeuerWell-Typed, LLP
-------- Original message --------From: Ryan Scott <ryan.gl.scott at gmail.com> Date: 9/2/17 10:36 PM (GMT-05:00) To: ghc-devs at haskell.org Subject: Re: Type-level generics
If you're willing to go a completely different route from
GHC.Generics, then you might be interested in the paper Generic
Programming with Multiple Parameters  (whose existence I just
learned of—thanks to Pedro, the author, for pointing it out to me). It
does present a single Generic class that is capable of working over
any number of type parameters, although the interface presented is
significantly more complex than the current GHC.Generics.
The only reason I mention backwards compatibility is that if we are
going to introduce a GHC.Generics 2.0 some day, it'd be nice to have a
way to subsume the old interface with the new one, and fortunately,
the aforementioned paper includes an algorithm for doing so. My hope
was that we'd be able to incorporate these ideas into a design that
also grants the ability to write Generic instances for GADTs, but I
don't think GHC has a fancy enough type system to do this
satisfactorily at the moment.
ghc-devs mailing list
ghc-devs at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ghc-devs