Idris2-boot/tests/idris2/basic008/If.idr
Michael Morgan e6121e0935 Remove trailing whitespace from Idris sources.
This is the result of running the command:

$ find . -name '*.idr' -type f -exec sed -i -E 's/\s+$//' {} +

I confirmed before running it that this would not affect any markdown
formatting in documentation comments.
2019-10-25 14:24:25 -07:00

19 lines
333 B
Idris

data Bool = False | True
data Nat = Z | S Nat
not : Bool -> Bool
not False = True
not True = False
isZero : Nat -> Bool
isZero Z = True
isZero (S k) = False
isOdd : Nat -> Bool
isOdd Z = False
isOdd (S k) = not (isOdd k)
testZ : Nat -> String
testZ x = if isZero x then "Zero" else
if isOdd x then "Odd" else "Even"