foldl 1.4.14 → 1.4.15
raw patch · 3 files changed
+20/−7 lines, 3 filesdep ~bytestringdep ~containersdep ~primitivePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: bytestring, containers, primitive, profunctors, text
API changes (from Hackage documentation)
+ Control.Foldl: instance Data.Profunctor.Sieve.Cosieve Control.Foldl.Fold []
+ Control.Foldl: instance Data.Profunctor.Strong.Costrong Control.Foldl.Fold
Files
- README.md +1/−1
- foldl.cabal +4/−4
- src/Control/Foldl.hs +15/−2
README.md view
@@ -94,7 +94,7 @@ ```haskell (,) <$> Fold.sum <*> Fold.length = Fold step (Pair 0 0) done where- step (Pair x y) = Pair (x + n) (y + 1)+ step (Pair x y) n = Pair (x + n) (y + 1) done (Pair x y) = (x, y) ```
foldl.cabal view
@@ -1,5 +1,5 @@ Name: foldl-Version: 1.4.14+Version: 1.4.15 Cabal-Version: >=1.10 Build-Type: Simple License: BSD3@@ -27,7 +27,7 @@ base >= 4.11.0.0 && < 5 , bytestring >= 0.9.2.1 && < 0.12, random >= 1.2 && < 1.3 ,- primitive < 0.8 ,+ primitive < 0.9 , text >= 0.11.2.0 && < 2.1 , transformers >= 0.2.0.0 && < 0.7 , vector >= 0.7 && < 0.14,@@ -35,8 +35,8 @@ unordered-containers < 0.3 , hashable < 1.5 , contravariant < 1.6 ,- profunctors >= 3.2 && < 5.7 ,- semigroupoids >= 1.0 && < 5.4 ,+ profunctors >= 4.3.2 && < 5.7 ,+ semigroupoids >= 1.0 && < 6.1 , comonad >= 4.0 && < 6 if impl(ghc < 8.0) Build-Depends:
src/Control/Foldl.hs view
@@ -41,6 +41,7 @@ {-# LANGUAGE BangPatterns #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE Trustworthy #-}@@ -164,6 +165,7 @@ import Data.Semigroupoid (Semigroupoid) import Data.Functor.Extend (Extend(..)) import Data.Profunctor+import Data.Profunctor.Sieve import Data.Sequence ((|>)) import Data.Vector.Generic (Vector, Mutable) import Data.Vector.Generic.Mutable (MVector)@@ -242,8 +244,19 @@ rmap = fmap instance Choice Fold where- right' (Fold step begin done) = Fold (liftA2 step) (Right begin) (fmap done)- {-# INLINE right' #-}+ right' (Fold step begin done) = Fold (liftA2 step) (Right begin) (fmap done)+ {-# INLINE right' #-}++instance Cosieve Fold [] where+ cosieve = fold+ {-# INLINE cosieve #-}++instance Costrong Fold where+ unfirst p = fmap f list+ where+ f as = b+ where (b, d) = fold p [ (a, d) | a <- as ]+ {-# INLINE unfirst #-} instance Comonad (Fold a) where extract (Fold _ begin done) = done begin