<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body><div>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.</div><div><br></div><div><br></div><div><br></div><div id="composer_signature"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><div style="font-size:85%;color:#575757">David Feuer</div><div style="font-size:85%;color:#575757">Well-Typed, LLP</div></div><div><br></div><div style="font-size:100%;color:#000000"><!-- originalMessage --><div>-------- Original message --------</div><div>From: Ryan Scott <ryan.gl.scott@gmail.com> </div><div>Date: 9/2/17 10:36 PM (GMT-05:00) </div><div>To: ghc-devs@haskell.org </div><div>Subject: Re: Type-level generics </div><div><br></div></div>If you're willing to go a completely different route from<br>GHC.Generics, then you might be interested in the paper Generic<br>Programming with Multiple Parameters [1] (whose existence I just<br>learned of—thanks to Pedro, the author, for pointing it out to me). It<br>does present a single Generic class that is capable of working over<br>any number of type parameters, although the interface presented is<br>significantly more complex than the current GHC.Generics.<br><br>The only reason I mention backwards compatibility is that if we are<br>going to introduce a GHC.Generics 2.0 some day, it'd be nice to have a<br>way to subsume the old interface with the new one, and fortunately,<br>the aforementioned paper includes an algorithm for doing so. My hope<br>was that we'd be able to incorporate these ideas into a design that<br>also grants the ability to write Generic instances for GADTs, but I<br>don't think GHC has a fancy enough type system to do this<br>satisfactorily at the moment.<br><br>Ryan S.<br>-----<br>[1] http://dreixel.net/research/pdf/gpmp_colour.pdf<br>_______________________________________________<br>ghc-devs mailing list<br>ghc-devs@haskell.org<br>http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs<br></body></html>