class (forall a b. Coercible a b => Coercible (m a) (m b), Integral (Remaining m), MonadFail m, Applicative m) => MonadGet (m :: Type -> Type) whereAssociated types
Methods
skip :: Int -> m ()Skip ahead
nbytes. Fails if fewer thannbytes are available.ensure :: Int -> m ByteStringIf at least
nbytes are available return at least that much of the current input. Otherwise fail.lookAhead :: m a -> m aRun
ga, but return without consuming its input. Fails ifgafails.lookAheadM :: m (Maybe a) -> m (Maybe a)Like lookAhead, but consume the input if
gmareturns 'Just _'. Fails ifgmafails.lookAheadE :: m (Either a b) -> m (Either a b)Like lookAhead, but consume the input if
geareturns 'Right _'. Fails ifgeafails.getBytes :: Int -> m ByteStringPull
nbytes from the input, as a strict ByteString.remaining :: m (Remaining m)Get the number of remaining unparsed bytes. Useful for checking whether all input has been consumed. Note that this forces the rest of the input.
isEmpty :: m BoolTest whether all input has been consumed, i.e. there are no remaining unparsed bytes.
getWord8 :: m Word8Read a Word8 from the monad state
getByteString :: Int -> m ByteStringAn efficient get method for strict ByteStrings. Fails if fewer than
nbytes are left in the input.getLazyByteString :: Int64 -> m ByteStringAn efficient get method for lazy ByteStrings. Does not fail if fewer than
nbytes are left in the input.getWord16be :: m Word16Read a Word16 in big endian format
getWord16le :: m Word16Read a Word16 in little endian format
getWord16host :: m Word16O(1). Read a 2 byte Word16 in native host order and host endianness.
getWord32be :: m Word32Read a Word32 in big endian format
getWord32le :: m Word32Read a Word32 in little endian format
getWord32host :: m Word32O(1). Read a Word32 in native host order and host endianness.
getWord64be :: m Word64Read a Word64 in big endian format
getWord64le :: m Word64Read a Word64 in little endian format
getWord64host :: m Word64O(1). Read a Word64 in native host order and host endianness.
getWordhost :: m WordO(1). Read a single native machine word. The word is read in host order, host endian form, for the machine you're on. On a 64 bit machine the Word is an 8 byte value, on a 32 bit machine, 4 bytes.
Instances10MonadGet, …
MonadGet GetDefined in bytes-0.17.4 · Data.Bytes.GetMonadGet GetDefined in bytes-0.17.4 · Data.Bytes.GetMonadGet m => MonadGet (ExceptT e m)Defined in bytes-0.17.4 · Data.Bytes.GetMonadGet m => MonadGet (ReaderT e m)Defined in bytes-0.17.4 · Data.Bytes.GetMonadGet m => MonadGet (StateT s m)Defined in bytes-0.17.4 · Data.Bytes.GetMonadGet m => MonadGet (StateT s m)Defined in bytes-0.17.4 · Data.Bytes.Get(MonadGet m, Monoid w) => MonadGet (WriterT w m)Defined in bytes-0.17.4 · Data.Bytes.Get(MonadGet m, Monoid w) => MonadGet (WriterT w m)Defined in bytes-0.17.4 · Data.Bytes.Get(MonadGet m, Monoid w) => MonadGet (RWST r w s m)Defined in bytes-0.17.4 · Data.Bytes.Get(MonadGet m, Monoid w) => MonadGet (RWST r w s m)Defined in bytes-0.17.4 · Data.Bytes.Get