I understand the following kinds:
String :: *
[] :: * -> *
(->) :: * -> * -> *
(,) :: * -> * -> *
But what does this kind mean and what type might it represent?
? :: (* -> *) -> *
I understand the following kinds:
String :: *
[] :: * -> *
(->) :: * -> * -> *
(,) :: * -> * -> *
But what does this kind mean and what type might it represent?
? :: (* -> *) -> *
Copyright © 2021 Jogjafile Inc.
? :: (* -> *) -> *
means that if you give to?
something of kind* -> *
, you'll get back a type (something of kind*
). Let's take a concrete example:This is meant to contain
Int
s. I can makeIntContainer
s with lists, or sets, or anything I want (of kind* -> *
) as the underlying data structure. The thing is thatf
isn't a type here - it needs to have another type applied to it before it is a type. So:IntContainer
needs to have something applied to it, which in turn needs a type applied to it.I can make concrete types by applying things of kind
* -> *
toIntContainer
: