<div dir="ltr">sorry, these 2 should be correct<br><br>f ma = fmap (\(Proxy a) -> a) ma <br><br>f = fmap (\(Proxy a) -> a) </div><div class="gmail_extra"><br><div class="gmail_quote">2017-08-25 15:58 GMT+03:00 Andrey Klaus <span dir="ltr"><<a href="mailto:deepmindster@gmail.com" target="_blank">deepmindster@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello <br><br>f ma = fmap ((Proxy a) -> Just a) ma <br><br>or even shorter <br><br>f = fmap ((Proxy a) -> Just a) <br><br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2017-08-25 15:00 GMT+03:00 <span dir="ltr"><<a href="mailto:beginners-request@haskell.org" target="_blank">beginners-request@haskell.org</a><wbr>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send Beginners mailing list submissions to<br>
<a href="mailto:beginners@haskell.org" target="_blank">beginners@haskell.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bi<wbr>n/mailman/listinfo/beginners</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:beginners-request@haskell.org" target="_blank">beginners-request@haskell.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:beginners-owner@haskell.org" target="_blank">beginners-owner@haskell.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of Beginners digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Maybe a -> Maybe b (PICCA Frederic-Emmanuel)<br>
<br>
<br>
------------------------------<wbr>------------------------------<wbr>----------<br>
<br>
Message: 1<br>
Date: Fri, 25 Aug 2017 08:05:34 +0000<br>
From: PICCA Frederic-Emmanuel<br>
<<a href="mailto:frederic-emmanuel.picca@synchrotron-soleil.fr" target="_blank">frederic-emmanuel.picca@synch<wbr>rotron-soleil.fr</a>><br>
To: "<a href="mailto:beginners@haskell.org" target="_blank">beginners@haskell.org</a>" <<a href="mailto:beginners@haskell.org" target="_blank">beginners@haskell.org</a>><br>
Subject: [Haskell-beginners] Maybe a -> Maybe b<br>
Message-ID:<br>
<<a href="mailto:A2A20EC3B8560D408356CAC2FC148E53BB41B8D4@SUN-DAG3.synchrotron-soleil.fr" target="_blank">A2A20EC3B8560D408356CAC2FC148<wbr>E53BB41B8D4@SUN-DAG3.synchrotr<wbr>on-soleil.fr</a>><br>
<br>
Content-Type: text/plain; charset="us-ascii"<br>
<br>
Hello, I have this<br>
<br>
data Proxy = Proxy String<br>
<br>
And I want to write a function<br>
<br>
f :: Maybe Proxy -> Maybe String<br>
f ma = case ma of<br>
(Just (Proxy a)) -> Just a<br>
Nothing -> Nothing<br>
<br>
I was wondering if there is no simpler way to do this ?<br>
<br>
thanks<br>
<br>
Frederic<br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
______________________________<wbr>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bi<wbr>n/mailman/listinfo/beginners</a><br>
<br>
<br>
------------------------------<br>
<br>
End of Beginners Digest, Vol 110, Issue 20<br>
******************************<wbr>************<br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>