ptr-0.16.8.5: Experimental abstractions for operations on pointers
Safe HaskellNone
LanguageHaskell2010

Ptr.Receive

Synopsis

Documentation

data Receive Source #

A wrapper of a receiving action, which extends it with bufferization.

create :: (Ptr Word8 -> Int -> IO (Either Text Int)) -> Int -> IO Receive Source #

peek :: Receive -> Peek peekd -> IO (Either Text peekd) Source #

Receive as many bytes as is required by the provided decoder and decode immediately.

If all you need is just to get a ByteString chunk then use the bytes decoder.