diff options
| author | bhgv <bhgv.empire@gmail.com> | 2018-03-01 16:54:45 +0200 |
|---|---|---|
| committer | bhgv <bhgv.empire@gmail.com> | 2018-03-01 16:54:45 +0200 |
| commit | b786f20bbab5a59046aa78a2c6c2a11536497202 (patch) | |
| tree | 0851ecdec889eb9b7ba3751cc04d4f0b474e4a9e /module/lists.m | |
inferno-os tree was separated from the inferno-os-android (separated from the Android driver)
Diffstat (limited to 'module/lists.m')
| -rw-r--r-- | module/lists.m | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/module/lists.m b/module/lists.m new file mode 100644 index 0000000..fb6f83a --- /dev/null +++ b/module/lists.m @@ -0,0 +1,27 @@ +Lists: module +{ + PATH: con "/dis/lib/lists.dis"; + 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; + find: fn[T](x: T, l: list of T): list of T + for { T => eq: fn(a, b: T): int; }; + 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 |
