Skip to content
This repository
Newer
Older
100644 41 lines (29 sloc) 0.832 kb
8634b74a » pad
2010-09-22 initial import into fresh git repo.
1 (*s: ocollection.mli *)
2 type ('a, 'b) view =
3 | Empty
4 | Cons of 'a * 'b
5
6 class virtual ['a] ocollection :
7 object ('o)
8 inherit Objet.objet
9
10 method virtual empty : 'o
11 method virtual add : 'a -> 'o
12
13 method virtual iter : ('a -> unit) -> unit
14 method virtual view : ('a, 'o) view
15
16 (* no need virtual, but better to force redefine for efficiency *)
17 method virtual del : 'a -> 'o
18 method virtual mem : 'a -> bool
19 method virtual null : bool
20
21 (* effect version *)
22 method add2: 'a -> unit
23 method del2: 'a -> unit
24 method clear: unit
25
26
27 method fold : ('c -> 'a -> 'c) -> 'c -> 'c
28
29 method fromlist : 'a list -> 'o
30 method tolist : 'a list
31
32 method exists : ('a -> bool) -> bool
33 method filter : ('a -> bool) -> 'o
34
35 method length : int
36
37 method getone : 'a
38 method others : 'o
39 end
40
41 (*e: ocollection.mli *)
Something went wrong with that request. Please try again.