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

Ptr.Peek

Synopsis

Documentation

data Peek output Source #

Constructors

Peek !Int !(Ptr Word8 -> IO output) 

Instances

Instances details
Functor Peek Source # 
Instance details

Defined in Ptr.Peek

Methods

fmap :: (a -> b) -> Peek a -> Peek b

(<$) :: a -> Peek b -> Peek a

Applicative Peek Source # 
Instance details

Defined in Ptr.Peek

Methods

pure :: a -> Peek a

(<*>) :: Peek (a -> b) -> Peek a -> Peek b

liftA2 :: (a -> b -> c) -> Peek a -> Peek b -> Peek c

(*>) :: Peek a -> Peek b -> Peek b

(<*) :: Peek a -> Peek b -> Peek a

int8 :: Peek Int8 Source #

beInt16 :: Peek Int16 Source #

beInt32 :: Peek Int32 Source #

beInt64 :: Peek Int64 Source #

leInt16 :: Peek Int16 Source #

leInt32 :: Peek Int32 Source #

leInt64 :: Peek Int64 Source #

word8 :: Peek Word8 Source #

beWord16 :: Peek Word16 Source #

beWord32 :: Peek Word32 Source #

beWord64 :: Peek Word64 Source #

leWord16 :: Peek Word16 Source #

leWord32 :: Peek Word32 Source #

leWord64 :: Peek Word64 Source #

bytes :: Int -> Peek ByteString Source #

shortByteString :: Int -> Peek ShortByteString Source #

pokeAndPeek :: PokeAndPeek input output -> Peek output Source #

parse :: Int -> Parse a -> (Int -> a) -> (Text -> a) -> Peek a Source #

Given the length of the data and a specification of its sequential consumption, produces Peek, which results in Just the successfully taken value, or Nothing, if the specified length of data wasn't enough.

parseUnbound :: Int -> ParseUnbound a -> (Int -> a) -> (Text -> a) -> Peek a Source #

Given the length of the data and a specification of its sequential consumption, produces Peek, which results in Just the successfully taken value, or Nothing, if the specified length of data wasn't enough.

peekAmountAndParse :: Peek Int -> Parse a -> (Int -> a) -> (Text -> a) -> Peek (Peek a) Source #

A standard idiom, where a header specifies the length of the body.

Produces Peek, which itself produces another Peek, which is the same as the result of the parse function.