;into Hope. Hope responds with
>> nil : list alpha
nilis another word for the empty list. Its type is
list alpha. Here
alphameans any type. It could be a list of integers or a list of bools or a list of anything else.
There is a special operator on lists called `cons' written
>: 1::;Hope responds with
>> [1, 2] : list num
>: 1::[1,1,1,1];Hope responds with
>> [1, 1, 1, 1, 1] : list num
>: true::[false,true];Hope responds with
>> [true, false, true] : list bool;
So cons takes an element and list and makes a new list who head is the element and who tail is the list. i.e.
head: list alpha -> alpha; head (x::m) <= x; tail: list alpha -> list alpha; tail (x::m) <= m;