Is there a built-in function that already does this?<br><br>foo :: (a -> b) -> Maybe a -> Maybe b<br>foo f m<br> | isNothing m = Nothing<br> | otherwise = Just (f (fromJust m))<br><br>*Main> foo (+2) (Just 3)
<br>Just 5<br>*Main> foo (+2) Nothing<br>Nothing<br><br>If so what is it?<br><br>If not, what should I call it?<br><br>Thanks<br><br>-John<br><br>