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. Multiple letters between -> -> (Marcus Manning)
2. Re: Multiple letters between -> -> (Francesco Ariis)
----------------------------------------------------------------------
Message: 1
Date: Thu, 23 Nov 2017 18:19:51 +0100
From: Marcus Manning <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: [Haskell-beginners] Multiple letters between -> ->
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed
Hi,
Original I thought a Signature like:
f :: h a -> h a
means that h is a higher kinded type just like in Type Classes ( for
instance f in Functor f).
But I heard such a meaning is not allowed in normal Haskell functions.
What instead is the meaning of h a?
Cheers,
Marcus.
------------------------------
Message: 2
Date: Thu, 23 Nov 2017 18:27:15 +0100
From: Francesco Ariis <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Multiple letters between -> ->
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
On Thu, Nov 23, 2017 at 06:19:51PM +0100, Marcus Manning wrote:
> Hi,
>
> Original I thought a Signature like:
>
> f :: h a -> h a
>
> means that h is a higher kinded type just like in Type Classes ( for
> instance f in Functor f).
>
> But I heard such a meaning is not allowed in normal Haskell functions. What
> instead is the meaning of h a?
Hello Marcus,
you can write that but, since we know nothing about `h` and `a`,
the only possible (non-undefined) function to implement that
signature is:
f :: h a -> h a
f = id
Any other implementation would require us to know something about h,
hence a typeclass-constraint (e.g. Functor h =>) on h.
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 113, Issue 21
******************************************