Idris2/tests/refc/issue1778/Reverse.idr

10 lines
223 B
Idris
Raw Normal View History

2021-12-08 09:31:56 +03:00
reverse : Nat -> Nat
reverse = reverseOnto 0
where
reverseOnto : Nat -> Nat -> Nat
reverseOnto j 0 = j
reverseOnto j (S k) = reverseOnto (S j) k
main : IO ()
main = printLn $ reverse $ the Nat 100000