forked from standardml/cmlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ideque.sig
executable file
·28 lines (23 loc) · 865 Bytes
/
ideque.sig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
signature IDEQUE =
sig
type 'a ideque
type idequeNode
val ideque : unit -> 'a ideque
val reset : 'a ideque -> unit
exception Empty
val insertFront : 'a ideque -> 'a -> unit
val insertBack : 'a ideque -> 'a -> unit
val isEmpty : 'a ideque -> bool
val front : 'a ideque -> 'a
val back : 'a ideque -> 'a
val removeFront : 'a ideque -> 'a
val removeBack : 'a ideque -> 'a
(* same as insertFront/insertBack, but returns a node for deletion *)
val insertFrontNode : 'a ideque -> 'a -> idequeNode
val insertBackNode : 'a ideque -> 'a -> idequeNode
(* NB: resetting an ideque does not necessarily mark all its elements as orphans. *)
exception Orphan
val delete : idequeNode -> unit
val dummy : idequeNode
val orphan : idequeNode -> bool
end