SDP for Vector is an implementation of SDP classes for Vector library.
vector
is a great library focused on efficiency and usability. sdp
and
vector
perform the same task, but focus on different things:
vector
provides well-optimizedInt
-indexed arrays, encouraging simple and effective solutions.sdp
allows you to refer to elements of its structures by offset, but encourages more general solutions.vector
andsdp
refer to language extensions differently.vector
uses several unusual (ParallelListComp
,ExistentialQuantification
,KindSignatures
) and questionable extensions (deprecatedRank2Types
andScopedTypeVariables
, which is easy to avoid in most cases).sdp
mainly uses type system extensions and non-standard syntactic constructs to deal with primitive types and operations. However,sdp
is simpler as it doesn't use higher-rank polymorphism.- Both
vector
andsdp
can work with mutable and immutable data.vector
provides some practical but limited functions for this.sdp
implements two approaches: in the general case, this problem is solved using hidhly generalized conversion functions (fromIndexed
, etc.) which should work with a wide variety of structures, but for specific casessdp
also have a lot of conversions (fromFoldable
,listR
,thaw
,freeze
, etc.). vector
concentrates on efficiently solving practical problems, whilesdp
tries to provide the widest selection of operations, to be easy to entry, keep good extensibility and modifiability of behavior (through intermediate abstraction layers likeIndex
andUnboxed
).
The combination of sdp
and vector
is a combination of versatility and
convenience with efficiency and pragmatism.
The capabilities of this wrapper are limited by the subject area of the vector
library and my penchant for lazy programming:
- The library doesn't yet contain instances for
Set
. primitive
-based garbage. To begin with, I hate theprimitive
package and strive to destroy it. But seriously speaking, the difference betweenPrim
andUnboxed
is only in the name, andPrimMonad
is almostMonadIO
. If I wanted to, I could write an "adapter" for this outdated horror in one evening, but I'm a lazy butt.Storable
vectors.sdp
can work with pointers, but for the most part avoids them. Possibly, support forPtr
-based structures will be added after stable release ofsdp-foreign
. Now this is just another not very useful vector.- Mutable vectors because they just makes immutable operations strict. I don't want to wrap pure evaluations into a monad without special need.
sdp4vector
follows of the Haskell PVP and sdp
wrapper rules.