-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Type class for sequence of bytes -- -- Abstract class to manipulate sequence of bytes -- -- The use case of this class is abstracting manipulation of types that -- are just wrapping a bytestring with stronger and more meaniful name. -- -- Usual definition is of the form: newtype MyType = MyType ByteString @package byteable @version 0.1.0 module Data.Byteable -- | Class of things that can generate sequence of bytes class Byteable a toBytes :: Byteable a => a -> ByteString -- | A constant time equality test for 2 byteable objects. -- -- If objects are of 2 different sizes, the function will abort early -- without comparing any bytes. -- -- compared to == , this function will go over all the bytes present -- before yielding a result even when knowing the overall result early in -- the processing. constEqBytes :: Byteable a => a -> a -> Bool instance Byteable ByteString