diff options
author | joe <joe@jerkface.net> | 2013-06-17 21:34:56 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2013-06-17 21:34:56 -0400 |
commit | 012a3b625c0ea236afc1ea09c89d0dcd435a66bd (patch) | |
tree | ba105c111665d0587620b76ff18c8b21076fb3f3 /Presence/ByteStringOperators.hs | |
parent | cc93b83b5a8c9e00839777c59991c5eb8cf0d75a (diff) |
State changes on vt switch.
Diffstat (limited to 'Presence/ByteStringOperators.hs')
-rw-r--r-- | Presence/ByteStringOperators.hs | 20 |
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 | |||
3 | import qualified Data.ByteString as S (ByteString) | 3 | import qualified Data.ByteString as S (ByteString) |
4 | import Data.ByteString.Lazy.Char8 as L | 4 | import Data.ByteString.Lazy.Char8 as L |
5 | 5 | ||
6 | -- These two were imported to provide an NFData instance. | ||
7 | import qualified Data.ByteString.Lazy.Internal as L (ByteString(..)) | ||
8 | import 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 <.++> | |||
16 | infixr 5 <++> | 21 | infixr 5 <++> |
17 | infixr 5 <++.> | 22 | infixr 5 <++.> |
18 | 23 | ||
24 | Nothing <?++> b = b | ||
25 | Just a <?++> b = a <++> b | ||
26 | infixr 5 <?++> | ||
27 | |||
28 | a <++?> Nothing = a | ||
29 | a <++?> Just b = a <++> b | ||
30 | infixr 5 <++?> | ||
31 | |||
19 | bshow :: Show a => a -> ByteString | 32 | bshow :: Show a => a -> ByteString |
20 | bshow = L.pack . show | 33 | bshow = L.pack . show |
34 | |||
35 | |||
36 | instance NFData L.ByteString where | ||
37 | rnf L.Empty = () | ||
38 | rnf (L.Chunk _ b) = rnf b | ||
39 | |||
40 | |||