[Haskell-beginners] Fwd: Re: Multiple letters between -> ->

Francesco Ariis fa-ml at ariis.it
Thu Nov 30 11:49:10 UTC 2017


Hello Marcus,

On Thu, Nov 30, 2017 at 12:37:12PM +0100, Marcus Manning wrote:
> 2.) How do I define a function which takes a 3-Kinded Type:
> 
> let f:: h (g a); f a = a
> 
> where g * -> * and h (*->*)->*, but it did not work as:
> 
> h is deduced to be h * -> *.

h hasn't got kind * -> * -> *, as Maybe hasn't got kind * -> * -> *
but * -> *. A simple type constructor like the one you are searching
for is Either

    λ> :k Either
    Either :: * -> * -> *

or a tuple

    λ> :k (,)
    (,) :: * -> * -> *



More information about the Beginners mailing list