summaryrefslogtreecommitdiff
path: root/Presence/ByteStringOperators.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2013-06-17 21:34:56 -0400
committerjoe <joe@jerkface.net>2013-06-17 21:34:56 -0400
commit012a3b625c0ea236afc1ea09c89d0dcd435a66bd (patch)
treeba105c111665d0587620b76ff18c8b21076fb3f3 /Presence/ByteStringOperators.hs
parentcc93b83b5a8c9e00839777c59991c5eb8cf0d75a (diff)
State changes on vt switch.
Diffstat (limited to 'Presence/ByteStringOperators.hs')
-rw-r--r--Presence/ByteStringOperators.hs20
1 files changed, 20 insertions, 0 deletions
diff --git a/Presence/ByteStringOperators.hs b/Presence/ByteStringOperators.hs
index 26b64bcf..2815f05a 100644
--- a/Presence/ByteStringOperators.hs
+++ b/Presence/ByteStringOperators.hs
@@ -3,6 +3,11 @@ module ByteStringOperators where
3import qualified Data.ByteString as S (ByteString) 3import qualified Data.ByteString as S (ByteString)
4import Data.ByteString.Lazy.Char8 as L 4import Data.ByteString.Lazy.Char8 as L
5 5
6-- These two were imported to provide an NFData instance.
7import qualified Data.ByteString.Lazy.Internal as L (ByteString(..))
8import Control.DeepSeq
9
10
6(<++>) :: ByteString -> ByteString -> ByteString 11(<++>) :: ByteString -> ByteString -> ByteString
7(<++.>) :: ByteString -> S.ByteString -> ByteString 12(<++.>) :: ByteString -> S.ByteString -> ByteString
8(<.++>) :: S.ByteString -> ByteString -> ByteString 13(<.++>) :: S.ByteString -> ByteString -> ByteString
@@ -16,5 +21,20 @@ infixr 5 <.++>
16infixr 5 <++> 21infixr 5 <++>
17infixr 5 <++.> 22infixr 5 <++.>
18 23
24Nothing <?++> b = b
25Just a <?++> b = a <++> b
26infixr 5 <?++>
27
28a <++?> Nothing = a
29a <++?> Just b = a <++> b
30infixr 5 <++?>
31
19bshow :: Show a => a -> ByteString 32bshow :: Show a => a -> ByteString
20bshow = L.pack . show 33bshow = L.pack . show
34
35
36instance NFData L.ByteString where
37 rnf L.Empty = ()
38 rnf (L.Chunk _ b) = rnf b
39
40