-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Send and receive binary data. -- -- Simple datatype that makes easier to send and receive serializable -- values in any MonadIO. Inspired by Gregory Crosswhite's -- 'binary-protocol' package. @package binary-communicator @version 1.0 module Data.BinaryCom -- | BinaryCom type data BinaryCom -- | Creates a BinaryCom from a Handle opened for both -- reading and writing. Be careful not to use the handle afterwards binaryCom :: (MonadIO m) => Handle -> m BinaryCom -- | Creates a BinaryCom from two Handles: one for -- reading, one for writing binaryCom' :: (MonadIO m) => Handle -> Handle -> m BinaryCom -- | Creates a BinaryCom from a lazy ByteString (for -- reading) and a Handle (for writing) binaryCom'' :: (MonadIO m) => ByteString -> Handle -> m BinaryCom -- | Sends a serializable value through a BinaryCom send :: (Binary a, MonadIO m) => BinaryCom -> a -> m () -- | Flushes a BinaryCom. Do not forget to do this after sending! flush :: (MonadIO m) => BinaryCom -> m () -- | Shortcut for sending a value and flushing the BinaryCom sendFlush :: (Binary a, MonadIO m) => BinaryCom -> a -> m () -- | Receives a serializable value through a BinaryCom receive :: (Binary a, MonadIO m) => BinaryCom -> m a