5.5 Module list: lists
Interface to the Ocaml library module List
open ml
external cons : <'a * 'a list> -> <'a list>
external nil : 'a list
external consp : <'a list> -> <bool>
external length : < 'a list > -> < int>
external hd : < 'a list > -> < 'a>
external tl : < 'a list > -> < 'a list>
external nth : < 'a list * int > -> < 'a>
external rev : < 'a list > -> < 'a list>
external append : < 'a list * 'a list> -> < 'a list>
external flatten : < 'a list list > -> < 'a list>
external iter : < ('a,unit) fun * 'a list > -> <>
external map : < ('a,'b) fun * 'a list > -> < 'b list>
external fold_left : < ('a,('b,'a)fun) fun * 'a * 'b list > -> < 'a>
external fold_right : <('a,('b,'b) fun) fun * 'a list * 'b > -> < 'b>
external mem : < 'a * 'a list > -> < bool>
external memq : < 'a * 'a list > -> < bool>
external assoc : < 'a * ('a,'b) pair list > -> < 'b>
external mem_assoc : < 'a * ('a,'b) pair list > -> < bool>
external split : < ('a,'b) pair list > -> < 'a list * 'b list>
external combine : < 'a list * 'b list > -> < ('a,'b) pair list>