diff options
-rw-r--r-- | Presence/ByteStringOperators.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Presence/ByteStringOperators.hs b/Presence/ByteStringOperators.hs index 4453aca0..e8485134 100644 --- a/Presence/ByteStringOperators.hs +++ b/Presence/ByteStringOperators.hs | |||
@@ -5,9 +5,12 @@ import qualified Data.ByteString as S (ByteString) | |||
5 | import Data.ByteString.Lazy.Char8 as L | 5 | import Data.ByteString.Lazy.Char8 as L |
6 | import Control.Applicative | 6 | import Control.Applicative |
7 | 7 | ||
8 | #if MIN_VERSION_bytestring(0,10,0) | ||
9 | #else | ||
8 | -- These two were imported to provide an NFData instance. | 10 | -- These two were imported to provide an NFData instance. |
9 | import qualified Data.ByteString.Lazy.Internal as L (ByteString(..)) | 11 | import qualified Data.ByteString.Lazy.Internal as L (ByteString(..)) |
10 | import Control.DeepSeq | 12 | import Control.DeepSeq |
13 | #endif | ||
11 | 14 | ||
12 | 15 | ||
13 | (<++>) :: ByteString -> ByteString -> ByteString | 16 | (<++>) :: ByteString -> ByteString -> ByteString |
@@ -23,6 +26,10 @@ infixr 5 <.++> | |||
23 | infixr 5 <++> | 26 | infixr 5 <++> |
24 | infixr 5 <++.> | 27 | infixr 5 <++.> |
25 | 28 | ||
29 | |||
30 | (<++$>) :: Functor f => ByteString -> f ByteString -> f ByteString | ||
31 | (<$++>) :: Functor f => f ByteString -> ByteString -> f ByteString | ||
32 | (<$++$>) :: Applicative f => f ByteString -> f ByteString -> f ByteString | ||
26 | a <++$> b = fmap (a<++>) b | 33 | a <++$> b = fmap (a<++>) b |
27 | a <$++> b = fmap (<++>b) a | 34 | a <$++> b = fmap (<++>b) a |
28 | a <$++$> b = liftA2 (<++>) a b | 35 | a <$++$> b = liftA2 (<++>) a b |
@@ -30,10 +37,12 @@ infixr 6 <++$> | |||
30 | infixr 6 <$++> | 37 | infixr 6 <$++> |
31 | infixr 6 <$++$> | 38 | infixr 6 <$++$> |
32 | 39 | ||
40 | (<?++>) :: Maybe ByteString -> ByteString -> ByteString | ||
33 | Nothing <?++> b = b | 41 | Nothing <?++> b = b |
34 | Just a <?++> b = a <++> b | 42 | Just a <?++> b = a <++> b |
35 | infixr 5 <?++> | 43 | infixr 5 <?++> |
36 | 44 | ||
45 | (<++?>) :: ByteString -> Maybe ByteString -> ByteString | ||
37 | a <++?> Nothing = a | 46 | a <++?> Nothing = a |
38 | a <++?> Just b = a <++> b | 47 | a <++?> Just b = a <++> b |
39 | infixr 5 <++?> | 48 | infixr 5 <++?> |