- Define the test whether a list is empty.
- Define the length of a list.
- Define Fibonacci sequence as a list of n elements.
let rec fibseq n = ...
- Define the sum of all elements from a list.
- Define the sum of squares of all elements from a list.
- Define the collective operation on f-images of all elements from a list.
let rec collective (op:'a -> 'a -> 'b) (f:'c -> 'a) (l:'c list) = ...
- Define the test whether in a list there is an element satisfying given condition
let rec exists (cond:'a -> bool) (l: 'a list) = ...
- Define the test whether all elements of a list satisfy given condition
let rec all (cond:'a -> bool) (l: 'a list) = ...
- Insertion sort.
- Bubble sort.
- Selection sort.
- Merge sort.
- Quick sort.
- Heap sort.