<div dir="ltr">Cool approach!<div><br></div><div>cmptype does something similar, but requires a ghc plugin: <a href="https://github.com/isovector/type-sets/tree/master/cmptype">https://github.com/isovector/type-sets/tree/master/cmptype</a></div><div><br></div><div>I suppose one advantage of cmptype is that it can work with types that cannot derive Generic, such as GADTs.</div><div><br></div><div>-Michael</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">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></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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.</blockquote></div>