Conversation
|
In an ideal world, there would be no coupling to the Prelude library and the library itself would implement (through something like template PureScript) the auto-derivation. Although that requires a ton of machinery that does not yet exist, and plenty of people want Eq/Ord now, so 👍 |
|
True. Another option is to bake things like |
|
Ok, this is ready to review. |
|
Presumably it still works when you want to derive an instance which has a field that itself derives the instance? Perhaps the tests should cover that too? Not sure. Also, does this work for records, like |
|
Good points @hdgarrood, thanks. It should work in both cases. I'll modify the tests. |
|
Actually, the problem with |
|
I guess the point is that we're just picking some ordering for records, not that there is a canonical one, but since most Good to review again. |
|
Re Ord and records: yeah, that's what I was about to say. 👍 |
Well, on sum types, the order is the declared "text" order of the terms in the sum. It'd be nice if the order for fields were the declared "text" order. |
|
@jdegoes Yes, it is. |
|
👍 |
|
@jdegoes @hdgarrood Another option is to use the ordering given by taking labels in alphabetical order. Thoughts on this before this goes into 0.8.1? |
|
I think I'd expect the ordering to be given by the order labels were written, although if I really cared about it, I'd probably just write the Ord instance out explicitly. So, no particularly strong feelings either way. |
Very strongly opposed to this on the following grounds:
|
Resolves #1874.