@Kha We will probably have to write a handwritten formatter in the
future. The new test shows some limitations with `do`, `else if`, ...
where we want the output
```
if x == 0 then do
IO.println "foo"
IO.println "zero"
else if x % 2 == 0 then do
IO.println x
IO.println "even"
else do
IO.println x
IO.println "odd"
```
20 lines
435 B
Text
20 lines
435 B
Text
def f : List Nat → IO Unit :=
|
|
fun (xs : List Nat) =>
|
|
List.forM
|
|
(fun (x : Nat) =>
|
|
if x == 0 then
|
|
do
|
|
IO.println "foo"
|
|
IO.println "zero"
|
|
else
|
|
if x % 2 == 0 then
|
|
do
|
|
IO.println x
|
|
IO.println "even"
|
|
else
|
|
do
|
|
IO.println x
|
|
IO.println "odd")
|
|
xs
|
|
if true then 1 else 0 : Nat
|
|
if h : true then 1 else 0 : Nat
|