filterMap was missing a parameter, fixed
commitdef32352c150ada4adebe40f433080cb1508cb65
authorMichael James <michael@michaelbjames.com>
dateWed 17 Sep 2014, 21:54 (12 years ago)
parentafff54c
libraries/List.elm+4−4
@@ -138,11 +138,11 @@ the successes.
138138 filterMap toInt ["3", "4.0", "5", "hats"] == [3,5]
139139-}
140140filterMap : (a -> Maybe b) -> [a] -> [b]
141−filterMap xs = Native.List.foldr maybeCons [] xs
141+filterMap f xs = foldr (maybeCons f) [] xs
142142
143−maybeCons : Maybe a -> [a] -> [a]
144−maybeCons mx xs =
145− case mx of
143+maybeCons : (a -> Maybe b) -> a -> [b] -> [b]
144+maybeCons f mx xs =
145+ case f mx of
146146 Just x -> x :: xs
147147 Nothing -> xs
148148