witherable 0.1.3.1 → 0.1.3.2
raw patch · 2 files changed
+5/−5 lines, 2 files
Files
- src/Data/Witherable.hs +4/−4
- witherable.cabal +1/−1
src/Data/Witherable.hs view
@@ -52,6 +52,7 @@ #if (MIN_VERSION_base(4,7,0)) import Data.Proxy #endif+import GHC.Base (build) type FilterLike f s t a b = (a -> f (Maybe b)) -> s -> f t type Filter s t a b = forall f. Applicative f => FilterLike f s t a b@@ -193,10 +194,9 @@ {-# INLINABLE wither #-} instance Witherable [] where- wither f = build w where- w c n = go where- go (x:xs) = maybe id c <$> f x <*> go xs- go [] = pure n+ wither f = go where+ go (x:xs) = maybe id (:) <$> f x <*> go xs+ go [] = pure [] {-# INLINE[0] wither #-} mapMaybe = Maybe.mapMaybe catMaybes = Maybe.catMaybes
witherable.cabal view
@@ -1,5 +1,5 @@ name: witherable-version: 0.1.3.1+version: 0.1.3.2 synopsis: Generalization of filter and catMaybes -- description: homepage: https://github.com/fumieval/witherable