
25 Nov
2017
25 Nov
'17
7:48 a.m.
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 :: * -> *