commit 5af3de2
shrub
·
2026-11-22 18:55:36 +0000 UTC
parent 01fe90c
move modules to lib
11 files changed,
+16,
-20
+1,
-1
1@@ -1,5 +1,5 @@
2 use <prelude.kav>
3-use "int.kav"
4+use <int.kav>
5
6 fn collatz(n: int) -> int {
7 if n == 1 then 0
+2,
-2
1@@ -1,6 +1,6 @@
2 use <prelude.kav>
3-use "int.kav"
4-use "list.kav" as list
5+use <int.kav>
6+use <list.kav> as list
7
8 fn main() -> int {
9 val l = list::Cons(1, list::Cons(2, list::Cons(3, list::Cons(4, list::Nil))))
+0,
-4
1@@ -1,4 +0,0 @@
2-pub typedef i64 = int
3-
4-pub sortdef nat = [n: int | n >= 0]
5-pub sortdef pos = [n: int | n >= 1]
+1,
-1
1@@ -1,5 +1,5 @@
2 use <prelude.kav>
3-use "list.kav" as list
4+use <list.kav> as list
5
6 pub fn main() -> int {
7 val l: list::List[int, 3] = list::Cons(1, list::Cons(2, list::Cons(3, list::Nil)))
R examples/bool.kav =>
lib/bool.kav
+0,
-0
R examples/fun.kav =>
lib/fun.kav
+0,
-0
R examples/int.kav =>
lib/int.kav
+0,
-0
R examples/list.kav =>
lib/list.kav
+6,
-6
1@@ -1,9 +1,9 @@
2-use "prelude.kav"
3-use "bool.kav" as bool
4-use "pair.kav" as pair
5-use "maybe.kav" as maybe
6-use "int.kav" as int
7-use "fun.kav" as fun
8+use <prelude.kav>
9+use <bool.kav> as bool
10+use <pair.kav> as pair
11+use <maybe.kav> as maybe
12+use <int.kav> as int
13+use <fun.kav> as fun
14
15 /%
16 A linear, length-indexed list.
R examples/maybe.kav =>
lib/maybe.kav
+2,
-2
1@@ -1,5 +1,5 @@
2-use "prelude.kav"
3-use "fun.kav" as fun
4+use <prelude.kav>
5+use <fun.kav> as fun
6
7 /%
8 An optional value: either `None`, or `Some(x)` holding a value of type `a`.
R examples/pair.kav =>
lib/pair.kav
+1,
-1
1@@ -1,4 +1,4 @@
2-use "bool.kav" as bool
3+use <bool.kav> as bool
4
5 /%
6 Builds a pair from two values.
R examples/tree.kav =>
lib/tree.kav
+3,
-3
1@@ -1,6 +1,6 @@
2-use "prelude.kav"
3-use "list.kav" as list
4-use "bool.kav" as bool
5+use <prelude.kav>
6+use <list.kav> as list
7+use <bool.kav> as bool
8
9 /%
10 A linear, size-indexed binary tree.