-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Self-delimiting numeric values encoding library
--
-- Self-delimiting numeric values decoding/encoding implementation
-- conformant with RFC6256.
@package sdnv
@version 0.1.1
module Numeric.SDNV
data SDNV a
-- | Encode a value into SDNV. Please note that encoding of variable length
-- negative values such as of type Integer results in sign lost.
encodeSDNV :: (Bits a, Integral a) => a -> SDNV a
-- | Decode SDNV into an integral value. This function doesn't check SDNV
-- integrity and size, and in certain cases may produce incorrect
-- results. See safeDecodeSDNV.
decodeSDNV :: (Bits a, Integral a) => SDNV a -> a
-- | Decode SDNV into an intergral value. This function uses
-- isValidSDNV to detect incorrectly encoded SDNV, and to check
-- for overflow in case of finite size types.
safeDecodeSDNV :: (Bits a, Integral a) => SDNV a -> Maybe a
-- | Check SDNV correctness. Returns True if SDNV is correctly encoded and
-- decoding will not result in an overflow for finite datatypes.
isValidSDNV :: forall a. (Bits a, Integral a) => SDNV a -> Bool
instance GHC.Classes.Eq (Numeric.SDNV.SDNV a)
instance Data.Binary.Class.Binary (Numeric.SDNV.SDNV a)