mempack-0.1.1.0: Short description
Copyright(c) Alexey Kuleshevich 2024
LicenseBSD3
MaintainerAlexey Kuleshevich <alexey@kuleshevi.ch>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.MemPack.Buffer

Description

 
Synopsis

Documentation

class Buffer b where Source #

Immutable memory buffer

Methods

bufferByteCount :: b -> Int Source #

buffer :: b -> (ByteArray# -> a) -> (Addr# -> a) -> a Source #

Instances

Instances details
Buffer ByteArray Source # 
Instance details

Defined in Data.MemPack.Buffer

Methods

bufferByteCount :: ByteArray -> Int Source #

buffer :: ByteArray -> (ByteArray# -> a) -> (Addr# -> a) -> a Source #

Buffer ByteString Source # 
Instance details

Defined in Data.MemPack.Buffer

Methods

bufferByteCount :: ByteString -> Int Source #

buffer :: ByteString -> (ByteArray# -> a) -> (Addr# -> a) -> a Source #

Buffer ShortByteString Source # 
Instance details

Defined in Data.MemPack.Buffer

withPtrByteStringST :: ByteString -> (Ptr a -> ST s b) -> ST s b Source #

It is ok to use ByteString withing ST, as long as underlying pointer is never mutated or returned from the supplied action.