generic-data: Utilities for GHC.Generics

[ generics, library, mit ] [ Propose Tags ]

This package provides common functions on generic types. See README.


[Skip to Readme]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.1.1.0, 0.2.0.0, 0.3.0.0, 0.4.0.0, 0.5.0.0, 0.6.0.0, 0.6.0.1, 0.7.0.0, 0.8.0.0, 0.8.1.0, 0.8.2.0, 0.8.3.0, 0.9.0.0, 0.9.1.0, 0.9.2.0, 0.9.2.1, 1.0.0.0, 1.0.0.1, 1.1.0.0
Change log CHANGELOG.md
Dependencies base (>=4.9 && <4.17), base-orphans (>=0.8), contravariant, show-combinators [details]
License MIT
Copyright 2018 Li-yao Xia
Author Li-yao Xia
Maintainer lysxia@gmail.com
Revised Revision 1 made by lyxia at 2022-08-14T10:26:28Z
Category Other
Home page https://github.com/Lysxia/generic-data#readme
Source repo head: git clone https://github.com/Lysxia/generic-data
Uploaded by lyxia at 2018-09-13T02:27:43Z
Distributions Arch:1.1.0.0, Debian:0.8.3.0, LTSHaskell:1.1.0.0, NixOS:1.1.0.0, Stackage:1.1.0.0
Reverse Dependencies 14 direct, 236 indirect [details]
Downloads 25846 total (222 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-09-13 [all 1 reports]

Readme for generic-data-0.2.0.0

[back to package description]

Generic data types in Haskell Hackage Build Status

Utilities for GHC.Generics.

Generic deriving for standard classes

Supported classes that GHC currently can't derive: Semigroup, Monoid, Applicative, Alternative, Eq1, Ord1, Show1.

Other classes from base are also supported, even though GHC can already derive them:

  • Eq, Ord, Enum, Bounded, Show (standard);
  • Functor, Foldable, Traversable (via extensions, DeriveFunctor, etc.).

(Read is currently not implemented.)

To derive type classes defined elsewhere, it might be worth taking a look at one-liner.

Type metadata

Extract type names, constructor names, number and arities of constructors, etc..


generic-data aims to subsume generic deriving features of the following packages:

  • semigroups: generic Semigroup, Monoid, but with a heavy dependency footprint.
  • transformers-compat: generic Eq1, Ord1, Show1.
  • generic-deriving: doesn't derive the classes in base (defines clones of these classes as a toy example); has Template Haskell code to derive Generic.

Here are other relevant links.


All contributions are welcome. Open an issue or a pull request on Github!