packages feed

util 0.1.15.0 → 0.1.16.0

raw patch · 2 files changed

+12/−1 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Util.List: zipWithRemaining :: (a -> b -> c) -> [a] -> [b] -> ([c], Maybe (Either (NonEmpty a) (NonEmpty b)))

Files

Util/List.hs view
@@ -2,9 +2,12 @@ {-# LANGUAGE Safe #-} module Util.List where +import Control.Category (Category (..)) import Control.Applicative import Data.Bool+import Data.Either (Either (..)) import Data.List.NonEmpty (NonEmpty (..))+import Data.Maybe (Maybe (..)) import Numeric.Natural import Util @@ -20,3 +23,11 @@   where dropLengthOf [] as = as         dropLengthOf _  [] = []         dropLengthOf (_:bs) (_:as) = dropLengthOf bs as++zipWithRemaining :: (a -> b -> c) -> [a] -> [b] -> ([c], Maybe (Either (NonEmpty a) (NonEmpty b)))+zipWithRemaining f = go id+  where+    go k [] [] = (k [], Nothing)+    go k [] (b:bs) = (k [], Just (Right (b:|bs)))+    go k (a:as) [] = (k [], Just (Left  (a:|as)))+    go k (a:as) (b:bs) = go (k . (f a b :)) as bs
util.cabal view
@@ -1,5 +1,5 @@ name:                util-version:             0.1.15.0+version:             0.1.16.0 synopsis:            Utilities -- description:          license:             BSD3