mirror of
https://github.com/commercialhaskell/stackage.git
synced 2026-01-12 15:28:29 +01:00
uuid patch
This commit is contained in:
parent
7eaf714ee2
commit
2bd5cd1ceb
30
patching/patches/uuid-1.3.1.patch
Normal file
30
patching/patches/uuid-1.3.1.patch
Normal file
@ -0,0 +1,30 @@
|
||||
diff -ru orig/Data/UUID/Internal.hs new/Data/UUID/Internal.hs
|
||||
--- orig/Data/UUID/Internal.hs 2013-10-22 19:00:23.458184957 +0300
|
||||
+++ new/Data/UUID/Internal.hs 2013-10-22 19:00:23.000000000 +0300
|
||||
@@ -391,12 +391,24 @@
|
||||
|
||||
-- | Similar to `toASCIIBytes` except we produce a lazy `BL.ByteString`.
|
||||
toLazyASCIIBytes :: UUID -> BL.ByteString
|
||||
-toLazyASCIIBytes = BL.fromStrict . toASCIIBytes
|
||||
+toLazyASCIIBytes =
|
||||
+#if MIN_VERSION_bytestring(0,10,0)
|
||||
+ BL.fromStrict
|
||||
+#else
|
||||
+ BL.fromChunks . return
|
||||
+#endif
|
||||
+ . toASCIIBytes
|
||||
|
||||
-- | Similar to `fromASCIIBytes` except parses from a lazy `BL.ByteString`.
|
||||
fromLazyASCIIBytes :: BL.ByteString -> Maybe UUID
|
||||
fromLazyASCIIBytes bs =
|
||||
- if BL.length bs == 36 then fromASCIIBytes (BL.toStrict bs) else Nothing
|
||||
+ if BL.length bs == 36 then fromASCIIBytes (
|
||||
+#if MIN_VERSION_bytestring(0,10,0)
|
||||
+ BL.toStrict bs
|
||||
+#else
|
||||
+ B.concat $ BL.toChunks bs
|
||||
+#endif
|
||||
+ ) else Nothing
|
||||
|
||||
--
|
||||
-- Class Instances
|
||||
Loading…
Reference in New Issue
Block a user