(* Zipper pour les listes *) type 'a zipper = { left: 'a list; right: 'a list; } (* ... Programme 73 page 308 ... *) let move_left z = match z.left with [] -> invalid_arg "move_left" x :: l -> { left = l; right = x :: z.right } (* variante de to_list, en utilisant move_left *) let rec to_list z = if z.left = [] then z.right else to_list (move_left z)
This document was generated using caml2html