Idris2/tests/idris2/interface029/ForwardImpl2.idr

17 lines
304 B
Idris
Raw Normal View History

interface IsEven a where
isEven : a -> Bool
interface IsOdd b where
isOdd : b -> Bool
implementation IsOdd Nat
implementation IsEven Nat where
isEven 0 = True
isEven (S k) = not $ isOdd k
implementation Show Nat => IsOdd Nat where
isOdd 0 = True
isOdd (S k) = not $ isEven k