
On Sun, Feb 19, 2017 at 11:51 PM, Rui Azevedo
I don't know if there is some extension that already does this, or any other method of doing it. My search on deriving ghc mechanisms and extensions gave me no satisfactory results.
the point is to have some "help" on derivation or some sort of derivation. actual derivation schema seems to require that all members (constructor arguments) instantiate the deriving class. This is the way of doing it for classes like Eq, works for Show and Ord but eventually it is a very strong requirement even for Eq sometimes. Of course I can do a manual derivation to state something else, and that sometimes can be frustrating because the derivations are way trivial and susceptible of automation.
There is no fancy things added, its all standard haskell, user could laboriously type this.
You might be interested in https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/DerivingStrategies; a first cut is slated for ghc 8.2.1, for which a first release candidate is planned for later this month. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net