base64-conduit 0.5.1 → 1.0.0
raw patch · 2 files changed
+9/−9 lines, 2 filesdep ~conduit
Dependency ranges changed: conduit
Files
- Data/Conduit/Base64.hs +7/−7
- base64-conduit.cabal +2/−2
Data/Conduit/Base64.hs view
@@ -17,27 +17,27 @@ import Data.Conduit -encode :: Monad m => GInfConduit ByteString m ByteString+encode :: Monad m => Conduit ByteString m ByteString encode = codeWith 3 B64.encode -decode :: Monad m => GInfConduit ByteString m ByteString+decode :: Monad m => Conduit ByteString m ByteString decode = codeWith 4 B64.decodeLenient -encodeURL :: Monad m => GInfConduit ByteString m ByteString+encodeURL :: Monad m => Conduit ByteString m ByteString encodeURL = codeWith 3 B64U.encode -decodeURL :: Monad m => GInfConduit ByteString m ByteString+decodeURL :: Monad m => Conduit ByteString m ByteString decodeURL = codeWith 4 B64U.decodeLenient -codeWith :: Monad m => Int -> (ByteString -> ByteString) -> GInfConduit ByteString m ByteString+codeWith :: Monad m => Int -> (ByteString -> ByteString) -> Conduit ByteString m ByteString codeWith size f = loop where- loop = awaitE >>= either return push+ loop = await >>= maybe (return ()) push loopWith bs | S.null bs = loop- | otherwise = awaitE >>= either (\r -> yield (f bs) >> return r) (pushWith bs)+ | otherwise = await >>= maybe (yield (f bs)) (pushWith bs) push bs = do let (x, y) = S.splitAt (len - (len `mod` size)) bs
base64-conduit.cabal view
@@ -1,5 +1,5 @@ Name: base64-conduit-Version: 0.5.1+Version: 1.0.0 Synopsis: Base64-encode and decode streams of bytes. Description: Base64-encode and decode streams of bytes. License: BSD3@@ -17,7 +17,7 @@ Build-depends: base >= 4 && < 5 , bytestring >= 0.9 , base64-bytestring >= 0.1.1.1- , conduit >= 0.5 && < 0.6+ , conduit >= 1.0 && < 1.1 ghc-options: -Wall test-suite test