source:
Deliverables/D2.2/8051/src/utilities/option.ml
@
640
Last change on this file since 640 was 486, checked in by , 10 years ago | |
---|---|
File size: 360 bytes |
Line | |
---|---|
1 | (* Pasted from Pottier's PP compiler *) |
2 | |
3 | let map f = function |
4 | | None -> |
5 | None |
6 | | Some x -> |
7 | Some (f x) |
8 | |
9 | let iter f = function |
10 | | None -> |
11 | () |
12 | | Some x -> |
13 | f x |
14 | |
15 | let fold f o accu = |
16 | match o with |
17 | | None -> |
18 | accu |
19 | | Some x -> |
20 | f x accu |
21 | |
22 | let print printer () = function |
23 | | None -> |
24 | "" |
25 | | Some x -> |
26 | printer () x |
27 |
Note: See TracBrowser
for help on using the repository browser.