Is there a built-in function that already does this?<br><br>foo :: (a -&gt; b) -&gt; Maybe a -&gt; Maybe b<br>foo f m<br>&nbsp; | isNothing m = Nothing<br>&nbsp; | otherwise = Just (f (fromJust m))<br><br>*Main&gt; foo (+2) (Just 3)
<br>Just 5<br>*Main&gt; 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>