File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed
tests/idris2/with/with012 Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ module WithProof0ElabFail
2+
3+ import Language.Reflection
4+
5+ %default total
6+
7+ %language ElabReflection
8+
9+ %hide List . filter
10+
11+ data So : Bool -> Type where
12+ Oh : So True
13+
14+ eqToSo : b = True -> So b
15+ eqToSo Refl = Oh
16+
17+ data All : (0 p : a -> Type ) -> List a -> Type where
18+ Nil : All p Nil
19+ (:: ) : {0 xs : List a} -> p x -> All p xs -> All p (x :: xs)
20+
21+ filter : (p : a -> Bool ) -> (xs : List a) -> List a
22+ filter p [] = []
23+ filter p (x :: xs) with (p x)
24+ filter p (x :: xs) | False = filter p xs
25+ filter p (x :: xs) | True = x :: filter p xs
26+
27+ failing " While processing right hand side of with block in allFilter. prf is not accessible in this context"
28+ % runElab declare `[
29+ allFilter : (p : a -> Bool ) -> (xs : List a) -> All (So . p) (filter p xs)
30+ allFilter p [] = []
31+ allFilter p (x :: xs) with (p x) proof 0 prf
32+ allFilter p (x :: xs) | False = allFilter p xs
33+ allFilter p (x :: xs) | True = eqToSo prf :: allFilter p xs
34+ ]
Original file line number Diff line number Diff line change 221/1: Building WithProof1 (WithProof1.idr)
331/1: Building WithProof0Fail (WithProof0Fail.idr)
441/1: Building WithProof1Fail (WithProof1Fail.idr)
5+ 1/1: Building WithProof0ElabFail (WithProof0ElabFail.idr)
Original file line number Diff line number Diff line change @@ -4,3 +4,4 @@ check WithProof0.idr
44check WithProof1.idr
55check WithProof0Fail.idr
66check WithProof1Fail.idr
7+ check WithProof0ElabFail.idr
You can’t perform that action at this time.
0 commit comments