Multiple letters between -> ->

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.

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.
participants (2)
-
Francesco Ariis
-
Marcus Manning