File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 2525
2626 append :: forall a. [a] -> [a] -> [a]
2727
28+ catMaybes :: forall a. [Maybe a] -> [a]
29+
2830 concat :: forall a. [[a]] -> [a]
2931
3032 concatMap :: forall a b. (a -> [b]) -> [a] -> [b]
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ module Data.Array
99 , null
1010 , map
1111 , mapMaybe
12+ , catMaybes
1213 , length
1314 , findIndex
1415 , findLastIndex
@@ -218,6 +219,9 @@ foreign import map
218219mapMaybe :: forall a b . (a -> Maybe b ) -> [a ] -> [b ]
219220mapMaybe f = concatMap (maybe [] singleton <<< f)
220221
222+ catMaybes :: forall a . [Maybe a ] -> [a ]
223+ catMaybes = concatMap (maybe [] singleton)
224+
221225foreign import filter
222226 " function filter (f) {\
223227 \ return function (arr) {\
You can’t perform that action at this time.
0 commit comments