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

-- | Type definitions for Universally Unique Identifiers
--   
--   This library contains type definitions for Universally Unique
--   Identifiers (UUID) (as specified in RFC 4122) and basic
--   conversion functions.
--   
--   See also the 'uuid' package providing a high-level API for
--   managing the different UUID versions.
@package uuid-types
@version 1.0.6

-- | This library is useful for comparing, parsing and printing
--   Universally Unique Identifiers (UUID). See RFC 4122 for
--   the specification.
module Data.UUID.Types

-- | Type representing Universally Unique Identifiers (UUID) as
--   specified in RFC 4122.
data UUID

-- | The nil UUID, as defined in RFC 4122. It is a UUID of
--   all zeros. null u iff u ==
--   nil.
nil :: UUID

-- | Returns true if the passed-in UUID is the nil UUID.
null :: UUID -> Bool

-- | Convert a UUID into a hypenated string using lower-case letters.
--   Example:
--   
--   
--   >>> toString <$> fromString "550e8400-e29b-41d4-a716-446655440000"
--   Just "550e8400-e29b-41d4-a716-446655440000"
--   
toString :: UUID -> String

-- | If the passed in String can be parsed as a UUID, it will
--   be. The hyphens may not be omitted. Example:
--   
--   
--   >>> fromString "c2cc10e1-57d6-4b6f-9899-38d972112d8c"
--   Just c2cc10e1-57d6-4b6f-9899-38d972112d8c
--   
--   
--   Hex digits may be upper or lower-case.
fromString :: String -> Maybe UUID

-- | Convert a UUID into a hyphentated string using lower-case letters.
toText :: UUID -> Text

-- | If the passed in Text can be parsed as an ASCII representation
--   of a UUID, it will be. The hyphens may not be omitted.
fromText :: Text -> Maybe UUID

-- | Convert a UUID into a hyphentated string using lower-case letters,
--   packed as ASCII bytes into ByteString.
--   
--   This should be equivalent to toString with pack.
toASCIIBytes :: UUID -> ByteString

-- | If the passed in ByteString can be parsed as an ASCII
--   representation of a UUID, it will be. The hyphens may not be
--   omitted.
--   
--   This should be equivalent to fromString with unpack.
fromASCIIBytes :: ByteString -> Maybe UUID

-- | Similar to toASCIIBytes except we produce a lazy
--   ByteString.
toLazyASCIIBytes :: UUID -> ByteString

-- | Similar to fromASCIIBytes except parses from a lazy
--   ByteString.
fromLazyASCIIBytes :: ByteString -> Maybe UUID

-- | Encode a UUID into a ByteString in network order.
--   
--   This uses the same encoding as the Binary instance.
toByteString :: UUID -> ByteString

-- | Extract a UUID from a ByteString in network byte order. The
--   argument must be 16 bytes long, otherwise Nothing is returned.
fromByteString :: ByteString -> Maybe UUID

-- | Convert a UUID into a sequence of Word32 values. Useful
--   for when you need to serialize a UUID and neither Storable nor
--   Binary are appropriate.
--   
--   
--   >>> toWords <$> fromString "550e8400-e29b-41d4-a716-446655440000"
--   Just (1427014656,3801825748,2803254374,1430519808)
--   
--   
--   See also toWords64.
--   
--   Since: uuid-1.2.2
toWords :: UUID -> (Word32, Word32, Word32, Word32)

-- | Create a UUID from a sequence of Word32. The inverse of
--   toWords. Useful when you need a total function for constructing
--   UUID values.
--   
--   See also fromWords64.
--   
--   Since: uuid-1.2.2
fromWords :: Word32 -> Word32 -> Word32 -> Word32 -> UUID

-- | Convert a UUID into a pair of Word64s.
--   
--   
--   >>> toWords64 <$> fromString "550e8400-e29b-41d4-a716-446655440000"
--   Just (6128981282234515924,12039885860129472512)
--   
--   
--   See also toWords.
toWords64 :: UUID -> (Word64, Word64)

-- | Create a UUID from a pair of Word64s.
--   
--   Inverse of toWords64. See also fromWords.
fromWords64 :: Word64 -> Word64 -> UUID
