1 import "JavaBuiltin" as Java
\r
8 isZero :: a -> Boolean
\r
11 instance Num Integer where
\r
12 x + y = Java.iadd x y
\r
13 x - y = Java.isub x y
\r
14 isZero x = Java.icmpeq Java.iconst_0 x
\r
17 even x = if isZero x then True else odd (x - one)
\r
18 odd x = if isZero x then False else even (x - one)
\r
20 main = odd (8 :: Integer)
\r