<div dir="ltr"><div>I don't know if this is helpful, but I've abbreviated and elaborated on what Francesco said.</div><div><br></div><div>> Original I thought a Signature like:</div><div>> </div><div>> f :: h a -> h a</div><div>> </div><div>> means that h is a higher kinded type just like in Type Classes ( for instance f in Functor f).</div><div>> </div><div>> But I heard such a meaning is not allowed in normal Haskell functions. What instead is the meaning of h a?</div><div><br></div><div>Let's take a concrete example:</div><div><br></div><div>Prelude> let f = fmap id</div><div>Prelude> :t f</div><div>f :: Functor f => f b -> f b</div><div>Prelude> </div><div><br></div><div>The (->) symbol goes between types (it takes one type to another), so f b must be a type, and therefore f is a type constructor.</div><div><br></div><div>> f Maybe</div><div>> </div><div>> throws an Error</div><div><br></div><div>Maybe is a type constructor, not a value constructor. Functions in Haskell can only take types. Value constructors are types; type constructors are not.</div><div><br></div><div>> but what is h in:</div><div>> </div><div>> f :: h a -> ...</div><div>> </div><div>> is "h" a data constructor or a type constructor or a normal function? What is j in</div><div>> </div><div>> f:: j k l -> ...</div><div>> </div><div>> and hwat is the difference between j and h?</div><div><br></div><div>h and j in those examples are both type constructors. One of them takes two arguments, the other only takes one.</div><div><br></div><div>> But why I can call g with Just:</div><div>> </div><div>> </div><div>> let g :: h a b -> h a b; g a = a</div><div>> </div><div>> g Just</div><div>> </div><div>> but Just is a->Maybe a</div><div><br></div><div>Just has type "(->) a (Maybe a)", a.k.a. type "a -> Maybe a". (->) is a two-argument type constructor.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 25, 2017 at 8:39 AM, Francesco Ariis <span dir="ltr"><<a href="mailto:fa-ml@ariis.it" target="_blank">fa-ml@ariis.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sat, Nov 25, 2017 at 04:19:04PM +0100, Marcus Manning wrote:<br>
> But why I can call g with Just:<br>
><br>
><br>
> let g :: h a b -> h a b; g a = a<br>
><br>
> g Just<br>
><br>
> but Just is a->Maybe a<br>
<br>
</span>Because (->) is a type constructor itself, just with<br>
convenient infix syntax:<br>
<br>
λ> :k (->)<br>
(->) :: TYPE q -> TYPE r -> *<br>
<div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/beginners</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Jeff Brown | Jeffrey Benjamin Brown</div><div dir="ltr"><a href="https://msu.edu/~brown202/" style="font-size:12.8px" target="_blank">Website</a> | <a href="https://www.facebook.com/mejeff.younotjeff" style="font-size:12.8px" target="_blank">Facebook</a> | <a href="https://www.linkedin.com/in/jeffreybenjaminbrown" style="font-size:12.8px" target="_blank">LinkedIn</a><span style="font-size:12.8px">(spammy, so I often miss messages here) </span><span style="font-size:12.8px">|</span><span style="font-size:12.8px"> </span><a href="https://github.com/jeffreybenjaminbrown" style="font-size:12.8px" target="_blank">Github</a><span style="font-size:12.8px"> </span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>