[Haskell-beginners] Trivial function of type (a -> b) -> Maybe a -> Maybe b

Colin Paul Adams colin at colina.demon.co.uk
Wed Jan 13 09:47:51 EST 2010

>>>>> "Eugen" == Eugen Zagorodniy <e.zagorodniy at gmail.com> writes:

    Eugen> Greetings!  I looked at documentation of Maybe type and
    Eugen> suprisingly found no function like

    Eugen> maybize :: (a -> b) -> Maybe a -> Maybe b maybize f Nothing
    Eugen> = Nothing maybize f (Just x) = Just (f x)

Isn't that fmap?
Colin Adams
Preston Lancashire

More information about the Beginners mailing list