generic-constraints: Constraints via Generic

[ bsd3, generics, library ] [ Propose Tags ]

Standalone deriving without boiler-plate


[Skip to Readme]
Versions [faq] 1.0.0, 1.1.0, 1.1.1, 1.1.1.1
Change log CHANGELOG
Dependencies base (>=4.9 && <5), template-haskell, th-abstraction [details]
License BSD-3-Clause
Author Sjoerd Visscher, Xia Li-yao, Yair Chuchem
Maintainer yairchu@gmail.com
Category Generics
Home page https://github.com/yairchu/generic-constraints
Bug tracker https://github.com/yairchu/generic-constraints/issues
Source repo head: git clone git://github.com/yairchu/generic-constraints.git
Uploaded by YairChuchem at Thu Aug 29 07:08:40 UTC 2019
Distributions NixOS:1.1.1.1
Downloads 456 total (85 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2019-08-29 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for generic-constraints-1.1.1.1

[back to package description]

Standalone deriving without boiler-plate

Write short and concise contexts based on generics.

Instead of writing boiler-plate standalone deriving clauses in the form of

deriving instance [Various Eq Constraints Here] => Instance Eq MyType

With generic-constraints you can use

deriving instance Constraints MyType Eq => Eq MyType

Or, using TH, simply

makeDeriving ''Eq ''MyType

And for several classes and types:

makeDerivings [''Eq, ''Ord, ''Show] [''MyType, ''MyOtherType]

Credits

This library was extracted from the one-liner library by Sjoerd Visscher and Xia Li-yao.