The origami package

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.


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.


Versions0.0.1, 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6
Change logNone available
Dependenciesbase (==4.*), bifunctors (==4.2.*), containers (==0.5.*), lens (==4.7.*), mtl (==2.1.*), pretty (==1.1.*), template-haskell [details]
Copyright(c) 2015 Eric Nedervold
AuthorEric Nedervold<>
MaintainerEric Nedervold<>
Home page
Bug tracker
Source repositoryhead: git clone git://
UploadedSun Feb 8 02:53:19 UTC 2015 by nedervold




Maintainers' corner

For package maintainers and hackage trustees