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.  newEmptyMVar return type (Velichko Lefterov)
   2. Re:  newEmptyMVar return type (Velichko Lefterov)
   3. Re:  newEmptyMVar return type (David McBride)


----------------------------------------------------------------------

Message: 1
Date: Tue, 5 Jan 2021 20:22:50 +0200
From: Velichko Lefterov <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: [Haskell-beginners] newEmptyMVar return type
Message-ID:
        <cajuu68v5y0xwyepyvsm6o3qnav4bahacq3xt8tmkc1p7ttb...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hello,
could someone explain me simple how return-type polymorphism works
in the following case:
newEmptyMVar :: IO (MVar a) ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20210105/534a8674/attachment-0001.html>

------------------------------

Message: 2
Date: Wed, 6 Jan 2021 08:37:03 +0200
From: Velichko Lefterov <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] newEmptyMVar return type
Message-ID:
        <CAJuu68v3MDC-MCO_Sd-58YOw_vqgMXvQq45j8Duw4O=_gge...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

OK,
I tried this one:

test:: IO (Maybe a)
test = return Nothing

It looks similar and it seems to work...

On Tue, Jan 5, 2021 at 8:22 PM Velichko Lefterov <
[email protected]> wrote:

> Hello,
> could someone explain me simple how return-type polymorphism works
> in the following case:
> newEmptyMVar :: IO (MVar a) ?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20210106/cfc7ecaa/attachment-0001.html>

------------------------------

Message: 3
Date: Wed, 6 Jan 2021 06:37:52 -0500
From: David McBride <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] newEmptyMVar return type
Message-ID:
        <can+tr41ecoxgwtl4krbkuyvu6nknnt9wfb0zn+i-ydvcn10...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

It means that the function can return an mvar containing any type that you
need. What type it returns depends on what type your program asks for.

On Wed, Jan 6, 2021, 01:37 Velichko Lefterov <[email protected]>
wrote:

> OK,
> I tried this one:
>
> test:: IO (Maybe a)
> test = return Nothing
>
> It looks similar and it seems to work...
>
> On Tue, Jan 5, 2021 at 8:22 PM Velichko Lefterov <
> [email protected]> wrote:
>
>> Hello,
>> could someone explain me simple how return-type polymorphism works
>> in the following case:
>> newEmptyMVar :: IO (MVar a) ?
>>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20210106/74e93078/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 150, Issue 4
*****************************************

Reply via email to