on master help sign in
Make some doc updates to Serialize modules
a7512bcHarendra Kumar
core/src/Streamly/Internal/Serialize/FromBytes.hs+11−2
@@ -6,10 +6,14 @@
6-- Stability : pre-release
6-- Stability : pre-release
7-- Portability : GHC
7-- Portability : GHC
8--
8--
9−-- Parsers for binary encoded basic Haskell data types.
9+-- Decode Haskell data types from byte streams.
10
10
11module Streamly.Internal.Serialize.FromBytes
11module Streamly.Internal.Serialize.FromBytes
12+ (
13+ -- * Type class
12− ( FromBytes (..)
14+ FromBytes (..)
15+
16+ -- * Decoders
13 , unit
17 , unit
14 , bool
18 , bool
15 , ordering
19 , ordering
@@ -40,6 +44,11 @@ import qualified Streamly.Internal.Data.Parser as PR
40import qualified Streamly.Internal.Data.Parser.ParserD as PRD
44import qualified Streamly.Internal.Data.Parser.ParserD as PRD
41 (Parser(..), Initial(..), Step(..), toParserK)
45 (Parser(..), Initial(..), Step(..), toParserK)
42
46
47+-- Note: The () type does not need to have an on-disk representation in theory.
48+-- But we use a concrete representation for it so that we count how many ()
49+-- types we have. Or when we have an array of units the array a concrete
50+-- length.
51+
43-- | A value of type '()' is encoded as @0@ in binary encoding.
52-- | A value of type '()' is encoded as @0@ in binary encoding.
44--
53--
45-- @
54-- @
core/src/Streamly/Internal/Serialize/ToBytes.hs+6−2
@@ -6,10 +6,14 @@
6-- Stability : pre-release
6-- Stability : pre-release
7-- Portability : GHC
7-- Portability : GHC
8--
8--
9−-- Converting Haskell data types to byte streams.
9+-- Encode Haskell data types to byte streams.
10
10
11module Streamly.Internal.Serialize.ToBytes
11module Streamly.Internal.Serialize.ToBytes
12+ (
13+ -- * Type class
12− ( ToBytes (..)
14+ ToBytes (..)
15+
16+ -- * Encoders
13 , unit
17 , unit
14 , bool
18 , bool
15 , ordering
19 , ordering