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:
vectorprovides well-optimizedInt-indexed arrays, encouraging simple and effective solutions.sdpallows you to refer to elements of its structures by offset, but encourages more general solutions.vectorandsdprefer to language extensions differently.vectoruses several unusual (ParallelListComp,ExistentialQuantification,KindSignatures) and questionable extensions (deprecatedRank2TypesandScopedTypeVariables, which is easy to avoid in most cases).sdpmainly uses type system extensions and non-standard syntactic constructs to deal with primitive types and operations. However,sdpis simpler as it doesn't use higher-rank polymorphism.- Both
vectorandsdpcan work with mutable and immutable data.vectorprovides some practical but limited functions for this.sdpimplements 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 casessdpalso have a lot of conversions (fromFoldable,listR,thaw,freeze, etc.). vectorconcentrates on efficiently solving practical problems, whilesdptries to provide the widest selection of operations, to be easy to entry, keep good extensibility and modifiability of behavior (through intermediate abstraction layers likeIndexandUnboxed).
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 theprimitivepackage and strive to destroy it. But seriously speaking, the difference betweenPrimandUnboxedis only in the name, andPrimMonadis almostMonadIO. If I wanted to, I could write an "adapter" for this outdated horror in one evening, but I'm a lazy butt.Storablevectors.sdpcan 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.