{-# LANGUAGE KindSignatures      #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StrictData          #-}
module Network.Tox.Binary
  ( encode
  , decode
  ) where

import           Data.Binary          (Binary)
import           Data.ByteString      (ByteString)

import qualified Network.Tox.Encoding as Encoding


--------------------------------------------------------------------------------
--
-- :: decode
--
--------------------------------------------------------------------------------


decode :: Binary a => ByteString -> Maybe a
decode :: ByteString -> Maybe a
decode = ByteString -> Maybe a
forall (m :: * -> *) a.
(MonadFail m, Binary a) =>
ByteString -> m a
Encoding.decode


--------------------------------------------------------------------------------
--
-- :: encode
--
--------------------------------------------------------------------------------


encode :: Binary a => a -> ByteString
encode :: a -> ByteString
encode = a -> ByteString
forall a. Binary a => a -> ByteString
Encoding.encode