Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add bytestring conversion

  • Loading branch information...
commit b6169c698396ec8bbb187ba8f393d59536a9a6ac 1 parent 40a42ca
@nfjinjing authored
Showing with 15 additions and 2 deletions.
  1. +1 −1  air.cabal
  2. +4 −0 changelog.md
  3. +10 −1 src/Air/Light.hs
View
2  air.cabal
@@ -1,5 +1,5 @@
Name: air
-Version: 2011.6.19
+Version: 2011.7.25
Build-type: Simple
Synopsis: air
Description: An alternative Haskell Prelude library.
View
4 changelog.md
@@ -0,0 +1,4 @@
+2011.7.25
+---------
+
+* add bytestring conversion
View
11 src/Air/Light.hs
@@ -21,6 +21,9 @@ import Control.Monad.Trans (liftIO, MonadIO)
import Control.Concurrent
import System.Exit ( exitWith, ExitCode(ExitSuccess) )
+import qualified Data.ByteString.Lazy.Char8 as LazyByteString
+import qualified Data.ByteString.Char8 as StrictByteString
+
-- base DSL
{-# INLINE (.) #-}
@@ -346,4 +349,10 @@ end :: (Monad m) => m ()
end = return ()
io :: (MonadIO m) => IO a -> m a
-io = liftIO
+io = liftIO
+
+l2s :: LazyByteString.ByteString -> StrictByteString.ByteString
+l2s x = StrictByteString.concat - LazyByteString.toChunks x
+
+s2l :: StrictByteString.ByteString -> LazyByteString.ByteString
+s2l x = LazyByteString.fromChunks [x]
Please sign in to comment.
Something went wrong with that request. Please try again.