[Haskell-beginners] Maybe a -> Maybe b

PICCA Frederic-Emmanuel frederic-emmanuel.picca at synchrotron-soleil.fr
Fri Aug 25 08:05:34 UTC 2017


Hello, I have this 

data Proxy = Proxy String 

And I want to write a function

f :: Maybe Proxy -> Maybe String
f ma = case ma of
           (Just (Proxy a)) -> Just a
           Nothing -> Nothing

I was wondering if there is no simpler way to do this ?

thanks

Frederic


More information about the Beginners mailing list