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 25
25
26
26
append :: forall a. [a] -> [a] -> [a]
27
27
28
+ catMaybes :: forall a. [Maybe a] -> [a]
29
+
28
30
concat :: forall a. [[a]] -> [a]
29
31
30
32
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
9
9
, null
10
10
, map
11
11
, mapMaybe
12
+ , catMaybes
12
13
, length
13
14
, findIndex
14
15
, findLastIndex
@@ -218,6 +219,9 @@ foreign import map
218
219
mapMaybe :: forall a b . (a -> Maybe b ) -> [a ] -> [b ]
219
220
mapMaybe f = concatMap (maybe [] singleton <<< f)
220
221
222
+ catMaybes :: forall a . [Maybe a ] -> [a ]
223
+ catMaybes = concatMap (maybe [] singleton)
224
+
221
225
foreign import filter
222
226
" function filter (f) {\
223
227
\ return function (arr) {\
You can’t perform that action at this time.
0 commit comments