HORIZON HASKELLDocslts/ghc-10.0.x2b276322026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 2b27632 · 2026-10-31

Moduleuuid-types-1.0.6.1Haskell2010

Data.UUID.Types

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

Contents
  1. The UUID Type
  2. Nil UUID
  3. Textual Representation
  4. Binary Representation
  5. Integer Representation
Synopsis

The UUID Type

datadata UUID

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

Instances12Eq, Data, Ord, Read, Show, Storable, …
  • Eq UUIDDefined in uuid-types-1.0.6.1 · Data.UUID.Types.Internal
  • Data UUIDDefined in uuid-types-1.0.6.1 · Data.UUID.Types.Internal
  • Ord UUIDDefined in uuid-types-1.0.6.1 · Data.UUID.Types.Internal
  • Read UUIDDefined in uuid-types-1.0.6.1 · Data.UUID.Types.Internal
  • Show UUIDDefined in uuid-types-1.0.6.1 · Data.UUID.Types.Internal

    Pretty prints a UUID (without quotation marks). See also toString.

    Example1 expression
    show nil"00000000-0000-0000-0000-000000000000"
  • Storable UUIDDefined in uuid-types-1.0.6.1 · Data.UUID.Types.Internal

    This Storable instance uses the memory layout as described in RFC 4122, but in contrast to the Binary instance, the fields are stored in host byte order.

  • NFData UUIDDefined in uuid-types-1.0.6.1 · Data.UUID.Types.Internal
  • Binary UUIDDefined in uuid-types-1.0.6.1 · Data.UUID.Types.Internal

    This Binary instance is compatible with RFC 4122, storing the fields in network order as 16 bytes.

  • Random UUIDDefined in uuid-types-1.0.6.1 · Data.UUID.Types.Internal

    This Random instance produces insecure version 4 UUIDs as specified in RFC 4122.

  • Uniform UUIDDefined in uuid-types-1.0.6.1 · Data.UUID.Types.Internal
  • Hashable UUIDDefined in uuid-types-1.0.6.1 · Data.UUID.Types.Internal
  • Lift UUIDDefined in uuid-types-1.0.6.1 · Data.UUID.Types.Internal

Nil UUID

Textual Representation

valuetoString :: UUID -> String

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

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

If the passed in String can be parsed as a UUID, it will be. The hyphens may not be omitted. Example:

Example1 expression
fromString "c2cc10e1-57d6-4b6f-9899-38d972112d8c"Just c2cc10e1-57d6-4b6f-9899-38d972112d8c

Hex digits may be upper or lower-case.

valuetoText :: UUID -> Text

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

Binary Representation

Integer Representation

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.

Example1 expression
toWords <$> fromString "550e8400-e29b-41d4-a716-446655440000"Just (1427014656,3801825748,2803254374,1430519808)

See also toWords64.

Since: uuid-1.2.2