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

Ptr.Parse

Synopsis

Documentation

newtype Parse output Source #

Constructors

Parse (Int -> Ptr Word8 -> forall result. (Int -> IO result) -> (Text -> IO result) -> (output -> Int -> Ptr Word8 -> IO result) -> IO result) 

Instances

Instances details
Monad Parse Source # 
Instance details

Defined in Ptr.Parse

Methods

(>>=) :: Parse a -> (a -> Parse b) -> Parse b

(>>) :: Parse a -> Parse b -> Parse b

return :: a -> Parse a

Functor Parse Source # 
Instance details

Defined in Ptr.Parse

Methods

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

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

Applicative Parse Source # 
Instance details

Defined in Ptr.Parse

Methods

pure :: a -> Parse a

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

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

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

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

Alternative Parse Source # 
Instance details

Defined in Ptr.Parse

Methods

empty :: Parse a

(<|>) :: Parse a -> Parse a -> Parse a

some :: Parse a -> Parse [a]

many :: Parse a -> Parse [a]

MonadPlus Parse Source # 
Instance details

Defined in Ptr.Parse

Methods

mzero :: Parse a

mplus :: Parse a -> Parse a -> Parse a

MonadIO Parse Source # 
Instance details

Defined in Ptr.Parse

Methods

liftIO :: IO a -> Parse a

fail :: Text -> Parse output Source #

io :: Int -> (Ptr Word8 -> IO output) -> Parse output Source #

mapInIO :: (output -> IO newOutput) -> Parse output -> Parse newOutput Source #

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

limiting :: Int -> Parse output -> Parse output Source #

peekRemainders :: Parse ByteString Source #

Decode the remaining bytes, whithout moving the parser's cursor. Useful for debugging.

word8 :: Parse Word8 Source #

bytes :: Int -> Parse ByteString Source #

allBytes :: Parse ByteString Source #

bytesWhile :: (Word8 -> Bool) -> Parse ByteString Source #

skipWhile :: (Word8 -> Bool) -> Parse () Source #

foldWhile :: (Word8 -> Bool) -> (state -> Word8 -> state) -> state -> Parse state Source #

unsignedASCIIIntegral :: Integral a => Parse a Source #

Unsigned integral number encoded in ASCII.