3import Language.Reflection
8--------------------------------------------------------------------------------
10--------------------------------------------------------------------------------
13 data Elem : a -> Vect k a -> Type where
15 There : Elem x xs -> Elem x (y::xs)
17findElem : Nat -> List (TTName, Binder TT) -> TT -> Tactic
18findElem Z ctxt goal = Refine "Here" `Seq` Solve
19findElem (S n) ctxt goal = GoalType "Elem" (Try (Refine "Here" `Seq` Solve) (Refine "There" `Seq` (Solve `Seq` findElem n ctxt goal)))
21replaceElem : (xs : Vect k t) -> Elem x xs -> (y : t) -> (ys : Vect k t ** Elem y ys)
22replaceElem (x::xs) Here y = (y :: xs ** Here)
23replaceElem (x::xs) (There xinxs) y with (replaceElem xs xinxs y)
24 | (ys ** yinys) = (x :: ys ** There yinys)
26replaceByElem : (xs : Vect k t) -> Elem x xs -> t -> Vect k t
27replaceByElem (x::xs) Here y = y :: xs
28replaceByElem (x::xs) (There xinxs) y = x :: replaceByElem xs xinxs y
30mapElem : {xs : Vect k t} -> {f : t -> u} -> Elem x xs -> Elem (f x) (map f xs)
32mapElem (There e) = There (mapElem e)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list