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

Marcus Manning iconsize at gmail.com
Sat Nov 25 14:03:26 UTC 2017


Ok,

but what is h in:

f :: h a -> ...

is "h" a data constructor or a type constructor or a normal function? 
What is j in

f:: j k l -> ...

and hwat is the difference between j and h?

On 11/25/2017 01:48 PM, Francesco Ariis wrote:
> On Sat, Nov 25, 2017 at 01:06:03PM +0100, Marcus Manning wrote:
>> 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
> Hello Marcus,
>      you cannot pass type constructors (Maybe) to functions! Only *data*
> constructors (Just, Nothing).
> Hence the reason why the compiler complains, there is no *data* constructor
> named `Maybe`. Even in ghci, to inspect type constructors, we use a
> different command
>
>      λ> :type Maybe
>
>      <interactive>:1:1: error:
>          • Data constructor not in scope: Maybe
>          • Perhaps you meant variable ‘maybe’ (imported from Prelude)
>      λ> :kind Maybe
>      Maybe :: * -> *
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners




More information about the Beginners mailing list