Safe Haskell | None |
---|---|
Language | Haskell2010 |
- newtype MRec s f us = MRec# (MVector s Any)
- new# :: forall f xs m. (KnownNat (Length xs), PrimMonad m) => m (MRec (PrimState m) f xs)
- rmap :: forall g m f xs. PrimMonad m => (forall x. f x -> g x) -> MRec (PrimState m) f xs -> m (MRec (PrimState m) g xs)
- crmap :: forall c g m f xs. (AllF c f xs, PrimMonad m) => (forall x. c (f x) => f x -> g x) -> MRec (PrimState m) f xs -> m (MRec (PrimState m) g xs)
- toMVector :: forall r m f xs. PrimMonad m => (forall x. f x -> r) -> MRec (PrimState m) f xs -> m (MVector (PrimState m) r)
- ctoMVector :: forall c r m f xs. (AllF c f xs, PrimMonad m) => (forall x. c (f x) => f x -> r) -> MRec (PrimState m) f xs -> m (MVector (PrimState m) r)
- modify :: forall n xs fx f m. (fx ~ f (xs !! n), PrimMonad m, KnownNat n) => (fx -> fx) -> MRec (PrimState m) f xs -> m ()
- setAt :: forall n x xs f m. (PrimMonad m, KnownNat n) => f x -> MRec (PrimState m) f xs -> m (MRec (PrimState m) f (SetAt n xs x))
Documentation
A mutable heterogeneous record represented by an untyped mutable vector
new# :: forall f xs m. (KnownNat (Length xs), PrimMonad m) => m (MRec (PrimState m) f xs) Source #
Create a mutable record of the given shape. The memory is not initialized
rmap :: forall g m f xs. PrimMonad m => (forall x. f x -> g x) -> MRec (PrimState m) f xs -> m (MRec (PrimState m) g xs) Source #
Modify a mutable record in place by mapping a natural tranformation. O(n)
crmap :: forall c g m f xs. (AllF c f xs, PrimMonad m) => (forall x. c (f x) => f x -> g x) -> MRec (PrimState m) f xs -> m (MRec (PrimState m) g xs) Source #
Modify a mutable record in place by mapping a natural tranformation that can make use of the provided constraint. Ex: `crmap @Show (K . show) :: (MRec s f xs) -> ST s (MRec s (K String) xs)` O(n)
toMVector :: forall r m f xs. PrimMonad m => (forall x. f x -> r) -> MRec (PrimState m) f xs -> m (MVector (PrimState m) r) Source #
Convert a mutable record to a mutable vector by mapping to a homogeneous type O(n)
ctoMVector :: forall c r m f xs. (AllF c f xs, PrimMonad m) => (forall x. c (f x) => f x -> r) -> MRec (PrimState m) f xs -> m (MVector (PrimState m) r) Source #
Convert a mutable record to a mutable vector by mapping to a homogeneous type, making use of provided constraint O(n)