[Haskell-cafe] Selective deriving

Brandon Allbery allbery.b at gmail.com
Mon Feb 20 05:04:13 UTC 2017


On Sun, Feb 19, 2017 at 11:51 PM, Rui Azevedo <ruihfazevedo at gmail.com>
wrote:
>
> 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 at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170220/dd56758a/attachment.html>


More information about the Haskell-Cafe mailing list