source: Deliverables/D2.3/8051/src/utilities/option.ml @ 453

Last change on this file since 453 was 453, checked in by ayache, 10 years ago

Import of the Paris's sources.

File size: 360 bytes
Line 
1(* Pasted from Pottier's PP compiler *)
2
3let map f = function
4  | None ->
5      None
6  | Some x ->
7      Some (f x)
8
9let iter f = function
10  | None ->
11      ()
12  | Some x ->
13      f x
14
15let fold f o accu =
16  match o with
17  | None ->
18      accu
19  | Some x ->
20      f x accu
21
22let print printer () = function
23  | None ->
24      ""
25  | Some x ->
26      printer () x
27
Note: See TracBrowser for help on using the repository browser.