Idris2/tests/idris2/interface/interface027/params.idr
2023-09-07 14:57:22 +01:00

24 lines
482 B
Idris

parameters (n : Nat)
data X : Type -> Type where
A : t -> X t
B : t -> X t
Eq t => Eq (X t) where
A x == A y = x == y
B x == B y = x == y
_ == _ = False
test : Char -> Char -> Bool
test x y = A x == A y
mkEq : (approx : Bool) -> Eq Nat
mkEq True = withinOne
where
[withinOne] Eq Nat where
Z == Z = True
Z == S Z = True
S Z == Z = True
S x == S y = x == y
_ == _ = False
mkEq False = %search