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
Ints. I can makeIntContainers with lists, or sets, or anything I want (of kind* -> *) as the underlying data structure. The thing is thatfisn't a type here - it needs to have another type applied to it before it is a type. So:IntContainerneeds 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: