<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<div class="moz-forward-container"><br>
<br>
-------- Forwarded Message --------
<table class="moz-email-headers-table" border="0" cellspacing="0"
cellpadding="0">
<tbody>
<tr>
<th valign="BASELINE" align="RIGHT" nowrap="nowrap">Subject:
</th>
<td>Re: [Haskell-beginners] Multiple letters between ->
-></td>
</tr>
<tr>
<th valign="BASELINE" align="RIGHT" nowrap="nowrap">Date: </th>
<td>Sat, 25 Nov 2017 13:05:25 +0100</td>
</tr>
<tr>
<th valign="BASELINE" align="RIGHT" nowrap="nowrap">From: </th>
<td>Marcus Manning <a class="moz-txt-link-rfc2396E" href="mailto:iconsize@gmail.com"><iconsize@gmail.com></a></td>
</tr>
<tr>
<th valign="BASELINE" align="RIGHT" nowrap="nowrap">To: </th>
<td>Francesco Ariis <a class="moz-txt-link-rfc2396E" href="mailto:fa-ml@ariis.it"><fa-ml@ariis.it></a></td>
</tr>
</tbody>
</table>
<br>
<br>
<pre>Sorry, for the long break.
Thanks for replying.
I do not believe that h is a higher kinded type. What I want to express
is that a function f could take a type constructor as argument and
simply returns it, but
f Maybe
throws an Error
<interactive>:13:3: error:
• Data constructor not in scope: Maybe :: h a
• Perhaps you meant variable ‘maybe’ (imported from Prelude)
So what instead does h a mean in a function declaration?
Cheers,
Marcus.
On 11/23/2017 06:27 PM, Francesco Ariis wrote:
> 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.
> _______________________________________________
> Beginners mailing list
> <a class="moz-txt-link-abbreviated" href="mailto:Beginners@haskell.org">Beginners@haskell.org</a>
> <a class="moz-txt-link-freetext" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a>
</pre>
</div>
</body>
</html>