-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | RLP serialization as defined in Ethereum Yellow Paper -- -- RLP serialization as defined in Ethereum Yellow Paper allowing the -- encoding of arbitrary data and the later decoding of such data. -- Intended for use with Ethereum transactions or data over the network. @package RLP @version 1.0.0 -- | An implementation of the Recursive Length Prefix method as described -- in the Yellow Paper -- https://ethereum.github.io/yellowpaper/paper.pdf. -- -- To actually use this module, the type that is going to be encoded has -- to be instance of RLPSerialize defining toRLP and -- fromRLP. module Data.Serialize.RLP -- | The RLPT type represents the result of transforming the initial -- data into its byte-array representation, taking in account the -- structure of the fields. -- -- Fields that can't be directly transformed into a ByteString (such as a -- type with several fields) should generate a list with the -- representations of its fields (using the RLPL constructor). -- -- RLPT represents the T type defined in the Ethereum Yellowpaper for -- defining the RLP protocol. data RLPT RLPL :: [RLPT] -> RLPT RLPB :: ByteString -> RLPT toBigEndian :: Int -> ByteString -- | Strict version of toBigEndian toBigEndianS :: Int -> ByteString fromBigEndian :: ByteString -> Int -- | Strict version of fromBigEndian fromBigEndianS :: ByteString -> Int toByteString :: String -> ByteString -- | Strict version of toByteString toByteStringS :: String -> ByteString fromByteString :: ByteString -> String -- | Strict version of fromByteString fromByteStringS :: ByteString -> String -- | The RLPSerialize class provides functions for transforming -- values to RLPT structures. For encoding and decoding values with the -- RLP protocol, toRLP and fromRLP have to be implemented. -- -- Instances of RLPSerialize have to satisfy the following property: -- --
-- fromRLP . toRLP == id ---- -- In such case, it can be assured with the default definition that: -- --
-- rlpDecode . rlpEncode == id ---- -- RLPSerialize makes use of the Get and Put classes together with a set -- of custom serializations for encoding and decoding RLPT data. class RLPSerialize a -- | Transform a value to the RLPT structure that best fits its -- internal structure toRLP :: RLPSerialize a => a -> RLPT -- | Transform an RLPT structure back into the value it represents fromRLP :: RLPSerialize a => RLPT -> a -- | Transform a value to an RLPT structure and then encode it -- following the RLP standard. rlpEncode :: RLPSerialize a => a -> ByteString -- | Transform a ByteString to an RLPT structure following the RLP -- standard and then transform it to the original type. rlpDecode :: RLPSerialize a => ByteString -> Maybe a instance Data.Serialize.RLP.RLPSerialize Data.Serialize.RLP.Internal.RLPT instance Data.Serialize.RLP.RLPSerialize Data.ByteString.Internal.ByteString instance Data.Serialize.RLP.RLPSerialize GHC.Types.Int instance Data.Serialize.RLP.RLPSerialize a => Data.Serialize.RLP.RLPSerialize [a] instance Data.Serialize.RLP.RLPSerialize GHC.Types.Bool instance Data.Serialize.RLP.RLPSerialize GHC.Types.Char instance (Data.Serialize.RLP.RLPSerialize a, Data.Serialize.RLP.RLPSerialize b) => Data.Serialize.RLP.RLPSerialize (a, b) instance (Data.Serialize.RLP.RLPSerialize a, Data.Serialize.RLP.RLPSerialize b, Data.Serialize.RLP.RLPSerialize c) => Data.Serialize.RLP.RLPSerialize (a, b, c) instance (Data.Serialize.RLP.RLPSerialize a, Data.Serialize.RLP.RLPSerialize b, Data.Serialize.RLP.RLPSerialize c, Data.Serialize.RLP.RLPSerialize d) => Data.Serialize.RLP.RLPSerialize (a, b, c, d) instance (Data.Serialize.RLP.RLPSerialize a, Data.Serialize.RLP.RLPSerialize b, Data.Serialize.RLP.RLPSerialize c, Data.Serialize.RLP.RLPSerialize d, Data.Serialize.RLP.RLPSerialize e) => Data.Serialize.RLP.RLPSerialize (a, b, c, d, e) instance (Data.Serialize.RLP.RLPSerialize a, Data.Serialize.RLP.RLPSerialize b, Data.Serialize.RLP.RLPSerialize c, Data.Serialize.RLP.RLPSerialize d, Data.Serialize.RLP.RLPSerialize e, Data.Serialize.RLP.RLPSerialize f) => Data.Serialize.RLP.RLPSerialize (a, b, c, d, e, f) instance Data.Serialize.RLP.RLPSerialize a => Data.Serialize.RLP.RLPSerialize (GHC.Maybe.Maybe a)