vector-map-0.1.0.0: An efficient VMap that is backed by two vectors: one for keys and another for values.
Safe Haskell None
Language Haskell2010

Data.VMap

Synopsis

Documentation

class MVector ( Mutable v) a => Vector (v :: Type -> Type ) a Source #

Class of immutable vectors. Every immutable vector is associated with its mutable version through the Mutable type family. Methods of this class should not be used directly. Instead, Data.Vector.Generic and other Data.Vector modules provide safe and fusible wrappers.

Minimum complete implementation:

Instances

Instances details
Vector Vector Bool
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Char
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Double
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Float
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Int
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Int8
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Int16
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Int32
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Int64
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Word
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Word8
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Word16
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Word32
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Word64
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector ()
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector All
Instance details

Defined in Data.Vector.Unboxed.Base

Vector Vector Any
Instance details

Defined in Data.Vector.Unboxed.Base

Storable a => Vector Vector a
Instance details

Defined in Data.Vector.Storable

Prim a => Vector Vector a
Instance details

Defined in Data.Vector.Primitive

Vector Vector a
Instance details

Defined in Data.Vector

Unbox a => Vector Vector ( Complex a)
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox a => Vector Vector ( Min a)
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox a => Vector Vector ( Max a)
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox a => Vector Vector ( First a)
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox a => Vector Vector ( Last a)
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox a => Vector Vector ( WrappedMonoid a)
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox a => Vector Vector ( Identity a)
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox a => Vector Vector ( Dual a)
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox a => Vector Vector ( Sum a)
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox a => Vector Vector ( Product a)
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox a => Vector Vector ( Down a)
Instance details

Defined in Data.Vector.Unboxed.Base

( Unbox a, Unbox b) => Vector Vector (a, b)
Instance details

Defined in Data.Vector.Unboxed.Base

( Unbox a, Unbox b) => Vector Vector ( Arg a b)
Instance details

Defined in Data.Vector.Unboxed.Base

( Unbox a, Unbox b, Unbox c) => Vector Vector (a, b, c)
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox a => Vector Vector ( Const a b)
Instance details

Defined in Data.Vector.Unboxed.Base

Unbox (f a) => Vector Vector ( Alt f a)
Instance details

Defined in Data.Vector.Unboxed.Base

( Unbox a, Unbox b, Unbox c, Unbox d) => Vector Vector (a, b, c, d)
Instance details

Defined in Data.Vector.Unboxed.Base

( Unbox a, Unbox b, Unbox c, Unbox d, Unbox e) => Vector Vector (a, b, c, d, e)
Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector ( PrimState m) (a, b, c, d, e) -> m ( Vector (a, b, c, d, e)) Source #

basicUnsafeThaw :: PrimMonad m => Vector (a, b, c, d, e) -> m ( Mutable Vector ( PrimState m) (a, b, c, d, e)) Source #

basicLength :: Vector (a, b, c, d, e) -> Int Source #

basicUnsafeSlice :: Int -> Int -> Vector (a, b, c, d, e) -> Vector (a, b, c, d, e) Source #

basicUnsafeIndexM :: Monad m => Vector (a, b, c, d, e) -> Int -> m (a, b, c, d, e) Source #

basicUnsafeCopy :: PrimMonad m => Mutable Vector ( PrimState m) (a, b, c, d, e) -> Vector (a, b, c, d, e) -> m () Source #

elemseq :: Vector (a, b, c, d, e) -> (a, b, c, d, e) -> b0 -> b0 Source #

Unbox (f (g a)) => Vector Vector ( Compose f g a)
Instance details

Defined in Data.Vector.Unboxed.Base

( Unbox a, Unbox b, Unbox c, Unbox d, Unbox e, Unbox f) => Vector Vector (a, b, c, d, e, f)
Instance details

Defined in Data.Vector.Unboxed.Base

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector ( PrimState m) (a, b, c, d, e, f) -> m ( Vector (a, b, c, d, e, f)) Source #

basicUnsafeThaw :: PrimMonad m => Vector (a, b, c, d, e, f) -> m ( Mutable Vector ( PrimState m) (a, b, c, d, e, f)) Source #

basicLength :: Vector (a, b, c, d, e, f) -> Int Source #

basicUnsafeSlice :: Int -> Int -> Vector (a, b, c, d, e, f) -> Vector (a, b, c, d, e, f) Source #

basicUnsafeIndexM :: Monad m => Vector (a, b, c, d, e, f) -> Int -> m (a, b, c, d, e, f) Source #

basicUnsafeCopy :: PrimMonad m => Mutable Vector ( PrimState m) (a, b, c, d, e, f) -> Vector (a, b, c, d, e, f) -> m () Source #

elemseq :: Vector (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> b0 -> b0 Source #

( Vector kv k, Vector vv v) => Vector ( KVVector kv vv) (k, v) Source #
Instance details

Defined in Data.VMap.KVVector

newtype VMap kv vv k v Source #

Constructors

VMap

Fields

Instances

Instances details
( Vector kv k, Vector vv v, Ord k) => IsList ( VMap kv vv k v) Source #
Instance details

Defined in Data.VMap

Associated Types

type Item ( VMap kv vv k v) Source #

Methods

fromList :: [ Item ( VMap kv vv k v)] -> VMap kv vv k v Source #

fromListN :: Int -> [ Item ( VMap kv vv k v)] -> VMap kv vv k v Source #

toList :: VMap kv vv k v -> [ Item ( VMap kv vv k v)] Source #

( Eq (kv k), Eq (vv v)) => Eq ( VMap kv vv k v) Source #
Instance details

Defined in Data.VMap

Methods

(==) :: VMap kv vv k v -> VMap kv vv k v -> Bool Source #

(/=) :: VMap kv vv k v -> VMap kv vv k v -> Bool Source #

( Show k, Show v, Vector kv k, Vector vv v) => Show ( VMap kv vv k v) Source #
Instance details

Defined in Data.VMap

Generic ( VMap kv vv k v) Source #
Instance details

Defined in Data.VMap

Associated Types

type Rep ( VMap kv vv k v) :: Type -> Type Source #

Methods

from :: VMap kv vv k v -> Rep ( VMap kv vv k v) x Source #

to :: Rep ( VMap kv vv k v) x -> VMap kv vv k v Source #

( Vector kv k, Vector vv v, Ord k) => Semigroup ( VMap kv vv k v) Source #
Instance details

Defined in Data.VMap

Methods

(<>) :: VMap kv vv k v -> VMap kv vv k v -> VMap kv vv k v Source #

sconcat :: NonEmpty ( VMap kv vv k v) -> VMap kv vv k v Source #

stimes :: Integral b => b -> VMap kv vv k v -> VMap kv vv k v Source #

( Vector kv k, Vector vv v, Ord k) => Monoid ( VMap kv vv k v) Source #
Instance details

Defined in Data.VMap

Methods

mempty :: VMap kv vv k v Source #

mappend :: VMap kv vv k v -> VMap kv vv k v -> VMap kv vv k v Source #

mconcat :: [ VMap kv vv k v] -> VMap kv vv k v Source #

( Typeable kv, Typeable vv, ToCBOR k, ToCBOR v, Ord k, Vector kv k, Vector vv v) => ToCBOR ( VMap kv vv k v) Source #
Instance details

Defined in Data.VMap

( Typeable kv, Typeable vv, FromCBOR k, FromCBOR v, Ord k, Vector kv k, Vector vv v) => FromCBOR ( VMap kv vv k v) Source #
Instance details

Defined in Data.VMap

( NFData (kv k), NFData (vv v)) => NFData ( VMap kv vv k v) Source #
Instance details

Defined in Data.VMap

Methods

rnf :: VMap kv vv k v -> () Source #

( NoThunks (kv k), NoThunks (vv v), Typeable kv, Typeable vv, Typeable k, Typeable v) => NoThunks ( VMap kv vv k v) Source #
Instance details

Defined in Data.VMap

type Rep ( VMap kv vv k v) Source #
Instance details

Defined in Data.VMap

type Rep ( VMap kv vv k v) = D1 (' MetaData "VMap" "Data.VMap" "vector-map-0.1.0.0-5O8aYQeM00kIcIXV60u2Tb" ' True ) ( C1 (' MetaCons "VMap" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "unVMap") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( KVVector kv vv (k, v)))))
type Item ( VMap kv vv k v) Source #
Instance details

Defined in Data.VMap

type Item ( VMap kv vv k v) = (k, v)

lookup :: ( Ord k, Vector kv k, Vector vv v) => k -> VMap kv vv k v -> Maybe v Source #

findWithDefault :: ( Ord k, Vector kv k, Vector vv v) => v -> k -> VMap kv vv k v -> v Source #

map :: ( Vector vv a, Vector vv b) => (a -> b) -> VMap kv vv k a -> VMap kv vv k b Source #

mapMaybe :: ( Vector kv k, Vector vv a, Vector vv b) => (a -> Maybe b) -> VMap kv vv k a -> VMap kv vv k b Source #

mapWithKey :: ( Vector kv k, Vector vv a, Vector vv b) => (k -> a -> b) -> VMap kv vv k a -> VMap kv vv k b Source #

filter :: ( Vector kv k, Vector vv v) => (k -> v -> Bool ) -> VMap kv vv k v -> VMap kv vv k v Source #

fold :: ( Vector vv m, Monoid m) => VMap kv vv k m -> m Source #

Fold values monoidally

foldl :: Vector vv v => (a -> v -> a) -> a -> VMap kv vv k v -> a Source #

foldlWithKey :: ( Vector kv k, Vector vv v) => (a -> k -> v -> a) -> a -> VMap kv vv k v -> a Source #

foldMap :: ( Vector vv v, Monoid m) => (v -> m) -> VMap kv vv k v -> m Source #

foldMapWithKey :: ( Vector kv k, Vector vv v, Monoid m) => (k -> v -> m) -> VMap kv vv k v -> m Source #

toMap :: ( Vector kv k, Vector vv v) => VMap kv vv k v -> Map k v Source #

fromList :: ( Ord k, Vector kv k, Vector vv v) => [(k, v)] -> VMap kv vv k v Source #

fromListN :: ( Ord k, Vector kv k, Vector vv v) => Int -> [(k, v)] -> VMap kv vv k v Source #

toList :: ( Vector kv k, Vector vv v) => VMap kv vv k v -> [(k, v)] Source #

toAscList :: ( Vector kv k, Vector vv v) => VMap kv vv k v -> [(k, v)] Source #

keys :: Vector kv k => VMap kv vv k v -> [k] Source #

elems :: Vector vv v => VMap kv vv k v -> [v] Source #

fromAscList :: ( Eq k, Vector kv k, Vector vv v) => [(k, v)] -> VMap kv vv k v Source #

fromAscListN :: ( Eq k, Vector kv k, Vector vv v) => Int -> [(k, v)] -> VMap kv vv k v Source #

fromAscListWithKey :: ( Eq k, Vector kv k, Vector vv v) => (k -> v -> v -> v) -> [(k, v)] -> VMap kv vv k v Source #

fromAscListWithKeyN :: ( Eq k, Vector kv k, Vector vv v) => Int -> (k -> v -> v -> v) -> [(k, v)] -> VMap kv vv k v Source #

fromDistinctAscList :: ( Vector kv k, Vector vv v) => [(k, v)] -> VMap kv vv k v Source #

splitAt :: ( Vector vv v, Vector kv k) => Int -> VMap kv vv k v -> ( VMap kv vv k v, VMap kv vv k v) Source #

data KVMVector kmv vmv s a Source #

Instances

Instances details
( MVector kmv k, MVector vmv v) => MVector ( KVMVector kmv vmv) (k, v) Source #
Instance details

Defined in Data.VMap.KVVector

data KVVector kv vv a Source #

Instances

Instances details
( Vector kv k, Vector vv v) => Vector ( KVVector kv vv) (k, v) Source #
Instance details

Defined in Data.VMap.KVVector

( Vector kv k, Vector vv v, Ord k) => IsList ( KVVector kv vv (k, v)) Source #
Instance details

Defined in Data.VMap.KVVector

Associated Types

type Item ( KVVector kv vv (k, v)) Source #

Methods

fromList :: [ Item ( KVVector kv vv (k, v))] -> KVVector kv vv (k, v) Source #

fromListN :: Int -> [ Item ( KVVector kv vv (k, v))] -> KVVector kv vv (k, v) Source #

toList :: KVVector kv vv (k, v) -> [ Item ( KVVector kv vv (k, v))] Source #

( Eq (kv k), Eq (vv v)) => Eq ( KVVector kv vv (k, v)) Source #
Instance details

Defined in Data.VMap.KVVector

Methods

(==) :: KVVector kv vv (k, v) -> KVVector kv vv (k, v) -> Bool Source #

(/=) :: KVVector kv vv (k, v) -> KVVector kv vv (k, v) -> Bool Source #

( Show (kv k), Show (vv v)) => Show ( KVVector kv vv (k, v)) Source #
Instance details

Defined in Data.VMap.KVVector

Generic ( KVVector kv vv a) Source #
Instance details

Defined in Data.VMap.KVVector

Associated Types

type Rep ( KVVector kv vv a) :: Type -> Type Source #

( Vector kv k, Vector vv v, Ord k) => Semigroup ( KVVector kv vv (k, v)) Source #
Instance details

Defined in Data.VMap.KVVector

Methods

(<>) :: KVVector kv vv (k, v) -> KVVector kv vv (k, v) -> KVVector kv vv (k, v) Source #

sconcat :: NonEmpty ( KVVector kv vv (k, v)) -> KVVector kv vv (k, v) Source #

stimes :: Integral b => b -> KVVector kv vv (k, v) -> KVVector kv vv (k, v) Source #

( Vector kv k, Vector vv v, Ord k) => Monoid ( KVVector kv vv (k, v)) Source #
Instance details

Defined in Data.VMap.KVVector

Methods

mempty :: KVVector kv vv (k, v) Source #

mappend :: KVVector kv vv (k, v) -> KVVector kv vv (k, v) -> KVVector kv vv (k, v) Source #

mconcat :: [ KVVector kv vv (k, v)] -> KVVector kv vv (k, v) Source #

( ToCBOR k, ToCBOR v, Ord k, Vector kv k, Vector vv v, Typeable kv, Typeable vv) => ToCBOR ( KVVector kv vv (k, v)) Source #
Instance details

Defined in Data.VMap.KVVector

( FromCBOR k, FromCBOR v, Ord k, Vector kv k, Vector vv v, Typeable kv, Typeable vv) => FromCBOR ( KVVector kv vv (k, v)) Source #
Instance details

Defined in Data.VMap.KVVector

( NFData (kv k), NFData (vv v)) => NFData ( KVVector kv vv (k, v)) Source #
Instance details

Defined in Data.VMap.KVVector

Methods

rnf :: KVVector kv vv (k, v) -> () Source #

( NoThunks (kv k), NoThunks (vv v), Typeable kv, Typeable vv, Typeable k, Typeable v) => NoThunks ( KVVector kv vv (k, v)) Source #
Instance details

Defined in Data.VMap.KVVector

type Mutable ( KVVector kv vv) Source #
Instance details

Defined in Data.VMap.KVVector

type Rep ( KVVector kv vv a) Source #
Instance details

Defined in Data.VMap.KVVector

type Rep ( KVVector kv vv a)
type Item ( KVVector kv vv (k, v)) Source #
Instance details

Defined in Data.VMap.KVVector

type Item ( KVVector kv vv (k, v)) = (k, v)

normalize :: ( Vector kv k, Vector vv v, Ord k) => KVVector kv vv (k, v) -> KVVector kv vv (k, v) Source #