@@ -229,11 +229,11 @@ instance Binary Node where
229229 return $ Node w1 w2 w3 w4 w5 w6
230230
231231
232−-- |Extract a UUID from a 'ByteString'.
233−-- The argument must be 16 bytes long, otherwise 'nil' is returned.
234−fromByteString :: Lazy.ByteString -> UUID
235−fromByteString bs | Lazy.length bs == 16 = decode bs
236− | otherwise = nil
232+-- |Extract a UUID from a 'ByteString' in network byte order.
233+-- The argument must be 16 bytes long, otherwise 'Nothing' is returned.
234+fromByteString :: Lazy.ByteString -> Maybe UUID
235+fromByteString bs | Lazy.length bs == 16 = Just $ decode bs
236+ | otherwise = Nothing
237237
238238-- |Encode a UUID into a 'ByteString' in network order.
239239toByteString :: UUID -> Lazy.ByteString