@@ -40,7 +40,7 @@ fromBytes xs = if length xs == 16
40 else error "Data.UUID.Internal.fromBytes: passed in list of bytes must be of length 16."
40 else error "Data.UUID.Internal.fromBytes: passed in list of bytes must be of length 16."
42-- |Creates a UUID out of a list of bytes.
42-- |Creates a UUID out of a list of bytes.
43−-- Does not perform a length check.
43+-- Does not perform a length check on the passed in list.
44-- Behavior is undefined for lists not of length 16.
44-- Behavior is undefined for lists not of length 16.
45unsafeFromBytes :: [Word8] -> UUID
45unsafeFromBytes :: [Word8] -> UUID
46unsafeFromBytes xs = U $ castForeignPtr $ unsafePerformIO $ do
46unsafeFromBytes xs = U $ castForeignPtr $ unsafePerformIO $ do
@@ -48,12 +48,16 @@ unsafeFromBytes xs = U $ castForeignPtr $ unsafePerformIO $ do
48 withForeignPtr p $ flip pokeArray xs
48 withForeignPtr p $ flip pokeArray xs
51−-- |Given a UUID, returns a pointer to the 16 bytes
53+-- Given a UUID, returns a pointer to the 16 bytes
52-- of memory that make up the UUID.
54-- of memory that make up the UUID.
53toForeignPtr :: UUID -> ForeignPtr CChar
55toForeignPtr :: UUID -> ForeignPtr CChar
54toForeignPtr (U p) = p
56toForeignPtr (U p) = p
56−-- |The passed in pointer is treated as if it were a pointer
60+-- The passed in pointer is treated as if it were a pointer
57−-- to 16 bytes of memory. You're in trouble if it isn't.
61+-- to 16 bytes of memory, which is then returned as a UUID.
58fromForeignPtr :: ForeignPtr CChar -> UUID
62fromForeignPtr :: ForeignPtr CChar -> UUID
59fromForeignPtr = U
63fromForeignPtr = U