encoding
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Encoding.ByteSource

Documentation

class (Monad m, Throws DecodingException m) => ByteSource (m :: Type -> Type) where #

Minimal complete definition

sourceEmpty, fetchWord8, fetchAhead

Methods

sourceEmpty :: m Bool #

fetchWord8 :: m Word8 #

fetchAhead :: m (Maybe a) -> m (Maybe a) #

fetchWord16be :: m Word16 #

fetchWord16le :: m Word16 #

fetchWord32be :: m Word32 #

fetchWord32le :: m Word32 #

fetchWord64be :: m Word64 #

fetchWord64le :: m Word64 #

Instances

Instances details
ByteSource Get # 
Instance details

Defined in Data.Encoding.ByteSource

Methods

sourceEmpty :: Get Bool #

fetchWord8 :: Get Word8 #

fetchAhead :: Get (Maybe a) -> Get (Maybe a) #

fetchWord16be :: Get Word16 #

fetchWord16le :: Get Word16 #

fetchWord32be :: Get Word32 #

fetchWord32le :: Get Word32 #

fetchWord64be :: Get Word64 #

fetchWord64le :: Get Word64 #

ByteSource (ReaderT Handle IO) # 
Instance details

Defined in Data.Encoding.ByteSource

Methods

sourceEmpty :: ReaderT Handle IO Bool #

fetchWord8 :: ReaderT Handle IO Word8 #

fetchAhead :: ReaderT Handle IO (Maybe a) -> ReaderT Handle IO (Maybe a) #

fetchWord16be :: ReaderT Handle IO Word16 #

fetchWord16le :: ReaderT Handle IO Word16 #

fetchWord32be :: ReaderT Handle IO Word32 #

fetchWord32le :: ReaderT Handle IO Word32 #

fetchWord64be :: ReaderT Handle IO Word64 #

fetchWord64le :: ReaderT Handle IO Word64 #

(Monad m, Throws DecodingException m) => ByteSource (StateT ByteString m) # 
Instance details

Defined in Data.Encoding.ByteSource

Methods

sourceEmpty :: StateT ByteString m Bool #

fetchWord8 :: StateT ByteString m Word8 #

fetchAhead :: StateT ByteString m (Maybe a) -> StateT ByteString m (Maybe a) #

fetchWord16be :: StateT ByteString m Word16 #

fetchWord16le :: StateT ByteString m Word16 #

fetchWord32be :: StateT ByteString m Word32 #

fetchWord32le :: StateT ByteString m Word32 #

fetchWord64be :: StateT ByteString m Word64 #

fetchWord64le :: StateT ByteString m Word64 #

ByteSource (StateT ByteString (Either DecodingException)) # 
Instance details

Defined in Data.Encoding.ByteSource

Methods

sourceEmpty :: StateT ByteString (Either DecodingException) Bool #

fetchWord8 :: StateT ByteString (Either DecodingException) Word8 #

fetchAhead :: StateT ByteString (Either DecodingException) (Maybe a) -> StateT ByteString (Either DecodingException) (Maybe a) #

fetchWord16be :: StateT ByteString (Either DecodingException) Word16 #

fetchWord16le :: StateT ByteString (Either DecodingException) Word16 #

fetchWord32be :: StateT ByteString (Either DecodingException) Word32 #

fetchWord32le :: StateT ByteString (Either DecodingException) Word32 #

fetchWord64be :: StateT ByteString (Either DecodingException) Word64 #

fetchWord64le :: StateT ByteString (Either DecodingException) Word64 #

ByteSource (StateT [Char] (Either DecodingException)) # 
Instance details

Defined in Data.Encoding.ByteSource

Methods

sourceEmpty :: StateT [Char] (Either DecodingException) Bool #

fetchWord8 :: StateT [Char] (Either DecodingException) Word8 #

fetchAhead :: StateT [Char] (Either DecodingException) (Maybe a) -> StateT [Char] (Either DecodingException) (Maybe a) #

fetchWord16be :: StateT [Char] (Either DecodingException) Word16 #

fetchWord16le :: StateT [Char] (Either DecodingException) Word16 #

fetchWord32be :: StateT [Char] (Either DecodingException) Word32 #

fetchWord32le :: StateT [Char] (Either DecodingException) Word32 #

fetchWord64be :: StateT [Char] (Either DecodingException) Word64 #

fetchWord64le :: StateT [Char] (Either DecodingException) Word64 #

ByteSource (StateT [Char] Identity) # 
Instance details

Defined in Data.Encoding.ByteSource

Methods

sourceEmpty :: StateT [Char] Identity Bool #

fetchWord8 :: StateT [Char] Identity Word8 #

fetchAhead :: StateT [Char] Identity (Maybe a) -> StateT [Char] Identity (Maybe a) #

fetchWord16be :: StateT [Char] Identity Word16 #

fetchWord16le :: StateT [Char] Identity Word16 #

fetchWord32be :: StateT [Char] Identity Word32 #

fetchWord32le :: StateT [Char] Identity Word32 #

fetchWord64be :: StateT [Char] Identity Word64 #

fetchWord64le :: StateT [Char] Identity Word64 #

fetchAheadState :: forall {m} {s} {a}. MonadState s m => m (Maybe a) -> m (Maybe a) #

Orphan instances

Throws DecodingException Get # 
Instance details