ProjectEuler 2, nearly (#125)

This commit is contained in:
Patrick Stevens
2020-04-19 13:40:22 +01:00
committed by GitHub
parent e660eceb43
commit 485b27e009
11 changed files with 751 additions and 488 deletions

View File

@@ -77,3 +77,9 @@ containsDecidable decide (x :: l) needle | inr x!=n | inr notIn = inr t
t : ((x needle) || contains l needle) False
t (inl x) = x!=n x
t (inr x) = notIn x
filter' : {a b : _} {A : Set a} {pred : A Set b} (dec : (a : A) pred a || (pred a False)) List A List A
filter' dec [] = []
filter' dec (x :: l) with dec x
... | inl _ = x :: filter' dec l
... | inr _ = filter' dec l