import "JavaBuiltin" as Java infixl 6 (+), (-) class Num a where (+) :: a -> a -> a (-) :: a -> a -> a isZero :: a -> Boolean one :: a instance Num Integer where x + y = Java.iadd x y x - y = Java.isub x y isZero x = Java.icmpeq Java.iconst_0 x one = Java.iconst_1 even x = if isZero x then True else odd (x - one) odd x = if isZero x then False else even (x - one) main = odd (8 :: Integer) -- false