streamly-binary-1.0.0.1: Integration of streamly and binary

Copyright© 2020 G. Eyaeb
LicenseBSD-3-Clause
Maintainergeyaeb@protonmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Streamly.Binary

Description

This module contains functions for decoding stream of bytestrings (coming, for example, from TCP connection) to your data type using binary and vice versa.

Synopsis

Documentation

decodeStream :: (Binary a, MonadFail m) => SerialT m ByteString -> SerialT m a Source #

Decode stream of bytestrings given that there exists instance of Binary for target type. Bytestrings do not have to be aligned in any way.

decodeStreamGet :: MonadFail m => Get a -> SerialT m ByteString -> SerialT m a Source #

Decode stream of bytestrings using Get from Binary. Bytestrings do not have to be aligned in any way.

encodeStream :: (Binary a, MonadFail m) => SerialT m a -> SerialT m ByteString Source #

Encode stream of elements to bytestrings given that there exists instance of Binary for source type. Resulting bytestrings are not guaranteed to be aligned in any way.

encodeStreamPut :: MonadFail m => (a -> Put) -> SerialT m a -> SerialT m ByteString Source #

Encode stream of elements using Put from Binary. Resulting bytestrings are not guaranteed to be aligned in any way.