The origami package

[maintain]

This package provides a framework for transforming heterogenous data in a typed manner using folds and provides Template Haskell macros for automatically producing the necessary boilerplate.

Given a set of datatypes, we generate a record declaration called Fold, parameterized over one type variable for each datatype. For each constructor Xxx used by any of these types, a field mkXxx is generated. (A few utility Fold values are additionally defined.)

For each datatype Yyy, we also generate a foldYyy function that applies a Fold to its Yyy argument, resulting in a yyy value. Conceptually, any constructor Xxx in the argument or any of its sub-components is recursively replaced bottom-up by an application of mkXxx.

The set of datatypes, the fold family, is specified by giving a list of root datatypes. Datatypes may be designated as atomic: they will not be recursed into.

In general, the framework does not handle parameterized datatypes, but applications of Traversable, Bitraversable, or Tritraversable can be handled, if declared by the user. The n-ary functors are treated as transparent and traversed through.

See the website for more information and examples.

Properties

Versions0.0.1, 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6
Dependenciesbase (==4.*), bifunctors (==4.2.*), containers (==0.5.*), lens (==4.7.*), mtl (==2.1.*), pretty (==1.1.*), template-haskell [details]
LicenseBSD3
Copyright(c) 2015 Eric Nedervold
AuthorEric Nedervold<nedervoldsoftware@gmail.com>
MaintainerEric Nedervold<nedervoldsoftware@gmail.com>
Stabilityalpha
CategoryData
Home pagehttp://github.com/nedervold/origami
Bug trackerhttp://github.com/nedervold/origami/issues
Source repositoryhead: git clone git://github.com/nedervold/origami.git
UploadedSun Feb 8 02:53:19 UTC 2015 by nedervold

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees