packman alternatives and similar packages
Based on the "Data" category.
Alternatively, view packman alternatives based on common mentions on social networks and blogs.
-
semantic-source
Parsing, analyzing, and comparing source code across many languages -
lens
Lenses, Folds, and Traversals - Join us on web.libera.chat #haskell-lens -
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. -
resource-pool
A high-performance striped resource pooling implementation for Haskell -
primitive
This package provides various primitive memory-related operations. -
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 -
IORefCAS
A collection of different packages for CAS based data structures. -
dependent-map
Dependently-typed finite maps (partial dependent products) -
dependent-sum
Dependent sums and supporting typeclasses for comparing and displaying them -
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 -
text-icu
This package provides the Haskell Data.Text.ICU library, for performing complex manipulation of Unicode text. -
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 packman or a related project?
README
Packman
Evaluation-orthogonal serialisation of Haskell data, as a library
Haskell API
This package provides Haskell data serialisation independent of evaluation, by accessing the Haskell heap using foreign primitive operations. Any Haskell data structure (with a few limitations) can be serialised and later deserialised in the same or a new run of the same program (that means, the same executable file).
A Haskell API around the C-implemented core provides the following API:
trySerializeWith :: a -> Int -> IO (Serialized a) -- Int is maximum buffer size to use
trySerialize :: a -> IO (Serialized a) -- uses default (maximum) buffer size
deserialize :: Serialized a -> IO a
Note that this serialisation is orthogonal to evaluation: the argument is serialised in its current state of evaluation, it might be entirely unevaluated (a thunk) or only partially evaluated (containing thunks).
The Serialized a
type is an opaque representation of serialised Haskell data (it
contains a ByteArray
). Serialized a
provides instances for Show
and Read
which satisfy read . show == id
, and a Binary
instance. For these instances,
types are checked dynamically type-safe, therefore the Typeable
context.
Advantages
The library enables sending and receiving data between different nodes of a distributed Haskell system. This is where the code originated: the Eden runtime system. You might want to read a related paper which describes parts of it ( IFL 2006 ).
Apart from this obvious application, the functionality can be used to optimise programs by memoisation (across different program runs), and to checkpoint program execution in selected places. Both uses are exemplified in the slide set linked above.
Drawbacks
As serialisation essentially provides a way to duplicate data (and therefore destroy sharing), certain data should not be serialisable. Most prominently, these include the mutable types MVar
, IORef
, and all STM-related types. However, the presence of those types is sometimes not apparent; they occur within the thunk computing a value of different type. The most annoying example is lazy file I/O: lazily reading a file entails holding a "half-closed" file handle (essentially an MVar), and will make serialisation fail for the read data.
The ugly solution in the library: the API signals such conditions as exceptions.
Another limitation is that serialised data can only be used by the very same binary. This is however common for many approaches to distributed programming using functional languages.
If you find this library useful, I would be happy to hear from you. Patches are welcome.
Reading material
In brief, this is the packing code of Eden and GpH, ripped out of the runtime system and rewritten to make it thread-safe and return exception codes when it fails.
Most of what is provided by the library was already there when I presented at HIW in 2013, see slides from HIW 2013 but all code was in the runtime system then.
The basic idea was described earlier, in a 2010 IFL paper, including a study of possible applications, especially checkpointing and memoisation.
Acknowledgements
The idea to separate serialisation from other functionality of the parallel runtime system was suggested by Phil Trinder in 2009.
Hans-Wolfgang Loidl introduced me to the GUM packing code, worked with me on the parallel runtime system for a long time, and always provided valuable feedback.
Kevin Hammond is the original author of the packing code used by packman and the Eden RTS. It has been rewritten a few times and improved by a number of people (including Phil Trinder and Hans-Wolfgang Loidl).
Michael Budde and Åsbjørn Jøkladal assembled the first cabalised library version as a student project in our course "Topics in programming languages" 2014 (where the topic was parallel functional programming).