[Haskell-beginners] Common Method for [Maybe a] -> [a]
Simon Jakobi
simon.jakobi at googlemail.com
Wed May 1 11:24:54 UTC 2019
Hi Leonhard,
the function is called catMaybes.
Hoogle is a good way to find it:
https://hoogle.haskell.org/?hoogle=%5BMaybe+a%5D+-%3E+%5Ba%5D
Cheers,
Simon
Am Mi., 1. Mai 2019 um 13:05 Uhr schrieb Leonhard Applis <
Leonhard.Applis at protonmail.com>:
> Hey there,
>
> I've got a method:
>
> *demaybefy* :: [Maybe a] -> [a]
> demaybefy [] = []
> demaybefy (x:xs) = case x of
> Just x -> x : demaybefy xs
> Nothing -> demaybefy xs
>
>
>
> However, i feel that there is a method from preload/list/maybe that does
> exactly the same, but i cannot find it.
> Can someone help me?
>
> best regards
> Leonhard
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20190501/e4bbde11/attachment.html>
More information about the Beginners
mailing list