HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulerebase-1.21.2Haskell2010

Rebase.Data.UUID

  • 1 type
  • 16 values
  • Packagerebase-1.21.2
  • Exports17
  • LanguageHaskell2010
  • LicenceMIT
  • SourceInternal.hs
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 · Data.UUID.Types.Internal
  • Data UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal
  • Ord UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal
  • Read UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal
  • Show UUIDDefined in uuid-types-1.0.6 · 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 · 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 · Data.UUID.Types.Internal
  • Random UUIDDefined in uuid-types-1.0.6 · 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 · Data.UUID.Types.Internal
  • Binary UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal

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

  • Hashable UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal
  • Lift UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal
valuenull :: UUID -> Bool
#

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

valuefromString :: String -> Maybe UUID
#

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.

valuefromText :: Text -> Maybe UUID
#

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

valuetoText :: UUID -> Text
#

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

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"
valuetoWords :: UUID -> (Word32, Word32, Word32, Word32)
#

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

valuetoWords64 :: UUID -> (Word64, Word64)
#

Convert a UUID into a pair of Word64s.

Example1 expression
toWords64 <$> fromString "550e8400-e29b-41d4-a716-446655440000"Just (6128981282234515924,12039885860129472512)

See also toWords.