origami: An un-SYB framework for transforming heterogenous data through folds
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.
The Origami package consists of a coding pattern for transforming heterogenously typed data and Template Haskell macros to support the pattern. It operates in the same problem space as SYB, but generates the boilerplate for the user.
In the pattern, we focus on a specific set of types, the fold family. For each constructor of each of those types, the user will define a function to "replace" the constructor when folding.
These functions are collected together into a single record. (Its declaration is generated for the user.) Collecting the functions together forces the typing of all the functions to remain consistent and facilitates code reuse.
For each datatype, a fold function is automatically generated that applies the fold record to values of that datatype. It decomposes the value into parts according to its constructor, recursively applies the fold to the parts, then puts them back together using the replacement constructor function from the record.
As with SYB, Origami lets the user think on a higher-level of abstraction about data transformation and relieves her from the need to write boilerplate.
See the website for more information and examples.
Properties
Versions | 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.6 |
---|---|
Change log | changelog |
Dependencies | base (>=4 && <5), bifunctors (>=4), containers (>=0.5), lens (>=4), mtl (>=2.1), pretty (>=1.1), template-haskell [details] |
License | BSD-3-Clause |
Copyright | (c) 2015 Eric Nedervold |
Author | Eric Nedervold<nedervoldsoftware@gmail.com> |
Maintainer | Eric Nedervold<nedervoldsoftware@gmail.com> |
Category | Data |
Home page | http://github.com/nedervold/origami |
Bug tracker | http://github.com/nedervold/origami/issues |
Source repo | head: git clone git://github.com/nedervold/origami.git |
Uploaded | by nedervold at 2015-10-24T13:56:06Z |
Modules
[Index]
Downloads
- origami-0.0.6.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
Package maintainers
For package maintainers and hackage trustees