diff options
| author | Charles.Forsyth <devnull@localhost> | 2007-02-17 17:53:48 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2007-02-17 17:53:48 +0000 |
| commit | 2249108ae3e3c5d02e45007e195672e350517856 (patch) | |
| tree | 3da5b86485276c26726c55e23da718686986f61a /module/lists.m | |
| parent | 463f3a975e935d078a7c3479e0a56afb06f10fb5 (diff) | |
fix issue 9, add preliminary lists module
Diffstat (limited to 'module/lists.m')
| -rw-r--r-- | module/lists.m | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/module/lists.m b/module/lists.m new file mode 100644 index 00000000..242c9bf6 --- /dev/null +++ b/module/lists.m @@ -0,0 +1,24 @@ +Lists: module +{ + map: fn[T](f: ref fn(x: T): T, l: list of T): list of T; + allsat: fn[T](p: ref fn(x: T): int, l: list of T): int; + anysat: fn[T](p: ref fn(x: T): int, l: list of T): int; + filter: fn[T](p: ref fn(x: T): int, l: list of T): list of T; + partition: fn[T](p: ref fn(x: T): int, l: list of T): (list of T, list of T); + + append: fn[T](l: list of T, x: T): list of T; + concat: fn[T](l: list of T, l2: list of T): list of T; + combine: fn[T](l: list of T, l2: list of T): list of T; + reverse: fn[T](l: list of T): list of T; + last: fn[T](l: list of T): T; + delete: fn[T](x: T, l: list of T): list of T + for { T => eq: fn(a, b: T): int; }; + pair: fn[T1, T2](l1: list of T1, l2: list of T2): list of (T1, T2); + unpair: fn[T1, T2](l: list of (T1, T2)): (list of T1, list of T2); + ismember: fn[T](x: T, l: list of T): int + for { T => eq: fn(a, b: T): int; }; +}; + +#sort? +#join +#split |
