-
Notifications
You must be signed in to change notification settings - Fork 4
/
list.sig
executable file
·28 lines (20 loc) · 945 Bytes
/
list.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
(*======================================================================
An implementation of finite-capacity linked lists whose elements drop from
one end as more elements are inserted (to make room for the new additions).
This is not a significant piece of functionality (it's only used to populate
the contents of the call stack, for debugging purposes).
=======================================================================*)
signature LIST =
sig
type element
type drop_list
val prepend: element * drop_list -> unit
val makeList: element * int -> drop_list
val assign: drop_list * drop_list -> unit
val firstPart: drop_list -> element list
val firstPartFilled: drop_list -> bool
val setCapacity: int -> unit
val toList: drop_list * {with_first_part:bool} -> element list
val map: (element -> element) * drop_list * {with_first_part:bool} -> element list
val listLength: drop_list -> int
end