on master help sign in
Fix building against bytestring 0.9.*
22d4cbbAntoine Latter
Data/UUID/Internal.hs+14−2
@@ -391,12 +391,24 @@ fromASCIIBytes bs = do
391
391
392-- | Similar to `toASCIIBytes` except we produce a lazy `BL.ByteString`.
392-- | Similar to `toASCIIBytes` except we produce a lazy `BL.ByteString`.
393toLazyASCIIBytes :: UUID -> BL.ByteString
393toLazyASCIIBytes :: UUID -> BL.ByteString
394−toLazyASCIIBytes = BL.fromStrict . toASCIIBytes
394+toLazyASCIIBytes =
395+#if MIN_VERSION_bytestring(0,10,0)
396+ BL.fromStrict
397+#else
398+ BL.fromChunks . return
399+#endif
400+ . toASCIIBytes
395
401
396-- | Similar to `fromASCIIBytes` except parses from a lazy `BL.ByteString`.
402-- | Similar to `fromASCIIBytes` except parses from a lazy `BL.ByteString`.
397fromLazyASCIIBytes :: BL.ByteString -> Maybe UUID
403fromLazyASCIIBytes :: BL.ByteString -> Maybe UUID
398fromLazyASCIIBytes bs =
404fromLazyASCIIBytes bs =
399− if BL.length bs == 36 then fromASCIIBytes (BL.toStrict bs) else Nothing
405+ if BL.length bs == 36 then fromASCIIBytes (
406+#if MIN_VERSION_bytestring(0,10,0)
407+ BL.toStrict bs
408+#else
409+ B.concat $ BL.toChunks bs
410+#endif
411+ ) else Nothing
400
412
401--
413--
402-- Class Instances
414-- Class Instances