stack-prism alternatives and similar packages
Based on the "Data" category.
Alternatively, view stack-prism alternatives based on common mentions on social networks and blogs.
-
lens
Lenses, Folds, and Traversals - Join us on web.libera.chat #haskell-lens -
semantic-source
Parsing, analyzing, and comparing source code across many languages -
code-builder
Packages for defining APIs, running them, generating client code and documentation. -
text
Haskell library for space- and time-efficient operations over Unicode text. -
unordered-containers
Efficient hashing-based container types -
compendium-client
Mu (μ) is a purely functional framework for building micro services. -
cassava
A CSV parsing and encoding library optimized for ease of use and high performance -
holmes
A reference library for constraint-solving with propagators and CDCL. -
binary
Efficient, pure binary serialisation using ByteStrings in Haskell. -
primitive
This package provides various primitive memory-related operations. -
resource-pool
A high-performance striped resource pooling implementation for Haskell -
discrimination
Fast linear time sorting and discrimination for a large class of data types -
reflection
Reifies arbitrary Haskell terms into types that can be reflected back into terms -
dependent-sum
Dependent sums and supporting typeclasses for comparing and displaying them -
IORefCAS
A collection of different packages for CAS based data structures. -
audiovisual
Extensible records, variants, structs, effects, tangles -
dependent-map
Dependently-typed finite maps (partial dependent products) -
text-icu
This package provides the Haskell Data.Text.ICU library, for performing complex manipulation of Unicode text. -
orgmode-parse
Attoparsec parser combinators for parsing org-mode structured text! -
streaming
An optimized general monad transformer for streaming applications, with a simple prelude of functions -
safecopy
An extension to Data.Serialize with built-in version control -
uuid-types
A Haskell library for creating, printing and parsing UUIDs -
scientific
Arbitrary-precision floating-point numbers represented using scientific notation
Access the most powerful time series database as a service
Do you think we are missing an alternative of stack-prism or a related project?
README
A Haskell library for expressing and deriving stack prisms.
A stack prism is a bidirectional isomorphism that is partial in the backward direction. These prisms are compatible with the lens library.
Stack prisms can express constructor-deconstructor pairs. For example:
nil :: StackPrism t ([a] :- t)
nil = stackPrism f g
where
f t = [] :- t
g ([] :- t) = Just t
g _ = Nothing
cons :: StackPrism (a :- [a] :- t) ([a] :- t)
cons = stackPrism f g
where
f (x :- xs :- t) = (x : xs) :- t
g ((x : xs) :- t) = Just (x :- xs :- t)
g _ = Nothing
Here :-
can be read as 'cons', forming a stack of values. For example, nil
pushes []
onto the stack; or, in the backward direction, tries to remove []
from the stack. cons
takes a head x
and tail xs
from the stack and pushes
x : xs
onto the stack, or, in the backward direction, takes x : xs
from the
stack and replaces it with its two individual components.
Every constructor has its own stack prism version. You don't have to write them
by hand; you can automatically generate them, either using Template Haskell
(see module Data.StackPrism.TH
) or using GHC generic programming (see
module Data.StackPrism.Generic
).
Representing constructor-destructor pairs as stack manipulators allows them to be composed more easily.