<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Sorry again fo the long break,<br>
<br>
and thanks for explanation.<br>
<br>
Three Questions:<br>
<br>
1.) Because (->) is defined with itself, it is also a Meta Type
Constructor (TYPE == variable Rank Type == a Meta Type ?)<br>
<br>
2.) How do I define a function which takes a 3-Kinded Type:<br>
<br>
let f:: h (g a); f a = a<br>
<br>
where g * -> * and h (*->*)->*, but it did not work as:<br>
<br>
h is deduced to be h * -> *.<br>
<br>
Prelude> let f:: h (g a); f a = a<br>
<br>
<interactive>:42:18: error:<br>
• Couldn't match type ‘h’ with ‘(->) (g a)’<br>
‘h’ is a rigid type variable bound by<br>
the type signature for:<br>
f :: forall (h :: * -> *) (g :: * -> *) a. h (g a)<br>
at <interactive>:42:5-15<br>
Expected type: h (g a)<br>
Actual type: g a -> g a<br>
• The equation(s) for ‘f’ have one argument,<br>
but its type ‘h (g a)’ has none<br>
• Relevant bindings include<br>
f :: h (g a) (bound at <interactive>:42:18)<br>
<br>
What can I do?<br>
<br>
3.)<br>
Is there any tool in Haskel where I can see which function
parameter is bound to the given input, for instance something like
a function showBinds:<br>
<br>
showBinds const (\c -> "s") (\(b,c) -> "c")<br>
Prelude> Param a gets (\c -> "s") <br>
b gets (\(b,c) -> "c")<br>
<br>
This is a simple example, but it gets more complicated with
massive use of autocurrying.<br>
<br>
<br>
<br>
<br>
On 11/25/2017 05:39 PM, Francesco Ariis wrote:<br>
</div>
<blockquote type="cite"
cite="mid:20171125163954.5rlpyxcxxxjmzbyc@x60s.casa">
<pre wrap="">On Sat, Nov 25, 2017 at 04:19:04PM +0100, Marcus Manning wrote:
</pre>
<blockquote type="cite">
<pre wrap="">But why I can call g with Just:
let g :: h a b -> h a b; g a = a
g Just
but Just is a->Maybe a
</pre>
</blockquote>
<pre wrap="">Because (->) is a type constructor itself, just with
convenient infix syntax:
λ> :k (->)
(->) :: TYPE q -> TYPE r -> *
_______________________________________________
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>
</blockquote>
<p><br>
</p>
</body>
</html>