Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: Maybe a -> Maybe b (PICCA Frederic-Emmanuel)
2. Re: Beginners Digest, Vol 110, Issue 20 (Dmitry Mamontov)
----------------------------------------------------------------------
Message: 1
Date: Fri, 25 Aug 2017 13:06:01 +0000
From: PICCA Frederic-Emmanuel
<[email protected]>
To: "The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell" <[email protected]>
Subject: Re: [Haskell-beginners] Maybe a -> Maybe b
Message-ID:
<a2a20ec3b8560d408356cac2fc148e53bb41b...@sun-dag3.synchrotron-soleil.fr>
Content-Type: text/plain; charset="utf-8"
data Proxy a = Proxy a
exProxy::Functor f =>
f (Proxy a) -> f a
exProxy = (un1 <$>)
where un1 (Proxy a1) = a1
nice :)
------------------------------
Message: 2
Date: Fri, 25 Aug 2017 16:06:16 +0300
From: Dmitry Mamontov <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Beginners Digest, Vol 110, Issue 20
Message-ID:
<campq2dxsc9bkxhmyp1ot-60iaoomwahy8-gqvvczosgwecc...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hello,
Maybe, using fmap would be enough?
data Proxy = Proxy String
f :: Maybe Proxy -> Maybe String
f = fmap (\(Proxy a) -> a)
2017-08-25 15:00 GMT+03:00 <[email protected]>:
> Send Beginners mailing list submissions to
> [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> or, via email, send a message with subject or body 'help' to
> [email protected]
>
> You can reach the person managing the list at
> [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Beginners digest..."
>
>
> Today's Topics:
>
> 1. Maybe a -> Maybe b (PICCA Frederic-Emmanuel)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 25 Aug 2017 08:05:34 +0000
> From: PICCA Frederic-Emmanuel
> <[email protected]>
> To: "[email protected]" <[email protected]>
> Subject: [Haskell-beginners] Maybe a -> Maybe b
> Message-ID:
> <A2A20EC3B8560D408356CAC2FC148E53BB41B8D4@SUN-DAG3.
> synchrotron-soleil.fr>
>
> Content-Type: text/plain; charset="us-ascii"
>
> 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
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
> ------------------------------
>
> End of Beginners Digest, Vol 110, Issue 20
> ******************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20170825/719e5eab/attachment-0001.html>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 110, Issue 22
******************************************