Safe Haskell | None |
---|---|
Language | Haskell2010 |
Dense primitive arrays where the lower index is zero (or the equivalent of zero for newtypes and enumerations).
Actual write
s to data structures use a more safe write
instead of
the unsafe unsafeWrite
. Writes also tend to occur much less in DP
algorithms (say, N^2 writes for an N^3 time algorithm -- mostly reads
are being executed).
TODO consider if we want to force the lower index to be zero, or allow
non-zero lower indices. Will have to be considered together with the
Index.Class
module!
TODO while Unboxed
is, in princile, Hashable
, we'd need the
corresponding VU.Vector
instances ...
TODO rename to Dense.Vector, since there are other possibilities to store, without basing on vector.
Documentation
Dense | |
|
Instances
(Index sh, Vector v e, Vector v e') => PrimArrayMap (Dense v :: Type -> Type -> Type) (sh :: Type) e e' Source # | |
(Show (LimitType sh), Show (Mutable v (PrimState m) e), Mutable v (PrimState m) e ~ mv) => Show (MutArr m (Dense v sh e)) Source # | |
Generic (MutArr m (Dense v sh e)) Source # | |
(NFData (LimitType sh), NFData (Mutable v (PrimState m) e), Mutable v (PrimState m) e ~ mv) => NFData (MutArr m (Dense v sh e)) Source # | |
Defined in Data.PrimitiveArray.Dense | |
(Index sh, Vector v e) => PrimArrayOps (Dense v) sh e Source # | |
Defined in Data.PrimitiveArray.Dense upperBound :: Dense v sh e -> LimitType sh Source # unsafeIndex :: Dense v sh e -> sh -> e Source # safeIndex :: Dense v sh e -> sh -> Maybe e Source # transformShape :: Index sh' => (LimitType sh -> LimitType sh') -> Dense v sh e -> Dense v sh' e Source # upperBoundM :: forall (m :: Type -> Type). MutArr m (Dense v sh e) -> LimitType sh Source # fromListM :: PrimMonad m => LimitType sh -> [e] -> m (MutArr m (Dense v sh e)) Source # newM :: PrimMonad m => LimitType sh -> m (MutArr m (Dense v sh e)) Source # newSM :: (Monad m, PrimMonad m) => LimitType sh -> FillStruc (Dense v sh e) -> m (MutArr m (Dense v sh e)) Source # newWithM :: PrimMonad m => LimitType sh -> e -> m (MutArr m (Dense v sh e)) Source # newWithSM :: (Monad m, PrimMonad m) => LimitType sh -> FillStruc (Dense v sh e) -> e -> m (MutArr m (Dense v sh e)) Source # readM :: PrimMonad m => MutArr m (Dense v sh e) -> sh -> m e Source # safeReadM :: (Monad m, PrimMonad m) => MutArr m (Dense v sh e) -> sh -> m (Maybe e) Source # writeM :: PrimMonad m => MutArr m (Dense v sh e) -> sh -> e -> m () Source # safeWriteM :: (Monad m, PrimMonad m) => MutArr m (Dense v sh e) -> sh -> e -> m () Source # unsafeFreezeM :: PrimMonad m => MutArr m (Dense v sh e) -> m (Dense v sh e) Source # unsafeThawM :: PrimMonad m => Dense v sh e -> m (MutArr m (Dense v sh e)) Source # | |
Functor v => Functor (Dense v sh) Source # | |
(Eq (LimitType sh), Eq (v e)) => Eq (Dense v sh e) Source # | |
(Data (v e), Data (LimitType sh), Data e, Data sh, Typeable sh, Typeable e, Typeable v) => Data (Dense v sh e) Source # | |
Defined in Data.PrimitiveArray.Dense gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Dense v sh e -> c (Dense v sh e) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Dense v sh e) # toConstr :: Dense v sh e -> Constr # dataTypeOf :: Dense v sh e -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Dense v sh e)) # dataCast2 :: Typeable t => (forall d e0. (Data d, Data e0) => c (t d e0)) -> Maybe (c (Dense v sh e)) # gmapT :: (forall b. Data b => b -> b) -> Dense v sh e -> Dense v sh e # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Dense v sh e -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Dense v sh e -> r # gmapQ :: (forall d. Data d => d -> u) -> Dense v sh e -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Dense v sh e -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Dense v sh e -> m (Dense v sh e) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Dense v sh e -> m (Dense v sh e) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Dense v sh e -> m (Dense v sh e) # | |
(Read (LimitType sh), Read (v e)) => Read (Dense v sh e) Source # | |
(Show (LimitType sh), Show (v e)) => Show (Dense v sh e) Source # | |
(Generic (LimitType sh), Generic (v e)) => Generic (Dense v sh e) Source # | |
(NFData (LimitType sh), NFData (v e)) => NFData (Dense v sh e) Source # | |
Defined in Data.PrimitiveArray.Dense | |
(Hashable (LimitType sh), Hashable (v e), Generic (LimitType sh), Generic (v e)) => Hashable (Dense v sh e) Source # | |
Defined in Data.PrimitiveArray.Dense | |
(ToJSON (LimitType sh), ToJSON (v e), Generic (LimitType sh), Generic (v e)) => ToJSON (Dense v sh e) Source # | |
Defined in Data.PrimitiveArray.Dense | |
(FromJSON (LimitType sh), FromJSON (v e), Generic (LimitType sh), Generic (v e)) => FromJSON (Dense v sh e) Source # | |
(Binary (LimitType sh), Binary (v e), Generic (LimitType sh), Generic (v e)) => Binary (Dense v sh e) Source # | |
(Serialize (LimitType sh), Serialize (v e), Generic (LimitType sh), Generic (v e)) => Serialize (Dense v sh e) Source # | |
data MutArr m (Dense v sh e) Source # | |
type Rep (MutArr m (Dense v sh e)) Source # | |
Defined in Data.PrimitiveArray.Dense type Rep (MutArr m (Dense v sh e)) = D1 ('MetaData "MutArr" "Data.PrimitiveArray.Dense" "PrimitiveArray-0.10.1.0-8LhqXNFuZNc70s43xh6tNJ" 'False) (C1 ('MetaCons "MDense" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (LimitType sh)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Mutable v (PrimState m) e)))) | |
type Rep (Dense v sh e) Source # | |
Defined in Data.PrimitiveArray.Dense type Rep (Dense v sh e) = D1 ('MetaData "Dense" "Data.PrimitiveArray.Dense" "PrimitiveArray-0.10.1.0-8LhqXNFuZNc70s43xh6tNJ" 'False) (C1 ('MetaCons "Dense" 'PrefixI 'True) (S1 ('MetaSel ('Just "_denseLimit") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (LimitType sh)) :*: S1 ('MetaSel ('Just "_denseV") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (v e)))) |
denseV :: forall k (v :: k -> Type) sh (e :: k) k (v :: k -> Type) (e :: k). Lens (Dense (v :: k -> Type) sh (e :: k)) (Dense (v :: k -> Type) sh (e :: k)) (v e) (v e) Source #