linear-generics
Version 0.1.0.0 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:
The
to
,from
,to1
, andfrom1
methods have multiplicity-polymorphic types, allowing them to be used with either traditional Haskell code or linearly typed code.The representations used for
Generic1
are modified slightly. As a result,to1
andfrom1
never need to usefmap
. 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 useGeneric1
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 deriveGeneric
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 theGeneric1
representations here and inbase
. All the same caveats apply as in the originals; see that package'sREADME
.- 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