@@ -68,7 +68,7 @@ import qualified Data.ByteString.Internal as BI
68import qualified Data.ByteString.Lazy as BL
68import qualified Data.ByteString.Lazy as BL
69import qualified Data.ByteString.Unsafe as BU
69import qualified Data.ByteString.Unsafe as BU
70import Data.Text (Text)
70import Data.Text (Text)
71−import qualified Data.Text as T
71+import qualified Data.Text.Encoding as T
73import Data.UUID.Types.Internal.Builder
73import Data.UUID.Types.Internal.Builder
@@ -351,11 +351,11 @@ toString uuid = hexw w0 $ hexw' w1 $ hexw' w2 $ hexw w3 ""
351-- | If the passed in `Text` can be parsed as an ASCII representation of
351-- | If the passed in `Text` can be parsed as an ASCII representation of
352-- a `UUID`, it will be. The hyphens may not be omitted.
352-- a `UUID`, it will be. The hyphens may not be omitted.
353fromText :: Text -> Maybe UUID
353fromText :: Text -> Maybe UUID
354−fromText = fromString . T.unpack
354+fromText = fromASCIIBytes . T.encodeUtf8
356-- | Convert a UUID into a hyphentated string using lower-case letters.
356-- | Convert a UUID into a hyphentated string using lower-case letters.
357toText :: UUID -> Text
357toText :: UUID -> Text
358−toText = T.pack . toString
358+toText = T.decodeLatin1 . toASCIIBytes
360-- | Convert a UUID into a hyphentated string using lower-case letters, packed
360-- | Convert a UUID into a hyphentated string using lower-case letters, packed
361-- as ASCII bytes into `B.ByteString`.
361-- as ASCII bytes into `B.ByteString`.