lean4-htt/tests/lean/ppite.lean
Leonardo de Moura 87207030ce test: pretty printing if-then-else
@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"
```
2020-12-24 08:40:30 -08:00

17 lines
328 B
Text

def f (xs : List Nat) : IO Unit := do
xs.forM fun x =>
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"
#print f
#check if true then 1 else 0
#check if h : true then 1 else 0