<div dir="ltr">I'm not sure why cmptype lists the tuple instances explicitly, since the plugin also handles tuple types.  I can delete those cases and it still passes the tests.<div><br></div><div>-Michael</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Dec 29, 2019 at 12:51 AM Justin Paston-Cooper <<a href="mailto:paston.cooper@gmail.com">paston.cooper@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Looks like cmptype wins on genericity. Out of interest, is there any<br>
alternative these days to writing the tuple instances of CmpType<br>
explicitly?<br>
<br>
On Sat, 28 Dec 2019 at 23:29, Michael Sloan <<a href="mailto:mgsloan@gmail.com" target="_blank">mgsloan@gmail.com</a>> wrote:<br>
><br>
> Cool approach!<br>
><br>
> cmptype does something similar, but requires a ghc plugin: <a href="https://github.com/isovector/type-sets/tree/master/cmptype" rel="noreferrer" target="_blank">https://github.com/isovector/type-sets/tree/master/cmptype</a><br>
><br>
> I suppose one advantage of cmptype is that it can work with types that cannot derive Generic, such as GADTs.<br>
><br>
> -Michael<br>
><br>
> On Sat, Dec 28, 2019 at 3:23 AM Justin Paston-Cooper <<a href="mailto:paston.cooper@gmail.com" target="_blank">paston.cooper@gmail.com</a>> wrote:<br>
>><br>
>> Hello,<br>
>><br>
>> I've defined a module which defines a Data.Type.Ordering over types<br>
>> which are instances of Generic:<br>
>> <a href="https://github.com/jpcooper/generic-type-ordering/blob/master/src/Data/Type/Ordering.hs" rel="noreferrer" target="_blank">https://github.com/jpcooper/generic-type-ordering/blob/master/src/Data/Type/Ordering.hs</a>.<br>
>> I was considering submitting it to Hackage if anyone finds this<br>
>> useful.<br>
>><br>
>> I am using it in conjunction with Data.Type.Set (type-level-sets),<br>
>> which requires an ordering over the used types.<br>
>><br>
>> The ordering works by first comparing the package, then the module,<br>
>> then the type name. I take it that the ordering as defined is correct<br>
>> over all types which are an instance of Generic.<br>
>><br>
>> I wanted to check first whether this is done anywhere else, or in a<br>
>> different, better way. Can anyone advise?<br>
>><br>
>> Cheers,<br>
>><br>
>> Justin<br>
>> _______________________________________________<br>
>> Haskell-Cafe mailing list<br>
>> To (un)subscribe, modify options or view archives go to:<br>
>> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
>> Only members subscribed via the mailman list are allowed to post.<br>
</blockquote></div>