linear-generics: Generic programming library for generalised deriving.
This package offers a version of GHC.Generics with two important improvements:
from1methods have multiplicity-polymorphic types, allowing them to be used with either traditional Haskell code or linearly typed code.
The representations used for
Generic1are modified slightly. As a result,
from1never 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
Generic1for deriving instances of other classes.
For more details, see the Generics.Linear documentation.
The implementation is based on the
generic-deriving package, first described in the paper
A generic deriving mechanism for Haskell. Jose Pedro Magalhaes, Atze Dijkstra, Johan Jeuring, and Andres Loeh. Haskell'10.
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
Generics.Linear.TH implements Template Haskell functionality for deriving instances of
DerivingViatargets to derive
GHC.Generics.. 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
have been copied into the
in this repository, with the very few modifications required to
accommodate the differences between the
here and in
base. All the same caveats apply as in the originals;
see that package's
[Skip to Readme]
|Versions [RSS]||0.1.0.0, 0.1.0.1, 0.2, 0.2.1, 0.2.2 (info)|
|Dependencies||base (>=4.15 && <5), containers (>=0.5.9 && <0.7), ghc-prim (<1), template-haskell (>=2.16 && <2.21), th-abstraction (>=0.5 && <0.6) [details]|
|Copyright||2011-2013 Universiteit Utrecht, University of Oxford, Ryan Scott, 2021 David Feuer|
|Author||José Pedro Magalhães|
|Source repo||head: git clone https://github.com/linear-generics/linear-generics|
|Uploaded||by dfeuer at 2023-03-26T01:35:24Z|
|Distributions||Arch:0.2.1, LTSHaskell:0.2.1, NixOS:0.2.1, Stackage:0.2.2|
|Reverse Dependencies||2 direct, 14 indirect [details]|
|Downloads||983 total (79 in the last 30 days)|
|Rating||(no votes yet) [estimated by Bayesian average]|
|Status||Docs available [build log]
Last success reported on 2023-03-26 [all 1 reports]