It is a library for simple data processing. sdp is inspired by array,
vector, bytestring, containers and repa. sdp is focused on efficiency,
openness and simplicity.
Originally sdp was created as array replacement. Now its main purpose was to
provide the most comfortable interface for working with various data structures:
eliminate name conflicts with other libraries and between them, simplify their
interaction, make code even more versatile and reusable.
All predefined structures are based on pseudo-primitive types SArray#,
SBytes#, STArray#, STBytes#, MIOArray#, MIOBytes# that encapsulate
real primitives with correct size and offset.
sdp uses templates to define more complex structures:
AnyBorderadds explicit boundaries of arbitrary typeAnyChunksdefines an unrolled list of given elements
Based on pseudo-primitives and templates, the following are defined:
- immutable arrays with immutable explicit immutable boundaries:
ArrayandBytes - mutable arrays with immutable explicit immutable boundaries:
STArrayandSTBytes,MIOArray(IOArray) andMIOBytes(IOBytes) - immutable unrolled lists with immutable implicit boundaries:
UnlistandUblist - mutable unrolled lists with immutable implicit boundaries:
STUnlistandSTUblist,MIOUnlist(IOUnlist) andMIOUblist(IOUblist) - immutable unrolled lists with explicit immutable boundaries:
UnrolledandByteList - mutable unrolled lists with explicit immutable boundaries
STUnrolledandSTByteList,MIOUnrolled(IOUnrolled) andMIOByteList(IOByteList)
sdp generalize the most popular operations on linear (list-like) and
associative data structures including selection, splitting and sorting. With
sdp list functions aren't overlap their counterparts for other structures.
Nullableis a service class of structures with null values.Borderedis a class of structures with borders and finite number of elements.Estimateis a service class for efficiently (at least, in finite time) estimating the length of a structure or compare pair of structures by length (in finite time if at least one of them is finite). Allows to express such conditions as:
xs .<. ys -- length xs < length ys
es .== 10 -- length es == 10
es .> 5 -- length es > 5
Unboxedis a service class that simplifies interacting with data stored inByteArray#andMutableArray#. Used in containers that based onSBytes#,STBytes#orIOBytes#.Shapeis a service class for dimension operations and finite-dimensional index transformations.Indexis a service class that generalizesEnumto interval operations, replacesIx.Linearis a class of linear structures that generalizes the standard list functions.SplitisLinearextension, which implements additional list-like operations likesplit(At)takeWhile,isPrefixOf, etc.Indexedis a class of indexed structures that generalizes read and modify operations immutable structures.Shapedis a class of operations on structures generalized by the type of index. Provides safe change of range and index type, fast extraction of subsequences.Mapis a class of operations on associative arrays (dictionaries).Setis a class of operations on sets.Zipis a class that generalizes zipping operations (seezip,zipWith,ZipList, etc.).Scanis a class of convolutions with intermediate values.Sortis a sorting class for immutable structures.BorderedM,LinearM,SplitM,IndexedM,SortM- classes of operations on mutable containers.
sdp follow Haskell Package Versioning Policy. To
simplify the search for extensions, I also recommend the following rules:
- The
MAJORversion of the derivative must match the smallestMAJORversion ofsdpwith which it's compatible. - Extensions should be called
sdp-%extensionname%(e.g.sdp-quickcheck). - Wrappers should be called
sdp4%libraryname%(e.g.,sdp4text).
The SDP category is intended for sdp classes and primitives, as for
structures whose names are already taken in the Data category. It shouldn't be
used instead of System, Control, Foreign, etc.
For details of the process for submitting pull requests, please read CONTRIBUTING.md.
sdp is FOSS (free and open source software), you can redistribute it and/or
modify it under the terms of the BSD3 license. sdp is distributed in the hope
that it will be useful, but without any warranty, without even the implied
warranty of merchantability or fitness for a particular purpose. See the LICENSE
file for more details.