iter rpe.1: retire per-type print effect-ops

Single iter shipping the post-milestone-24 follow-up named in
docs/specs/2026-05-14-retire-per-type-print-effects.md. After this
iter the only surviving direct-output effect-op is `io/print_str`;
all per-type print primitives are replaced by the polymorphic
`print` helper (prelude, iter 24.3).

Components:
- 92 examples/*.ail fixtures migrated (do io/print_<T> x) →
  (app print x); 6 .prose.txt snapshots regenerated via `ail prose`.
- Four-site lockstep compiler deletion: crates/ailang-check/src/builtins.rs
  (3 effect_ops.insert blocks + 3 list() rows + the
  install_io_print_float_signature test + module + EffectOpSig
  doc-comments); crates/ailang-codegen/src/lib.rs lower_app
  (3 arms + lowers_io_print_float test); crates/ailang-codegen/src/synth.rs
  builtin_effect_op_ret match-arm pattern. Dead `intern_string`
  helper removed as a follow-up.
- Five incidental test-body migrations (ailang-check x2, ailang-core
  spec_drift + design_schema_drift, ailang-surface/src/lex.rs,
  ailang-prose/src/lib.rs round-trip test).
- Cat B test-harness patch: six IR-shape tests in
  crates/ail/tests/e2e.rs gained a monomorphise_workspace call
  before lower_workspace_with_alloc so they follow the same
  pipeline as `ail build` (the home-rolled desugar+lift loop
  stayed because mono's precondition is "already lifted"; mono
  inserts after lift).
- Six doc-comment touch-ups (lex.rs module doc, parse.rs
  diagnostic example, ail/src/main.rs x2, runtime/str.c %g anchor,
  crates/ailang-core/specs/form_a.md surface-spec example).
- DESIGN.md seven-site sweep (Decision 11 example, Polymorphic
  print past-tense, Heap-Str output sentence, effect-op
  invocation comment, Float NaN paragraph re-anchored on
  float_to_str, two "What is supported" lists).
- Three E2E test-comment polish + four IR-snapshot refresh + one
  canonical-hash pin update (plan-unanticipated downstream
  consequences of the corpus migration).
- bench/{check,compile_check,cross_lang}.py: all exit 0; no
  ratification needed.
- Roadmap entry struck through; per-iter journal at
  docs/journals/2026-05-14-iter-rpe.1.md.

Tests 564/0/3. cargo clippy and cargo doc: zero warnings.

Two upstream codegen bugs surfaced during the first BLOCKED
attempt and were fixed in separate iters before this retry:
- 1fb225e bugfix: mono cursor misalignment at poly-free-fn Var
  with class-constrained Forall.
- feb9413 bugfix: print leak — propagate ret_mode through rigid
  substitution + prelude Show.show ret_mode.

Known debt (carried forward for next /audit):
- Emitter.strings field is functionally dead post-iter (orphan
  after intern_string removal); cycles over empty map harmlessly.
This commit is contained in:
2026-05-14 02:12:34 +02:00
parent 8b455bee4c
commit 6fdb45d2f2
123 changed files with 704 additions and 490 deletions
+3 -3
View File
@@ -63,6 +63,6 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(seq (do io/print_int (app run 10000))
(seq (do io/print_int (app run 100000))
(do io/print_int (app run 500000)))))))
(seq (app print (app run 10000))
(seq (app print (app run 100000))
(app print (app run 500000)))))))
+1 -1
View File
@@ -54,7 +54,7 @@
(fn run_one
(type (fn-type (params (con Int)) (ret (con Unit)) (effects IO)))
(params n)
(body (do io/print_int (app sum_steps_loop n 0))))
(body (app print (app sum_steps_loop n 0))))
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
+1 -1
View File
@@ -37,7 +37,7 @@
(fn run_one
(type (fn-type (params (con Int)) (ret (con Unit)) (effects IO)))
(params n)
(body (do io/print_int (app intsum_loop n 0))))
(body (app print (app intsum_loop n 0))))
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
+1 -1
View File
@@ -73,7 +73,7 @@
(type (fn-type (params (con Int)) (ret (con Unit)) (effects IO)))
(params n)
(body
(do io/print_int
(app print
(app fold_with_fn inc
(app build_n n (term-ctor List Nil))
0))))
+3 -3
View File
@@ -139,10 +139,10 @@
(params remaining print_countdown chunk_len print_k t)
(body
(if (app == remaining 0)
(do io/print_int 9999)
(app print 9999)
(if (app == print_countdown 0)
(seq
(do io/print_int (app one_op chunk_len t))
(app print (app one_op chunk_len t))
(tail-app loop
(app - remaining 1)
(app - print_k 1)
@@ -165,5 +165,5 @@
(let t (app build_tree 19)
(let _root (app pin_root t)
(seq
(do io/print_int 8888)
(app print 8888)
(app loop 20000 0 500 20 t)))))))
+3 -3
View File
@@ -195,10 +195,10 @@
(params remaining print_countdown chunk_len print_k t)
(body
(if (app == remaining 0)
(do io/print_int 9999)
(app print 9999)
(if (app == print_countdown 0)
(seq
(do io/print_int (app one_op chunk_len t))
(app print (app one_op chunk_len t))
(tail-app loop
(app - remaining 1)
(app - print_k 1)
@@ -221,5 +221,5 @@
(let t (app build_tree 19)
(let _root (app pin_root t)
(seq
(do io/print_int 8888)
(app print 8888)
(app loop 20000 0 500 20 t)))))))
+1 -1
View File
@@ -88,7 +88,7 @@
(type (fn-type (params (con Int)) (ret (con Unit)) (effects IO)))
(params n)
(body
(do io/print_int (app sum_list (app cons_n n)))))
(app print (app sum_list (app cons_n n)))))
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
+1 -1
View File
@@ -31,7 +31,7 @@ fn sum_list(xs: IntList) -> Int {
/// Build a list of length n, sum it, print the sum.
fn run_one(n: Int) -> Unit with IO {
do io/print_int(sum_list(cons_n(n)))
print(sum_list(cons_n(n)))
}
fn main() -> Unit with IO {
+1 -1
View File
@@ -83,7 +83,7 @@
(type (fn-type (params (con Int)) (ret (con Unit)) (effects IO)))
(params n)
(body
(do io/print_int (app sum_list (app cons_n n)))))
(app print (app sum_list (app cons_n n)))))
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
+1 -1
View File
@@ -20,4 +20,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (app loop_call 100000000 0)))))
(body (app print (app loop_call 100000000 0)))))
+1 -1
View File
@@ -67,7 +67,7 @@
(type (fn-type (params (con Int)) (ret (con Unit)) (effects IO)))
(params depth)
(body
(do io/print_int (app sum_tree (app build_tree depth)))))
(app print (app sum_tree (app build_tree depth)))))
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
+3 -3
View File
@@ -12,7 +12,7 @@
; (borrow (con List)) — list_length's xs parameter
; (own (con List)) — sum_list's xs parameter
;
; Expected stdout (one int per line, via io/print_int + a newline):
; Expected stdout (one int per line, via polymorphic `print` + a newline):
; 3
; 6
@@ -60,5 +60,5 @@
(term-ctor List Cons 3
(term-ctor List Nil))))
(seq
(do io/print_int (app list_length xs))
(do io/print_int (app sum_list xs)))))))
(app print (app list_length xs))
(app print (app sum_list xs)))))))
+1 -1
View File
@@ -31,6 +31,6 @@
(effects IO)))
(params)
(body
(do io/print_int
(app print
(app unbox
(term-ctor Box MkBox 42))))))
+1 -1
View File
@@ -23,4 +23,4 @@
(params)
(body
(let x 42
(do io/print_int (clone x))))))
(app print (clone x))))))
+1 -1
View File
@@ -8,4 +8,4 @@
(doc "captures `n` from the enclosing let, returns 42")
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (let n 3 (do io/print_int (app apply (lam (params (typed x (con Int))) (ret (con Int)) (body (app + x n))) 39))))))
(body (let n 3 (app print (app apply (lam (params (typed x (con Int))) (ret (con Int)) (body (app + x n))) 39))))))
+1 -1
View File
@@ -8,4 +8,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (app cmp_max 3 7)))))
(body (app print (app cmp_max 3 7)))))
+9 -9
View File
@@ -2,31 +2,31 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (seq (do io/print_int (match (app compare 1 2)
(body (seq (app print (match (app compare 1 2)
(case (pat-ctor LT) 1)
(case (pat-ctor EQ) 2)
(case (pat-ctor GT) 3))) (seq (do io/print_int (match (app compare 1 1)
(case (pat-ctor GT) 3))) (seq (app print (match (app compare 1 1)
(case (pat-ctor LT) 1)
(case (pat-ctor EQ) 2)
(case (pat-ctor GT) 3))) (seq (do io/print_int (match (app compare 2 1)
(case (pat-ctor GT) 3))) (seq (app print (match (app compare 2 1)
(case (pat-ctor LT) 1)
(case (pat-ctor EQ) 2)
(case (pat-ctor GT) 3))) (seq (do io/print_int (match (app compare false true)
(case (pat-ctor GT) 3))) (seq (app print (match (app compare false true)
(case (pat-ctor LT) 1)
(case (pat-ctor EQ) 2)
(case (pat-ctor GT) 3))) (seq (do io/print_int (match (app compare false false)
(case (pat-ctor GT) 3))) (seq (app print (match (app compare false false)
(case (pat-ctor LT) 1)
(case (pat-ctor EQ) 2)
(case (pat-ctor GT) 3))) (seq (do io/print_int (match (app compare true false)
(case (pat-ctor GT) 3))) (seq (app print (match (app compare true false)
(case (pat-ctor LT) 1)
(case (pat-ctor EQ) 2)
(case (pat-ctor GT) 3))) (seq (do io/print_int (match (app compare "a" "b")
(case (pat-ctor GT) 3))) (seq (app print (match (app compare "a" "b")
(case (pat-ctor LT) 1)
(case (pat-ctor EQ) 2)
(case (pat-ctor GT) 3))) (seq (do io/print_int (match (app compare "a" "a")
(case (pat-ctor GT) 3))) (seq (app print (match (app compare "a" "a")
(case (pat-ctor LT) 1)
(case (pat-ctor EQ) 2)
(case (pat-ctor GT) 3))) (do io/print_int (match (app compare "b" "a")
(case (pat-ctor GT) 3))) (app print (match (app compare "b" "a")
(case (pat-ctor LT) 1)
(case (pat-ctor EQ) 2)
(case (pat-ctor GT) 3))))))))))))))
+1 -1
View File
@@ -39,7 +39,7 @@
(match xs
(case (pat-ctor INil) (lit-unit))
(case (pat-ctor ICons h t)
(seq (do io/print_int (app signum h))
(seq (app print (app signum h))
(tail-app drain t))))))
(fn main
+1 -1
View File
@@ -28,4 +28,4 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(do io/print_int (app std_maybe.from_maybe 99 (app classify (term-ctor std_maybe.Maybe Just 7)))))))
(app print (app std_maybe.from_maybe 99 (app classify (term-ctor std_maybe.Maybe Just 7)))))))
+11 -11
View File
@@ -25,7 +25,7 @@
; 2 ; classify_str "ho" (lit-pattern hits 2 arm)
; 0 ; classify_str "??" (default arm)
;
; Driver lowers via io/print_bool / io/print_int.
; Driver routes through the polymorphic `print` helper (Show Bool / Show Int).
(module eq_demo
@@ -44,13 +44,13 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(seq (do io/print_bool (app == 5 5))
(seq (do io/print_bool (app == 5 6))
(seq (do io/print_bool (app == true false))
(seq (do io/print_bool (app == true true))
(seq (do io/print_bool (app == "hi" "hi"))
(seq (do io/print_bool (app == "hi" "ho"))
(seq (do io/print_bool (app == (lit-unit) (lit-unit)))
(seq (do io/print_int (app classify_str "hi"))
(seq (do io/print_int (app classify_str "ho"))
(do io/print_int (app classify_str "??"))))))))))))))
(seq (app print (app == 5 5))
(seq (app print (app == 5 6))
(seq (app print (app == true false))
(seq (app print (app == true true))
(seq (app print (app == "hi" "hi"))
(seq (app print (app == "hi" "ho"))
(seq (app print (app == (lit-unit) (lit-unit)))
(seq (app print (app classify_str "hi"))
(seq (app print (app classify_str "ho"))
(app print (app classify_str "??"))))))))))))))
+1 -1
View File
@@ -2,4 +2,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (if (app eq 1.0 2.0) 1 0)))))
(body (app print (if (app eq 1.0 2.0) 1 0)))))
+1 -1
View File
@@ -7,4 +7,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (seq (do io/print_int (if (app at_most 3 5) 1 0)) (seq (do io/print_int (if (app at_most true false) 1 0)) (do io/print_int (if (app at_most "abc" "abd") 1 0)))))))
(body (seq (app print (if (app at_most 3 5) 1 0)) (seq (app print (if (app at_most true false) 1 0)) (app print (if (app at_most "abc" "abd") 1 0)))))))
+1 -1
View File
@@ -21,4 +21,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (seq (do io/print_int (if (app eq (term-ctor IntBox MkIntBox 3) (term-ctor IntBox MkIntBox 3)) 1 0)) (do io/print_int (if (app eq (term-ctor IntBox MkIntBox 3) (term-ctor IntBox MkIntBox 5)) 1 0))))))
(body (seq (app print (if (app eq (term-ctor IntBox MkIntBox 3) (term-ctor IntBox MkIntBox 3)) 1 0)) (app print (if (app eq (term-ctor IntBox MkIntBox 3) (term-ctor IntBox MkIntBox 5)) 1 0))))))
+1 -1
View File
@@ -7,4 +7,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (seq (do io/print_int (app to_int (app eq 7 7))) (seq (do io/print_int (app to_int (app eq 7 8))) (seq (do io/print_int (app to_int (app eq true true))) (seq (do io/print_int (app to_int (app eq true false))) (seq (do io/print_int (app to_int (app eq "hello" "hello"))) (do io/print_int (app to_int (app eq "hello" "world")))))))))))
(body (seq (app print (app to_int (app eq 7 7))) (seq (app print (app to_int (app eq 7 8))) (seq (app print (app to_int (app eq true true))) (seq (app print (app to_int (app eq true false))) (seq (app print (app to_int (app eq "hello" "hello"))) (app print (app to_int (app eq "hello" "world")))))))))))
+4 -4
View File
@@ -51,7 +51,7 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(seq (do io/print_int (app peek 0))
(seq (do io/print_int (app peek 123))
(seq (do io/print_int (app count 5))
(do io/print_int (app count 0))))))))
(seq (app print (app peek 0))
(seq (app print (app peek 123))
(seq (app print (app count 5))
(app print (app count 0))))))))
+2 -2
View File
@@ -6,7 +6,7 @@
; sqrt(2.0). Expected stdout (one line): approximately 1.41421356...
;
; Exercises: Float literals, polymorphic +, *, /, recursion with
; Float-typed accumulator, io/print_float.
; Float-typed accumulator, polymorphic `print` (Show Float).
(module floats_1_newton_sqrt
@@ -35,4 +35,4 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(do io/print_float (app sqrt 2.0)))))
(app print (app sqrt 2.0)))))
@@ -57,7 +57,7 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(do io/print_float
(app print
(app mean
(term-ctor IntList Cons 1
(term-ctor IntList Cons 2
@@ -26,7 +26,7 @@
; nan ; 0/0
; -1 ; classify(0/0) -> NaN
;
; (`io/print_float` prints "%g\n", so inf prints as "inf", NaN as "nan".)
; (`print` for Float routes through `float_to_str`, which uses "%g", so inf prints as "inf", NaN as "nan".)
(module floats_3_safe_division
@@ -47,9 +47,9 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(seq (do io/print_float (app / 6.0 3.0))
(seq (do io/print_int (app classify (app / 6.0 3.0)))
(seq (do io/print_float (app / 1.0 0.0))
(seq (do io/print_int (app classify (app / 1.0 0.0)))
(seq (do io/print_float (app / 0.0 0.0))
(do io/print_int (app classify (app / 0.0 0.0)))))))))))
(seq (app print (app / 6.0 3.0))
(seq (app print (app classify (app / 6.0 3.0)))
(seq (app print (app / 1.0 0.0))
(seq (app print (app classify (app / 1.0 0.0)))
(seq (app print (app / 0.0 0.0))
(app print (app classify (app / 0.0 0.0)))))))))))
+2 -2
View File
@@ -26,5 +26,5 @@
(params)
(body
(seq
(do io/print_int (app fact 5))
(do io/print_int (app fact 10))))))
(app print (app fact 5))
(app print (app fact 10))))))
+3 -3
View File
@@ -8,6 +8,6 @@
(body
(seq
(seq
(do io/print_int (app forma_4_intmath_lib.square 7))
(do io/print_int (app forma_4_intmath_lib.cube 3)))
(do io/print_int (app forma_4_intmath_lib.abs_int (app - 0 42)))))))
(app print (app forma_4_intmath_lib.square 7))
(app print (app forma_4_intmath_lib.cube 3)))
(app print (app forma_4_intmath_lib.abs_int (app - 0 42)))))))
+1 -1
View File
@@ -2,4 +2,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (seq (do io/print_float (app + 1.5 2.5)) (seq (do io/print_float (app int_to_float 42)) (do io/print_float (app neg 1.5)))))))
(body (seq (app print (app + 1.5 2.5)) (seq (app print (app int_to_float 42)) (app print (app neg 1.5)))))))
+1 -1
View File
@@ -44,4 +44,4 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(do io/print_int (app sum_list (app build 50))))))
(app print (app sum_list (app build 50))))))
+1 -1
View File
@@ -2,4 +2,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (if (app ge 3 5) 1 0)))))
(body (app print (if (app ge 3 5) 1 0)))))
+1 -1
View File
@@ -2,4 +2,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (if (app gt true false) 1 0)))))
(body (app print (if (app gt true false) 1 0)))))
+1 -1
View File
@@ -12,4 +12,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (app apply inc 41)))))
(body (app print (app apply inc 41)))))
+2 -2
View File
@@ -1,6 +1,6 @@
(module int_to_print_int_borrow
(fn main
(doc "Iter eob.1: primitive Int passed to io/print_int. The rule that Term::Do args are Borrow has no observable RC effect here because Int is unboxed; the test pins that no spurious bookkeeping appears (allocs == 0, frees == 0, live == 0).")
(doc "Iter eob.1 / rpe.1: primitive Int passed to the polymorphic `print` helper (Show Int). The rule that Term::Do args are Borrow has no observable RC effect here because Int is unboxed; the test pins that no spurious bookkeeping appears (allocs == 0, frees == 0, live == 0).")
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (let n 7 (do io/print_int n)))))
(body (let n 7 (app print n)))))
+1 -1
View File
@@ -2,4 +2,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (if (app le "abc" "abd") 1 0)))))
(body (app print (if (app le "abc" "abd") 1 0)))))
+1 -1
View File
@@ -14,4 +14,4 @@
(doc "Baut [10, 20, 12] und druckt die Summe (42).")
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (let xs (term-ctor IntList Cons 10 (term-ctor IntList Cons 20 (term-ctor IntList Cons 12 (term-ctor IntList Nil)))) (do io/print_int (app sum_list xs))))))
(body (let xs (term-ctor IntList Cons 10 (term-ctor IntList Cons 20 (term-ctor IntList Cons 12 (term-ctor IntList Nil)))) (app print (app sum_list xs))))))
+1 -1
View File
@@ -16,7 +16,7 @@
(params xs)
(body (match xs
(case (pat-ctor Nil) (lit-unit))
(case (pat-ctor Cons h t) (seq (do io/print_int h) (app print_list t))))))
(case (pat-ctor Cons h t) (seq (app print h) (app print_list t))))))
(fn main
(doc "Build [1,2,3], double each, print result.")
(type (fn-type (params) (ret (con Unit)) (effects IO)))
+1 -1
View File
@@ -46,7 +46,7 @@
(lit-unit))
(case (pat-ctor Cons h t)
(seq
(do io/print_int h)
(app print h)
(tail-app print_list t))))))
(fn main
+6 -6
View File
@@ -46,9 +46,9 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(seq (do io/print_int (app classify 0))
(seq (do io/print_int (app classify 1))
(seq (do io/print_int (app classify 17))
(seq (do io/print_int (app categorize_first (term-ctor IntList Nil)))
(seq (do io/print_int (app categorize_first (term-ctor IntList Cons 0 (term-ctor IntList Nil))))
(do io/print_int (app categorize_first (term-ctor IntList Cons 7 (term-ctor IntList Nil))))))))))))
(seq (app print (app classify 0))
(seq (app print (app classify 1))
(seq (app print (app classify 17))
(seq (app print (app categorize_first (term-ctor IntList Nil)))
(seq (app print (app categorize_first (term-ctor IntList Cons 0 (term-ctor IntList Nil))))
(app print (app categorize_first (term-ctor IntList Cons 7 (term-ctor IntList Nil))))))))))))
+1 -1
View File
@@ -30,4 +30,4 @@
(if (app <= n 1)
1
(app * n (app factorial (app - n 1)))))
(in (do io/print_int (app apply5 factorial)))))))
(in (app print (app apply5 factorial)))))))
+2 -2
View File
@@ -39,5 +39,5 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(seq (do io/print_int (app run_with_base 10))
(do io/print_int (app run_with_base 100))))))
(seq (app print (app run_with_base 10))
(app print (app run_with_base 100))))))
+3 -3
View File
@@ -30,6 +30,6 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(seq (do io/print_int (app sum_below 1))
(seq (do io/print_int (app sum_below 5))
(do io/print_int (app sum_below 10)))))))
(seq (app print (app sum_below 1))
(seq (app print (app sum_below 5))
(app print (app sum_below 10)))))))
+3 -3
View File
@@ -21,6 +21,6 @@
1
(app * n (app fact (app - n 1)))))
(in
(seq (do io/print_int (app fact 1))
(seq (do io/print_int (app fact 3))
(do io/print_int (app fact 5)))))))))
(seq (app print (app fact 1))
(seq (app print (app fact 3))
(app print (app fact 5)))))))))
+3 -3
View File
@@ -43,6 +43,6 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(seq (do io/print_int (app count_below 0))
(seq (do io/print_int (app count_below 5))
(do io/print_int (app count_below 15)))))))
(seq (app print (app count_below 0))
(seq (app print (app count_below 5))
(app print (app count_below 15)))))))
+3 -3
View File
@@ -54,6 +54,6 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(seq (do io/print_int (app count_below (term-ctor Pair MkPair 10 0)))
(seq (do io/print_int (app count_below (term-ctor Pair MkPair 10 5)))
(do io/print_int (app count_below (term-ctor Pair MkPair 10 15))))))))
(seq (app print (app count_below (term-ctor Pair MkPair 10 0)))
(seq (app print (app count_below (term-ctor Pair MkPair 10 5)))
(app print (app count_below (term-ctor Pair MkPair 10 15))))))))
+1 -1
View File
@@ -2,4 +2,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (if (app lt 3 5) 1 0)))))
(body (app print (if (app lt 3 5) 1 0)))))
+1 -1
View File
@@ -11,4 +11,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (app max3 3 17 9)))))
(body (app print (app max3 3 17 9)))))
+1 -1
View File
@@ -14,4 +14,4 @@
(doc "Print or_else for both arms; expected 7 then 99.")
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (seq (do io/print_int (app or_else (term-ctor Maybe Some 7) 99)) (do io/print_int (app or_else (term-ctor Maybe None) 99))))))
(body (seq (app print (app or_else (term-ctor Maybe Some 7) 99)) (app print (app or_else (term-ctor Maybe None) 99))))))
+1 -1
View File
@@ -9,4 +9,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (seq (do io/print_bool (app eq 1 1)) (seq (do io/print_bool (app eq true true)) (seq (do io/print_bool (app eq "a" "a")) (seq (do io/print_int (app ord_to_int (app compare 1 2))) (seq (do io/print_int (app ord_to_int (app compare false true))) (do io/print_int (app ord_to_int (app compare "a" "b")))))))))))
(body (seq (app print (app eq 1 1)) (seq (app print (app eq true true)) (seq (app print (app eq "a" "a")) (seq (app print (app ord_to_int (app compare 1 2))) (seq (app print (app ord_to_int (app compare false true))) (app print (app ord_to_int (app compare "a" "b")))))))))))
+1 -1
View File
@@ -5,4 +5,4 @@
(doc "mq.3.6 fixture (c): bare `myeq 1 2` in a workspace with `class MyEq` (in classmod) and `fn myeq` (in fnmod) both imported. Fn wins per lookup precedence; the typechecker emits `class-method-shadowed-by-fn` warning so the LLM-author sees the shadow.")
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_bool (app myeq 1 2)))))
(body (app print (app myeq 1 2)))))
+1 -1
View File
@@ -2,4 +2,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (if (app ne 3 5) 1 0)))))
(body (app print (if (app ne 3 5) 1 0)))))
+3 -3
View File
@@ -48,6 +48,6 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(seq (do io/print_int (app nested_sum 1))
(seq (do io/print_int (app nested_sum 3))
(do io/print_int (app nested_sum 5)))))))
(seq (app print (app nested_sum 1))
(seq (app print (app nested_sum 3))
(app print (app nested_sum 5)))))))
+1 -1
View File
@@ -23,7 +23,7 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(do io/print_int (app first_two_sum
(app print (app first_two_sum
(term-ctor std_list.List Cons 10
(term-ctor std_list.List Cons 20
(term-ctor std_list.List Cons 30
+1 -1
View File
@@ -3,7 +3,7 @@
(doc "Iter 23.1 fixture: pattern-match on prelude Ordering ctor without explicit prelude import.")
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (match (term-ctor prelude.Ordering LT)
(body (app print (match (term-ctor prelude.Ordering LT)
(case (pat-ctor LT) 1)
(case (pat-ctor EQ) 2)
(case (pat-ctor GT) 3))))))
+1 -1
View File
@@ -3,7 +3,7 @@
/// Iter 23.1 fixture: pattern-match on prelude Ordering ctor without explicit
/// prelude import.
fn main() -> Unit with IO {
do io/print_int(match LT {
print(match LT {
LT => 1,
EQ => 2,
GT => 3
+1 -1
View File
@@ -62,4 +62,4 @@
(term-ctor IntList Nil)))))
(match p
(case (pat-ctor Pair a _)
(do io/print_int (app sum_list a))))))))
(app print (app sum_list a))))))))
+1 -1
View File
@@ -10,4 +10,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (app apply succ 41)))))
(body (app print (app apply succ 41)))))
+1 -1
View File
@@ -6,4 +6,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (seq (do io/print_int (app id 42)) (do io/print_bool (app id true))))))
(body (seq (app print (app id 42)) (app print (app id true))))))
+2 -2
View File
@@ -53,5 +53,5 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(seq (do io/print_int (app apply_n_times 5 0 succ))
(do io/print_bool (app apply_n_times 4 false flip))))))
(seq (app print (app apply_n_times 5 0 succ))
(app print (app apply_n_times 4 false flip))))))
+1 -1
View File
@@ -18,5 +18,5 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (let p (app build_pair 1) (do io/print_int (match p
(body (let p (app build_pair 1) (app print (match p
(case (pat-ctor MkPair a _) (app use_cell a))))))))
@@ -18,7 +18,7 @@ fn use_cell(c: own Cell) -> Int {
}
fn main() -> Unit with IO {
do io/print_int(match build_pair(1) {
print(match build_pair(1) {
MkPair(a, _) => use_cell(a)
})
}
+1 -1
View File
@@ -7,4 +7,4 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (let b (term-ctor Box MkBox 42) (match b
(case (pat-ctor MkBox x) (do io/print_int x)))))))
(case (pat-ctor MkBox x) (app print x)))))))
+1 -1
View File
@@ -24,4 +24,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (app head_or_zero (app cons_n 1000000))))))
(body (app print (app head_or_zero (app cons_n 1000000))))))
+1 -1
View File
@@ -76,4 +76,4 @@
(params)
(body
(let t (app build 2)
(do io/print_int (app loop 3 t))))))
(app print (app loop 3 t))))))
+1 -1
View File
@@ -59,5 +59,5 @@
(params)
(body
(let x (app alloc 7)
(do io/print_int (app unbox x)))))
(app print (app unbox x)))))
)
+1 -1
View File
@@ -50,4 +50,4 @@
(params)
(body
(let t (app build 1)
(do io/print_int (app pin t))))))
(app print (app pin t))))))
+1 -1
View File
@@ -14,4 +14,4 @@
(doc "Build a 5-element IntList [1,2,3,4,5] and print its sum (15). Under --alloc=rc the recursive drop_rc_list_drop_IntList fn cascades through the tail at process exit when sum_list returns ownership-implicit (the consume_count of `xs` is 1 so no dec at the outer let; the test's correctness invariant is the byte-identical stdout — leak quantification is 18f's bench).")
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (let xs (term-ctor IntList Cons 1 (term-ctor IntList Cons 2 (term-ctor IntList Cons 3 (term-ctor IntList Cons 4 (term-ctor IntList Cons 5 (term-ctor IntList Nil)))))) (do io/print_int (app sum_list xs))))))
(body (let xs (term-ctor IntList Cons 1 (term-ctor IntList Cons 2 (term-ctor IntList Cons 3 (term-ctor IntList Cons 4 (term-ctor IntList Cons 5 (term-ctor IntList Nil)))))) (app print (app sum_list xs))))))
+2 -2
View File
@@ -8,5 +8,5 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (let xs (term-ctor IntList Cons 11 (term-ctor IntList Cons 22 (term-ctor IntList Cons 33 (term-ctor IntList Cons 44 (term-ctor IntList Cons 55 (term-ctor IntList Nil)))))) (match xs
(case (pat-ctor Nil) (do io/print_int 0))
(case (pat-ctor Cons h t) (do io/print_int h)))))))
(case (pat-ctor Nil) (app print 0))
(case (pat-ctor Cons h t) (app print h)))))))
+1 -1
View File
@@ -19,4 +19,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (app use_first (app build_pair 1))))))
(body (app print (app use_first (app build_pair 1))))))
@@ -20,5 +20,5 @@ fn use_first(p: own Pair) -> Int {
}
fn main() -> Unit with IO {
do io/print_int(use_first(build_pair(1)))
print(use_first(build_pair(1)))
}
+1 -1
View File
@@ -15,4 +15,4 @@
(doc "Build a 5-element IntList; pass to head_or_zero (transferring ownership); print the result.")
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (let xs (term-ctor IntList Cons 11 (term-ctor IntList Cons 22 (term-ctor IntList Cons 33 (term-ctor IntList Cons 44 (term-ctor IntList Cons 55 (term-ctor IntList Nil)))))) (do io/print_int (app head_or_zero xs))))))
(body (let xs (term-ctor IntList Cons 11 (term-ctor IntList Cons 22 (term-ctor IntList Cons 33 (term-ctor IntList Cons 44 (term-ctor IntList Cons 55 (term-ctor IntList Nil)))))) (app print (app head_or_zero xs))))))
+1 -1
View File
@@ -18,5 +18,5 @@ fn head_or_zero(xs: own IntList) -> Int {
/// print the result.
fn main() -> Unit with IO {
let xs = Cons(11, Cons(22, Cons(33, Cons(44, Cons(55, Nil)))));
do io/print_int(head_or_zero(xs))
print(head_or_zero(xs))
}
+1 -1
View File
@@ -18,4 +18,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (app use_first (app build_pair 1))))))
(body (app print (app use_first (app build_pair 1))))))
+1 -1
View File
@@ -52,4 +52,4 @@
(params)
(body
(let t (app build 2)
(do io/print_int (app loop 3 t))))))
(app print (app loop 3 t))))))
+1 -1
View File
@@ -66,4 +66,4 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(do io/print_int (app sum_list (app cons_n 100))))))
(app print (app sum_list (app cons_n 100))))))
+1 -1
View File
@@ -61,4 +61,4 @@
(term-ctor List Cons 2
(term-ctor List Cons 3
(term-ctor List Nil))))
(do io/print_int (app sum_list (app map_inc xs)))))))
(app print (app sum_list (app map_inc xs)))))))
+1 -1
View File
@@ -22,7 +22,7 @@
(params xs)
(body (match xs
(case (pat-ctor Nil) (lit-unit))
(case (pat-ctor Cons h t) (seq (do io/print_int h) (tail-app print_list t))))))
(case (pat-ctor Cons h t) (seq (app print h) (tail-app print_list t))))))
(fn main
(doc "Sort and print [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5].")
(type (fn-type (params) (ret (con Unit)) (effects IO)))
+7 -7
View File
@@ -18,14 +18,14 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(seq (do io/print_int (app std_either.from_right 0 (term-ctor std_either.Either Right 42)))
(seq (do io/print_int (app std_either.from_right 99 (term-ctor std_either.Either Left 7)))
(seq (do io/print_bool (app std_either.is_left (term-ctor std_either.Either Left 7)))
(seq (do io/print_bool (app std_either.is_right (term-ctor std_either.Either Right 42)))
(seq (do io/print_int (app std_either.from_right 0
(seq (app print (app std_either.from_right 0 (term-ctor std_either.Either Right 42)))
(seq (app print (app std_either.from_right 99 (term-ctor std_either.Either Left 7)))
(seq (app print (app std_either.is_left (term-ctor std_either.Either Left 7)))
(seq (app print (app std_either.is_right (term-ctor std_either.Either Right 42)))
(seq (app print (app std_either.from_right 0
(app std_either.map_right inc
(term-ctor std_either.Either Right 41))))
(seq (do io/print_int (app std_either.either inc inc
(seq (app print (app std_either.either inc inc
(term-ctor std_either.Either Left 5)))
(do io/print_int (app std_either.either inc inc
(app print (app std_either.either inc inc
(term-ctor std_either.Either Right 100))))))))))))
+4 -4
View File
@@ -24,7 +24,7 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(seq (do io/print_int (app std_list.length (app std_either_list.lefts (term-ctor std_list.List Cons (term-ctor std_either.Either Left 1) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 10) (term-ctor std_list.List Cons (term-ctor std_either.Either Left 2) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 20) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 30) (term-ctor std_list.List Nil)))))))))
(seq (do io/print_int (app std_list.length (app std_either_list.rights (term-ctor std_list.List Cons (term-ctor std_either.Either Left 1) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 10) (term-ctor std_list.List Cons (term-ctor std_either.Either Left 2) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 20) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 30) (term-ctor std_list.List Nil)))))))))
(seq (do io/print_int (app std_list.length (app std_pair.fst (app std_either_list.partition_eithers (term-ctor std_list.List Cons (term-ctor std_either.Either Left 1) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 10) (term-ctor std_list.List Cons (term-ctor std_either.Either Left 2) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 20) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 30) (term-ctor std_list.List Nil))))))))))
(do io/print_int (app std_list.length (app std_pair.snd (app std_either_list.partition_eithers (term-ctor std_list.List Cons (term-ctor std_either.Either Left 1) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 10) (term-ctor std_list.List Cons (term-ctor std_either.Either Left 2) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 20) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 30) (term-ctor std_list.List Nil))))))))))))))))
(seq (app print (app std_list.length (app std_either_list.lefts (term-ctor std_list.List Cons (term-ctor std_either.Either Left 1) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 10) (term-ctor std_list.List Cons (term-ctor std_either.Either Left 2) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 20) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 30) (term-ctor std_list.List Nil)))))))))
(seq (app print (app std_list.length (app std_either_list.rights (term-ctor std_list.List Cons (term-ctor std_either.Either Left 1) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 10) (term-ctor std_list.List Cons (term-ctor std_either.Either Left 2) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 20) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 30) (term-ctor std_list.List Nil)))))))))
(seq (app print (app std_list.length (app std_pair.fst (app std_either_list.partition_eithers (term-ctor std_list.List Cons (term-ctor std_either.Either Left 1) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 10) (term-ctor std_list.List Cons (term-ctor std_either.Either Left 2) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 20) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 30) (term-ctor std_list.List Nil))))))))))
(app print (app std_list.length (app std_pair.snd (app std_either_list.partition_eithers (term-ctor std_list.List Cons (term-ctor std_either.Either Left 1) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 10) (term-ctor std_list.List Cons (term-ctor std_either.Either Left 2) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 20) (term-ctor std_list.List Cons (term-ctor std_either.Either Right 30) (term-ctor std_list.List Nil))))))))))))))))
+11 -11
View File
@@ -48,14 +48,14 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(seq (do io/print_int (app std_list.length xs))
(seq (do io/print_bool (app std_list.is_empty xs))
(seq (do io/print_bool (app std_list.is_empty (term-ctor std_list.List Nil)))
(seq (do io/print_int (app std_maybe.from_maybe -1 (app std_list.head xs)))
(seq (do io/print_int (app std_list.length (app std_maybe.from_maybe xs (app std_list.tail xs))))
(seq (do io/print_int (app std_list.length (app std_list.append xs xs)))
(seq (do io/print_int (app std_maybe.from_maybe -1 (app std_list.head (app std_list.reverse xs))))
(seq (do io/print_int (app std_maybe.from_maybe -1 (app std_list.head (app std_list.map double xs))))
(seq (do io/print_int (app std_list.length (app std_list.filter is_even xs)))
(seq (do io/print_int (app std_list.fold_left add 0 xs))
(do io/print_int (app std_list.fold_right add 0 xs)))))))))))))))
(seq (app print (app std_list.length xs))
(seq (app print (app std_list.is_empty xs))
(seq (app print (app std_list.is_empty (term-ctor std_list.List Nil)))
(seq (app print (app std_maybe.from_maybe -1 (app std_list.head xs)))
(seq (app print (app std_list.length (app std_maybe.from_maybe xs (app std_list.tail xs))))
(seq (app print (app std_list.length (app std_list.append xs xs)))
(seq (app print (app std_maybe.from_maybe -1 (app std_list.head (app std_list.reverse xs))))
(seq (app print (app std_maybe.from_maybe -1 (app std_list.head (app std_list.map double xs))))
(seq (app print (app std_list.length (app std_list.filter is_even xs)))
(seq (app print (app std_list.fold_left add 0 xs))
(app print (app std_list.fold_right add 0 xs)))))))))))))))
+6 -6
View File
@@ -24,9 +24,9 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(seq (do io/print_int (app std_list.length (app std_list.take 0 xs)))
(seq (do io/print_int (app std_list.length (app std_list.take 3 xs)))
(seq (do io/print_int (app std_list.length (app std_list.take 100 xs)))
(seq (do io/print_int (app std_list.length (app std_list.drop 0 xs)))
(seq (do io/print_int (app std_list.length (app std_list.drop 2 xs)))
(do io/print_int (app std_list.length (app std_list.drop 100 xs)))))))))))
(seq (app print (app std_list.length (app std_list.take 0 xs)))
(seq (app print (app std_list.length (app std_list.take 3 xs)))
(seq (app print (app std_list.length (app std_list.take 100 xs)))
(seq (app print (app std_list.length (app std_list.drop 0 xs)))
(seq (app print (app std_list.length (app std_list.drop 2 xs)))
(app print (app std_list.length (app std_list.drop 100 xs)))))))))))
+2 -2
View File
@@ -37,5 +37,5 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(seq (do io/print_int (app std_list.fold_left add 0 (app build 1000)))
(do io/print_int (app std_list.fold_right add 0 (app build 1000)))))))
(seq (app print (app std_list.fold_left add 0 (app build 1000)))
(app print (app std_list.fold_right add 0 (app build 1000)))))))
+5 -5
View File
@@ -23,8 +23,8 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(seq (do io/print_int (app std_maybe.from_maybe 99 (term-ctor std_maybe.Maybe Just 7)))
(seq (do io/print_int (app std_maybe.from_maybe 99 (term-ctor std_maybe.Maybe Nothing)))
(seq (do io/print_bool (app std_maybe.is_some (term-ctor std_maybe.Maybe Just 5)))
(seq (do io/print_bool (app std_maybe.is_none (term-ctor std_maybe.Maybe Nothing)))
(do io/print_int (app std_maybe.from_maybe 0 (app std_maybe.map_maybe inc (term-ctor std_maybe.Maybe Just 41)))))))))))
(seq (app print (app std_maybe.from_maybe 99 (term-ctor std_maybe.Maybe Just 7)))
(seq (app print (app std_maybe.from_maybe 99 (term-ctor std_maybe.Maybe Nothing)))
(seq (app print (app std_maybe.is_some (term-ctor std_maybe.Maybe Just 5)))
(seq (app print (app std_maybe.is_none (term-ctor std_maybe.Maybe Nothing)))
(app print (app std_maybe.from_maybe 0 (app std_maybe.map_maybe inc (term-ctor std_maybe.Maybe Just 41)))))))))))
+6 -6
View File
@@ -24,9 +24,9 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(seq (do io/print_int (app std_pair.fst (term-ctor std_pair.Pair MkPair 7 9)))
(seq (do io/print_int (app std_pair.snd (term-ctor std_pair.Pair MkPair 7 9)))
(seq (do io/print_int (app std_pair.fst (app std_pair.swap (term-ctor std_pair.Pair MkPair 7 9))))
(seq (do io/print_int (app std_pair.snd (app std_pair.swap (term-ctor std_pair.Pair MkPair 7 9))))
(seq (do io/print_int (app std_pair.fst (app std_pair.map_first inc (term-ctor std_pair.Pair MkPair 7 9))))
(do io/print_int (app std_pair.snd (app std_pair.map_second double (term-ctor std_pair.Pair MkPair 7 9))))))))))))
(seq (app print (app std_pair.fst (term-ctor std_pair.Pair MkPair 7 9)))
(seq (app print (app std_pair.snd (term-ctor std_pair.Pair MkPair 7 9)))
(seq (app print (app std_pair.fst (app std_pair.swap (term-ctor std_pair.Pair MkPair 7 9))))
(seq (app print (app std_pair.snd (app std_pair.swap (term-ctor std_pair.Pair MkPair 7 9))))
(seq (app print (app std_pair.fst (app std_pair.map_first inc (term-ctor std_pair.Pair MkPair 7 9))))
(app print (app std_pair.snd (app std_pair.map_second double (term-ctor std_pair.Pair MkPair 7 9))))))))))))
+1 -1
View File
@@ -7,4 +7,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (app sum 10)))))
(body (app print (app sum 10)))))
@@ -16,4 +16,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (seq (do io/print_int (app r 0)) (do io/print_int (app r true))))))
(body (seq (app print (app r 0)) (app print (app r true))))))
+1 -1
View File
@@ -10,4 +10,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (app dval 0)))))
(body (app print (app dval 0)))))
+1 -1
View File
@@ -12,5 +12,5 @@ instance D Int {
}
fn main() -> Unit with IO {
do io/print_int(dval(0))
print(dval(0))
}
+1 -1
View File
@@ -11,4 +11,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (app foo 5)))))
(body (app print (app foo 5)))))
+1 -1
View File
@@ -3,4 +3,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (app xr 0)))))
(body (app print (app xr 0)))))
+1 -1
View File
@@ -14,4 +14,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (app foo (term-ctor IntBox MkIntBox 42))))))
(body (app print (app foo (term-ctor IntBox MkIntBox 42))))))
+1 -1
View File
@@ -19,4 +19,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (app head_or_zero (term-ctor test_mono_ctor_listmod.List Cons 7 (term-ctor test_mono_ctor_listmod.List Nil)))))))
(body (app print (app head_or_zero (term-ctor test_mono_ctor_listmod.List Cons 7 (term-ctor test_mono_ctor_listmod.List Nil)))))))
+1 -1
View File
@@ -3,4 +3,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (app test_mono_imports_classmod.helper 42)))))
(body (app print (app test_mono_imports_classmod.helper 42)))))
+1 -1
View File
@@ -15,4 +15,4 @@
(fn main
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (app loop 0 5)))))
(body (app print (app loop 0 5)))))
+2 -2
View File
@@ -31,5 +31,5 @@
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body
(seq (do io/print_int (app safe_div 8 2))
(do io/print_int (app safe_div 15 3))))))
(seq (app print (app safe_div 8 2))
(app print (app safe_div 15 3))))))
+1 -1
View File
@@ -4,4 +4,4 @@
(doc "Iter 5b fixture: ruft ws_lib.add auf, druckt das Ergebnis. So ist Cross-Module-Typcheck am Beispiel beobachtbar.")
(type (fn-type (params) (ret (con Unit)) (effects IO)))
(params)
(body (do io/print_int (app ws_lib.add 2 3)))))
(body (app print (app ws_lib.add 2 3)))))