
3 Nov
2011
3 Nov
'11
12:07 p.m.
Hello, Apologies the simpleton question but I would like to know how it is done in Haskell. I have a list of values, and I am applying a function to each of these elements. The result is a Maybe. I would like to return the first occurrence which is not a Nothing. I am considering something like: selectOne f = take 1 . filter (\e -> case e of Just _ -> True _ -> False ) . map f I this how it is done? TIA, Hugo F.