
13 Aug
2011
13 Aug
'11
6:23 p.m.
Mihai Maruseac
I'd go by:
fn l = let l' = filter (/= Nothing) l in if l' == [] then Nothing else head l'
If you want to disregard the useful Monoid instance of Maybe, then here is a nicer way to express this: fn :: [Maybe a] -> Maybe a fn = listToMaybe . catMaybes Greets, Ertugrul -- nightmare = unsafePerformIO (getWrongWife >>= sex) http://ertes.de/