generic-constraints
Constraints via Generic
https://github.com/yairchu/generic-constraints
LTS Haskell 23.27: | 1.1.1.1 |
Stackage Nightly 2025-07-12: | 1.1.1.1 |
Latest on Hackage: | 1.1.1.1 |
BSD-3-Clause licensedbySjoerd Visscher,Xia Li-yao,Yair Chuchem
Maintained by[email protected]
This version can be pinned in stack with:
generic-constraints-1.1.1.1@sha256:68cb9056b0c7d56e51e94c70de654ecb8f3ff93b90ff330d47fa9d0fe34f69c1,1502
Module documentation for 1.1.1.1
- Generics
Depends on 3 packages(full list with versions):
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 theone-liner library by Sjoerd Visscher and Xia Li-yao.