Typeclass for builders of linear data structures
|Latest on Hackage:||0.1.0.3|
This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.
Various linear data structures can be expensive to construct in a
repetitive fashion. For example, to append a single value to the end
of a list is
O(n), and as such doing so repeatedly is recommended
As such, to efficiently construct such structures we have the notion of a builder. This can be used to more efficiently prepend and append values, and at the end we "run" the builder to construct the overall value.
This module provides an abstraction over various builders for specific data structures. It also aims to minimise the number of functions required to add various values to the builder by using a typeclass and newtype wrappers.
To construct a value from it's builder:
Start with either
for an empty
Builder, or if you have an initial value use
Add initial values to the front or back using
Once you've finished constructing your builder, create your final value with
Note: all instances are defined for both strict and lazy
* Bump dependencies for base and text.
* Actually point to the correct source-repository
* Add source-repository information to .cabal file
* Add changelog file
* Initial release