The latest version of linear-generics is 0.2.3-2.

linear-generics

Version 0.1.0.1 revision 0 uploaded by dfeuer.

Package meta

Synopsis
Generic programming library for generalised deriving.
Description

This package offers a version of GHC.Generics with two important improvements:

  1. The to, from, to1, and from1 methods have multiplicity-polymorphic types, allowing them to be used with either traditional Haskell code or linearly typed code.

  2. The representations used for Generic1 are modified slightly. As a result, to1 and from1 never need to use fmap. This can greatly improve performance, and it is necessary to support multiplicity polymorphism. A smaller change, approximately as proposed by spl, reduces the number of instances that must be written to actually use Generic1 for deriving instances of other classes.

For more details, see the Generics.Linear documentation.

This library is organized as follows:

  • Generics.Linear defines the core functionality for generics, including the multiplicity-polymorphic Generic(1) classes and a replacement for the :.: composition type.

  • Generics.Linear.TH implements Template Haskell functionality for deriving instances of Generic(1).

  • Generics.Linear.Unsafe.ViaGHCGenerics offers DerivingVia targets to derive Generic and (some) Generic1 instances from their GHC.Generics counterparts. Because these instances necessarily use unsafe coercions, their use will likely inhibit full optimization of code using them.

Educational code: the educational modules exported by generic-deriving have been copied into the tests/Generic/Deriving directory in this repository, with the very few modifications required to accommodate the differences between the Generic1 representations here and in base. All the same caveats apply as in the originals; see that package's README.

Author
José Pedro Magalhães
Bug reports
https://github.com/linear-generics/linear-generics/issues
Category
Generics
Copyright
2011-2013 Universiteit Utrecht, University of Oxford, Ryan Scott, 2021 David Feuer
Homepage
https://github.com/linear-generics/linear-generics
Maintainer
David.Feuer@gmail.com
Package URL
n/a
Stability
experimental

Components