-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Fast and safe representation of a hex string
--   
--   Provides an interface for converting any object that has a
--   <a>Binary</a> instance to and from a hexadecimal Text representation.
@package hexstring
@version 0.11.1

module Data.HexString

-- | Represents a Hex string. Guarantees that all characters it contains
--   are valid hex characters.
data HexString

-- | Smart constructor which validates that all the text are actually
--   hexadecimal characters.
hexString :: ByteString -> HexString

-- | Converts a <a>Binary</a> to a <a>HexString</a> value
fromBinary :: Binary a => a -> HexString

-- | Converts a <a>HexString</a> to a <a>Binary</a> value
toBinary :: Binary a => HexString -> a

-- | Reads a <a>ByteString</a> as raw bytes and converts to hex
--   representation. We cannot use the instance Binary of <a>ByteString</a>
--   because it provides a leading length, which is not what we want when
--   dealing with raw bytes.
fromBytes :: ByteString -> HexString

-- | Access to the raw bytes in a <a>ByteString</a> format.
toBytes :: HexString -> ByteString

-- | Access to a <a>Text</a> representation of the <a>HexString</a>
toText :: HexString -> Text
instance GHC.Classes.Ord Data.HexString.HexString
instance GHC.Classes.Eq Data.HexString.HexString
instance GHC.Show.Show Data.HexString.HexString
instance Data.Aeson.Types.FromJSON.FromJSON Data.HexString.HexString
instance Data.Aeson.Types.ToJSON.ToJSON Data.HexString.HexString
