iteratee 0.6.0.1 → 0.7.0.0
raw patch · 4 files changed
+15/−15 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Data.Nullable: null :: Nullable c => c -> Bool
+ Data.Nullable: nullC :: Nullable c => c -> Bool
Files
- iteratee.cabal +1/−1
- src/Data/Iteratee/Base.hs +1/−1
- src/Data/Iteratee/ListLike.hs +9/−9
- src/Data/Nullable.hs +4/−4
iteratee.cabal view
@@ -1,5 +1,5 @@ name: iteratee-version: 0.6.0.1+version: 0.7.0.0 synopsis: Iteratee-based I/O description: The Iteratee monad provides strict, safe, and functional I/O. In addition
src/Data/Iteratee/Base.hs view
@@ -141,7 +141,7 @@ {-# INLINE (>>=) #-} m >>= f = Iteratee $ \onDone onCont -> let m_done a (Chunk s)- | null s = runIter (f a) onDone onCont+ | nullC s = runIter (f a) onDone onCont m_done a stream = runIter (f a) (const . flip onDone stream) f_cont where f_cont k Nothing = runIter (k stream) onDone onCont f_cont k e = onCont k e
src/Data/Iteratee/ListLike.hs view
@@ -66,7 +66,7 @@ isFinished = liftI check where check c@(Chunk xs)- | null xs = liftI check+ | nullC xs = liftI check | True = idone False c check s@(EOF _) = idone True s {-# INLINE isFinished #-}@@ -80,7 +80,7 @@ stream2list = liftI (step []) where step acc (Chunk ls)- | null ls = liftI (step acc)+ | nullC ls = liftI (step acc) | True = liftI (step (acc ++ LL.toList ls)) step acc str = idone acc str {-# INLINE stream2list #-}@@ -91,7 +91,7 @@ stream2stream = icont (step mempty) Nothing where step acc (Chunk ls)- | null ls = icont (step acc) Nothing+ | nullC ls = icont (step acc) Nothing | True = icont (step (acc `mappend` ls)) Nothing step acc str = idone acc str {-# INLINE stream2stream #-}@@ -142,14 +142,14 @@ -- For example, if the stream contains "abd", then (heads "abc") -- will remove the characters "ab" and return 2. heads :: (Monad m, Nullable s, LL.ListLike s el, Eq el) => s -> Iteratee s m Int-heads st | null st = return 0+heads st | nullC st = return 0 heads st = loop 0 st where loop cnt xs- | null xs = return cnt+ | nullC xs = return cnt | True = liftI (step cnt xs)- step cnt str (Chunk xs) | null xs = liftI (step cnt str)- step cnt str stream | null str = idone cnt stream+ step cnt str (Chunk xs) | nullC xs = liftI (step cnt str)+ step cnt str stream | nullC str = idone cnt stream step cnt str s@(Chunk xs) = if LL.head str == LL.head xs then step (succ cnt) (LL.tail str) (Chunk $ LL.tail xs)@@ -460,12 +460,12 @@ where onCont' od oc x1 k mErr = runIter (icont (step2 x1 k) mErr) od oc step k c@(Chunk str)- | null str = liftI (step k)+ | nullC str = liftI (step k) | True = lift (enumPure1Chunk str i2) >>= enumPair (k c) step k s@(EOF Nothing) = lift (enumEof i2) >>= enumPair (k s) step k s@(EOF (Just e)) = lift (enumErr e i2) >>= enumPair (k s) step2 x1 k (Chunk str)- | null str = liftI (step2 x1 k)+ | nullC str = liftI (step2 x1 k) step2 x1 k str = enumPair (return x1) (k str) longest c1@(Chunk xs) c2@(Chunk ys) = if LL.length xs > LL.length ys then c1 else c2
src/Data/Nullable.hs view
@@ -14,11 +14,11 @@ -- ---------------------------------------------- -- |Nullable container class class NullPoint c => Nullable c where- null :: c -> Bool+ nullC :: c -> Bool instance Nullable [a] where- null [] = True- null _ = False+ nullC [] = True+ nullC _ = False instance Nullable B.ByteString where- null = B.null+ nullC = B.null