
20 Apr
2015
20 Apr
'15
6:26 p.m.
On 20-04-2015 20:01, Clinton Mead wrote:
I've linked to an ugly attempt to emulate subclasses in Haskell, and I'm wondering if anyone has done what I have perhaps in a cleaner way.
Well, I would generally advise against trying to emulate a flawed concept in the first place. "OverlappingInstances" and "UndecidableInstances" are a red flag unless you know *exactly* what you are doing. A much better way (IMO, of course) is to use either 1) normal aggregation (that's the simpl{e,istic} answer), at the cost of some boilerplate. If the boilerplate exceeds practicality, I would look at 2) extensible records/row types as in e.g. "vinyl" Regards,