bytezap-1.0.0: Bytestring builder with zero intermediate allocation
Safe HaskellSafe-Inferred
LanguageGHC2021

Bytezap.Poke

Synopsis

Documentation

type Poke# s = Addr# -> Int# -> State# s -> (# State# s, Int# #) Source #

newtype Poke s Source #

Poke newtype wrapper.

Constructors

Poke 

Fields

Instances

Instances details
Monoid (Poke s) Source # 
Instance details

Defined in Bytezap.Poke

Methods

mempty :: Poke s #

mappend :: Poke s -> Poke s -> Poke s #

mconcat :: [Poke s] -> Poke s #

Semigroup (Poke s) Source #

Sequence two Pokes left-to-right.

Instance details

Defined in Bytezap.Poke

Methods

(<>) :: Poke s -> Poke s -> Poke s #

sconcat :: NonEmpty (Poke s) -> Poke s #

stimes :: Integral b => b -> Poke s -> Poke s #

unsafeRunPokeBS :: Int -> Poke RealWorld -> ByteString Source #

Execute a Poke at a fresh ByteString of the given length.

unsafeRunPokeBSUptoN :: Int -> Poke RealWorld -> ByteString Source #

Execute a Poke at a fresh ByteString of the given maximum length. Does not reallocate if final size is less than estimated.

prim :: forall a s. Prim' a => a -> Poke s Source #

Poke a type via its Prim' instance.

replicateByte :: Int -> Word8 -> Poke RealWorld Source #

essentially memset