Idris2/tests/idris2/reg/reg045/withparams.idr
2023-09-07 14:57:22 +01:00

12 lines
300 B
Idris

-- Testing that 'with' works under parameters that are implicits
parameters {0 A : Type} (pred : A -> Bool)
foo : A -> Bool
foo x = case pred x of
True => False
False => True
bar : (x : A) -> not (pred x) = foo x
bar a with (pred a)
bar a | True = Refl
bar a | False = Refl