package ocplib_stuff

  1. Overview
  2. Docs

Module EzListSource

Extension of the stdlib List module

Sourceval last : 'a list -> 'a

last l returns the last elements of l. Raise Not_found if l is empty

Sourceval take : int -> 'a list -> 'a list

take n l returns the n first elements of l

Sourceval drop : int -> 'a list -> 'a list

drop n l drops the n first elements of l

Sourceval make : int -> 'a -> 'a list

make n x returns a list of n times the element x

Sourceval tail_map : ('a -> 'b) -> 'a list -> 'b list

Same as List.map but tail recursive

Sourceval remove : 'a -> 'a list -> 'a list

remove x l removes all the elements structuraly equal to x in list l

Sourceval removeq : 'a -> 'a list -> 'a list

removeq x l removes all the elements physically equal to x in list l

OCaml

Innovation. Community. Security.