generic-constraints: Constraints via Generic

[ bsd3, generics, library ] [ Propose Tags ]

Standalone deriving without boiler-plate

[Skip to Readme]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS] 1.0.0, 1.1.0, 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
Category Generics
Home page
Bug tracker
Source repo head: git clone git://
Uploaded by YairChuchem at 2019-08-29T07:08:40Z
Distributions LTSHaskell:, NixOS:, Stackage:
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 1912 total (20 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2019-08-29 [all 1 reports]

Readme for generic-constraints-

[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]


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