@@ -27,6 +27,8 @@ module Data.UUID.Types.Internal
2727 , toText
2828 , fromWords
2929 , toWords
30+ , fromWords64
31+ , toWords64
3032 , toList
3133 , buildFromBytes
3234 , buildFromWords
@@ -94,10 +96,15 @@ data UUID = UUID {-# UNPACK #-} !Word64 {-# UNPACK #-} !Word64
9496 None was as fast, overall, as the representation used here.
9597-}
9698
97−-- | Covert a 'UUID' into a sequence of 'Word32' values.
99+-- | Convert a 'UUID' into a sequence of 'Word32' values.
98100-- Useful for when you need to serialize a UUID and
99101-- neither 'Storable' nor 'Binary' are appropriate.
100−-- Introduced in version 1.2.2.
102+--
103+-- See also 'toWords64'.
104+--
105+-- /Since: @uuid-1.2.2@/
106+--
107+-- @since 1.0.0
101108toWords :: UUID -> (Word32, Word32, Word32, Word32)
102109toWords (UUID w12 w34) = (w1, w2, w3, w4)
103110 where
@@ -107,12 +114,33 @@ toWords (UUID w12 w34) = (w1, w2, w3, w4)
107114 w4 = fromIntegral w34
108115
109116-- | Create a 'UUID' from a sequence of 'Word32'. The
110−-- opposite of 'toWords'. Useful when you need a total
117+-- inverse of 'toWords'. Useful when you need a total
111118-- function for constructing 'UUID' values.
112−-- Introduced in version 1.2.2.
119+--
120+-- See also 'fromWords64'.
121+--
122+-- /Since: @uuid-1.2.2@/
123+--
124+-- @since 1.0.0
113125fromWords :: Word32 -> Word32 -> Word32 -> Word32 -> UUID
114126fromWords w1 w2 w3 w4 = UUID (w32to64 w1 w2) (w32to64 w3 w4)
115127
128+-- | Convert a 'UUID' into a pair of 'Word64's.
129+--
130+-- See also 'toWords'.
131+--
132+-- @since 1.0.4
133+toWords64 :: UUID -> (Word64, Word64)
134+toWords64 (UUID w12 w34) = (w12,w34)
135+
136+-- | Create a 'UUID' from a pair of 'Word64's.
137+--
138+-- Inverse of 'toWords64'. See also 'fromWords'.
139+--
140+-- @since 1.0.4
141+fromWords64 :: Word64 -> Word64 -> UUID
142+fromWords64 = UUID
143+
116144data UnpackedUUID =
117145 UnpackedUUID {
118146 time_low :: Word32 -- 0-3