module Use_lists_again: sig
.. end
Provides operations involving lists.
val last : 'a list -> 'a
Returns the last element of a non-empty list.
- The list is assumed to be non-empty
val without_last : 'a list -> 'a list
Returns the given list without its last element.
- The list is assumed to be non-empty
val last_without_last : 'a list -> 'a * 'a list
Returns the pair (last element, list without this element) given a non-empty list.
- The list is assumed to be non-empty
val end_cons_list : 'a * 'a list -> 'a list
Constructs from the given pair (x, lx) the list whose last element is x and
whose rest is lx.
val reverse : 'a list -> 'a list
List reversal.