recursion-schemes 5.1.1.1 → 5.1.2
raw patch · 3 files changed
+18/−11 lines, 3 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- CHANGELOG.markdown +6/−2
- recursion-schemes.cabal +2/−2
- src/Data/Functor/Foldable.hs +10/−7
CHANGELOG.markdown view
@@ -1,6 +1,10 @@-## 5.1.1.1-* Fix the `Generic`-based instances to also support data constructors with zero+## 5.1.2+* Make the `Generic`-based instances to also support data constructors with zero arguments (and datatypes with zero constructors).++## 5.1.1.1++* Invalid release ## 5.1.1
recursion-schemes.cabal view
@@ -1,7 +1,7 @@ name: recursion-schemes category: Control, Recursion-version: 5.1.1.1-license: BSD3+version: 5.1.2+license: BSD2 cabal-version: >= 1.8 license-file: LICENSE author: Edward A. Kmett
src/Data/Functor/Foldable.hs view
@@ -139,6 +139,7 @@ import qualified Data.Functor.Base as NEF (NonEmptyF(..)) -- $setup+-- >>> :set -XDeriveFunctor -- >>> import Control.Monad (void) -- >>> import Data.Char (toUpper) @@ -791,15 +792,17 @@ -- :} -- "FoObAr" ----- We can implement `zipWith`+-- We can implement a variant of `zipWith` --+-- >>> data Pair a = Pair a a deriving Functor+-- -- >>> :{--- let zipWith' :: (a -> b -> c) -> [a] -> [b] -> [c]--- zipWith' f = curry $ cotransverse $ \(xs, base) -> case (project xs, base) of--- (Nil, _) -> Nil--- (_, Nil) -> Nil--- (Cons x a, Cons y b) -> Cons (f x y) (a, b)--- :}+-- let zipWith' :: (a -> a -> b) -> [a] -> [a] -> [b]+-- zipWith' f xs ys = cotransverse g (Pair xs ys) where+-- g (Pair Nil _) = Nil+-- g (Pair _ Nil) = Nil+-- g (Pair (Cons x a) (Cons y b)) = Cons (f x y) (Pair a b)+-- :} -- -- >>> zipWith' (*) [1,2,3] [4,5,6] -- [4,10,18]