uuid-types-1.0.3: Type definitions for Universally Unique Identifiers

Copyright(c) 20082012 Antoine Latter
LicenseBSD-style
Maintaineraslatter@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Data.UUID.Types

Description

This library is useful for comparing, parsing and printing Universally Unique Identifiers. See http://en.wikipedia.org/wiki/UUID for the general idea. See http://tools.ietf.org/html/rfc4122 for the specification.

Synopsis

Documentation

data UUID Source #

The UUID type. A Random instance is provided which produces version 4 UUIDs as specified in RFC 4122. The Storable and Binary instances are compatible with RFC 4122, storing the fields in network order as 16 bytes.

Instances
Eq UUID Source # 
Instance details

Defined in Data.UUID.Types.Internal

Methods

(==) :: UUID -> UUID -> Bool Source #

(/=) :: UUID -> UUID -> Bool Source #

Data UUID Source # 
Instance details

Defined in Data.UUID.Types.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UUID -> c UUID Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UUID Source #

toConstr :: UUID -> Constr Source #

dataTypeOf :: UUID -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UUID) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UUID) Source #

gmapT :: (forall b. Data b => b -> b) -> UUID -> UUID Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UUID -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UUID -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> UUID -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UUID -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UUID -> m UUID Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UUID -> m UUID Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UUID -> m UUID Source #

Ord UUID Source # 
Instance details

Defined in Data.UUID.Types.Internal

Read UUID Source # 
Instance details

Defined in Data.UUID.Types.Internal

Show UUID Source # 
Instance details

Defined in Data.UUID.Types.Internal

Storable UUID Source # 
Instance details

Defined in Data.UUID.Types.Internal

Binary UUID Source # 
Instance details

Defined in Data.UUID.Types.Internal

NFData UUID Source # 
Instance details

Defined in Data.UUID.Types.Internal

Methods

rnf :: UUID -> () Source #

Random UUID Source # 
Instance details

Defined in Data.UUID.Types.Internal

Methods

randomR :: RandomGen g => (UUID, UUID) -> g -> (UUID, g) Source #

random :: RandomGen g => g -> (UUID, g) Source #

randomRs :: RandomGen g => (UUID, UUID) -> g -> [UUID] Source #

randoms :: RandomGen g => g -> [UUID] Source #

randomRIO :: (UUID, UUID) -> IO UUID Source #

randomIO :: IO UUID Source #

Hashable UUID Source # 
Instance details

Defined in Data.UUID.Types.Internal

Methods

hashWithSalt :: Int -> UUID -> Int

hash :: UUID -> Int

toString :: UUID -> String Source #

Convert a UUID into a hypenated string using lower-case letters. Example:

 toString <$> fromString "550e8400-e29b-41d4-a716-446655440000"

fromString :: String -> Maybe UUID Source #

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"

Hex digits may be upper or lower-case.

toText :: UUID -> Text Source #

Convert a UUID into a hyphentated string using lower-case letters.

fromText :: Text -> Maybe UUID Source #

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

toASCIIBytes :: UUID -> ByteString Source #

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.

fromASCIIBytes :: ByteString -> Maybe UUID Source #

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.

toLazyASCIIBytes :: UUID -> ByteString Source #

Similar to toASCIIBytes except we produce a lazy ByteString.

fromLazyASCIIBytes :: ByteString -> Maybe UUID Source #

Similar to fromASCIIBytes except parses from a lazy ByteString.

toByteString :: UUID -> ByteString Source #

Encode a UUID into a ByteString in network order.

fromByteString :: ByteString -> Maybe UUID Source #

Extract a UUID from a ByteString in network byte order. The argument must be 16 bytes long, otherwise Nothing is returned.

toWords :: UUID -> (Word32, Word32, Word32, Word32) Source #

Covert a UUID into a sequence of Word32 values. Useful for when you need to serialize a UUID and neither Storable nor Binary are appropriate. Introduced in version 1.2.2.

fromWords :: Word32 -> Word32 -> Word32 -> Word32 -> UUID Source #

Create a UUID from a sequence of Word32. The opposite of toWords. Useful when you need a total function for constructing UUID values. Introduced in version 1.2.2.

null :: UUID -> Bool Source #

Returns true if the passed-in UUID is the nil UUID.

nil :: UUID Source #

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