@@ -1,27 +0,0 @@
1−-- |
2−-- Module : Streamly.Internal.Serialize
3−-- Copyright : (c) 2022 Composewell Technologies
4−-- License : BSD-3-Clause
5−-- Maintainer : streamly@composewell.com
6−-- Stability : pre-release
7−-- Portability : GHC
8−--
9−-- Convert Haskell data types to byte streams and vice-versa.
10−
11−module Streamly.Internal.Serialize
12− ( ToBytes (..)
13− , FromBytes (..)
14− )
15−where
16−
17−import Data.Word (Word8)
18−import Streamly.Internal.Data.Stream (Stream)
19−import Streamly.Internal.Data.Parser (Parser)
20−
21−class ToBytes a where
22− -- | Convert a Haskell type to a byte stream.
23− toBytes :: a -> Stream m Word8
24−
25−class FromBytes a where
26− -- | Decode a byte stream to a Haskell type.
27− fromBytes :: Parser Word8 m a