In Haskell the trivial type is written as ()
and has kind ∗. The list type is written as []
and has kind ∗→∗, which means that it is sort of a 'metafunction' from type to type. Applying []
(kind ∗→∗) to Int
(kind ∗) gives [] Int
i.e. [Int]
(kind ∗). The function type is written as (->)
and has kind ∗→∗→∗ i.e. ∗→(∗→∗) which means it's a sort of metafunction from type to a function from type to type. Applying (->)
(kind ∗→∗→∗) to Int
(kind ∗) gives (->) Int
(kind ∗→∗), and applying that to Float
(kind ∗) gives (->) Int Float
i.e. Int -> Float
(kind ∗).
In Alvin the trivial type is written as Trivial
. The list type is written as List
. It is a template, taking a type and 'returning' a type. Applying List
to Int
gives List::value<Int>
. The function type is written as Function
. (->) Int
is written as Function::value<Int>
and Int -> Float
is written as Function::value<Int>::value<Float>
.
Haskell:
1
is a value of typeInt
.1.0
is a value of typ