primal-memory-0.3.0.0: Unified interface for memory managemenet.
Copyright(c) Alexey Kuleshevich 2020
LicenseBSD3
MaintainerAlexey Kuleshevich <alexey@kuleshevi.ch>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Data.Prim.Memory.Text

Description

 
Synopsis

Documentation

data Text #

A space efficient, packed, unboxed Unicode text type.

Constructors

Text !Array !Int !Int 

Instances

Instances details
MemRead Text Source # 
Instance details

Defined in Data.Prim.Memory.Internal

Methods

isSameMem :: Text -> Text -> Bool

byteCountMem :: Text -> Count Word8 Source #

indexOffMem :: Prim e => Text -> Off e -> e Source #

indexByteOffMem :: Prim e => Text -> Off Word8 -> e Source #

copyByteOffToMBytesMem :: forall s m e (p :: Pinned). (MonadPrim s m, Prim e) => Text -> Off Word8 -> MBytes p s -> Off Word8 -> Count e -> m () Source #

copyByteOffToPtrMem :: (MonadPrim s m, Prim e) => Text -> Off Word8 -> Ptr e -> Off Word8 -> Count e -> m () Source #

compareByteOffToPtrMem :: (MonadPrim s m, Prim e) => Text -> Off Word8 -> Ptr e -> Off Word8 -> Count e -> m Ordering Source #

compareByteOffToBytesMem :: forall e (p :: Pinned). Prim e => Text -> Off Word8 -> Bytes p -> Off Word8 -> Count e -> Ordering Source #

compareByteOffMem :: (MemRead mr', Prim e) => mr' -> Off Word8 -> Text -> Off Word8 -> Count e -> Ordering Source #

data MText s Source #

Mutable version of a Text

Constructors

MText !(MArray s) !Int !Int 

data Array #

Immutable array type.

The Array constructor is exposed since text-1.1.1.3

Constructors

Array 

Fields

Instances

Instances details
MemRead Array Source # 
Instance details

Defined in Data.Prim.Memory.Internal

Methods

isSameMem :: Array -> Array -> Bool

byteCountMem :: Array -> Count Word8 Source #

indexOffMem :: Prim e => Array -> Off e -> e Source #

indexByteOffMem :: Prim e => Array -> Off Word8 -> e Source #

copyByteOffToMBytesMem :: forall s m e (p :: Pinned). (MonadPrim s m, Prim e) => Array -> Off Word8 -> MBytes p s -> Off Word8 -> Count e -> m () Source #

copyByteOffToPtrMem :: (MonadPrim s m, Prim e) => Array -> Off Word8 -> Ptr e -> Off Word8 -> Count e -> m () Source #

compareByteOffToPtrMem :: (MonadPrim s m, Prim e) => Array -> Off Word8 -> Ptr e -> Off Word8 -> Count e -> m Ordering Source #

compareByteOffToBytesMem :: forall e (p :: Pinned). Prim e => Array -> Off Word8 -> Bytes p -> Off Word8 -> Count e -> Ordering Source #

compareByteOffMem :: (MemRead mr', Prim e) => mr' -> Off Word8 -> Array -> Off Word8 -> Count e -> Ordering Source #

data MArray s #

Mutable array type, for use in the ST monad.

The MArray constructor is exposed since text-1.1.1.3

Constructors

MArray 

Fields

Instances

Instances details
MemAlloc MArray Source # 
Instance details

Defined in Data.Prim.Memory.Internal

Associated Types

type FrozenMem MArray = (fm :: Type) Source #

MemWrite MArray Source # 
Instance details

Defined in Data.Prim.Memory.Internal

Methods

isSameMutMem :: MArray s -> MArray s -> Bool

readOffMutMem :: (MonadPrim s m, Prim e) => MArray s -> Off e -> m e Source #

readByteOffMutMem :: (MonadPrim s m, Prim e) => MArray s -> Off Word8 -> m e Source #

writeOffMutMem :: (MonadPrim s m, Prim e) => MArray s -> Off e -> e -> m () Source #

writeByteOffMutMem :: (MonadPrim s m, Prim e) => MArray s -> Off Word8 -> e -> m () Source #

moveByteOffToMBytesMutMem :: forall s m e (p :: Pinned). (MonadPrim s m, Prim e) => MArray s -> Off Word8 -> MBytes p s -> Off Word8 -> Count e -> m () Source #

moveByteOffToPtrMutMem :: (MonadPrim s m, Prim e) => MArray s -> Off Word8 -> Ptr e -> Off Word8 -> Count e -> m () Source #

copyByteOffMem :: (MonadPrim s m, MemRead mr, Prim e) => mr -> Off Word8 -> MArray s -> Off Word8 -> Count e -> m () Source #

moveByteOffMutMem :: (MonadPrim s m, MemWrite mw', Prim e) => mw' s -> Off Word8 -> MArray s -> Off Word8 -> Count e -> m () Source #

setMutMem :: (MonadPrim s m, Prim e) => MArray s -> Off e -> Count e -> e -> m () Source #

type FrozenMem MArray Source # 
Instance details

Defined in Data.Prim.Memory.Internal

fromArrayBytes :: Array -> Bytes 'Inc Source #

O(1) - Cast an immutable Array from text package to immutable Bytes

Since: 0.3.0

toArrayBytes :: Bytes p -> Array Source #

O(1) - Cast immutable Bytes to an immutable Array from text package

Since: 0.3.0

fromMArrayMBytes :: MArray s -> MBytes 'Inc s Source #

O(1) - Cast a mutable MArray from text package to mutable MBytes

Since: 0.3.0

toMArrayMBytes :: MBytes p s -> MArray s Source #

O(1) - Cast mutable MBytes to a mutable MArray from text package

Since: 0.3.0