data Elem : a -> SnocList a -> Type
A proof that some element is found in a list.
Totality: total
Visibility: public export
Constructors:
Here : Elem x (sx :< x)
A proof that the element is at the head of the list
There : Elem x sx -> Elem x (sx :< y)
A proof that the element is in the tail of the list
Hints:
DecEq (Elem x sx)
Injective There
Uninhabited (Here = There e)
Uninhabited (There e = Here)
Uninhabited (Elem x [<])
neitherHereNorThere : Not (x = y) -> Not (Elem x sx) -> Not (Elem x (sx :< y))
An item not in the head and not in the tail is not in the list at all.
Visibility: public exportisElem : DecEq a => (x : a) -> (sx : SnocList a) -> Dec (Elem x sx)
Check whether the given element is a member of the given list.
Visibility: public exportget : (sx : SnocList a) -> Elem x sx -> a
Get the element at the given position.
Visibility: public exportlookup : (sx : SnocList a) -> Elem x sx -> Singleton x
Get the element at the given position, with proof that it is the desired element.
Visibility: public exportdropElem : (sx : SnocList a) -> Elem x sx -> SnocList a
Remove the element at the given position.
Visibility: public exportelemToNat : Elem x sx -> Nat
Erase the indices, returning the numeric position of the element
Visibility: public exportindexElem : Nat -> (sx : SnocList a) -> Maybe (x : a ** Elem x sx)
Find the element with a proof at a given position (in reverse), if it is valid
Visibility: public exportelemMap : (0 f : (a -> b)) -> Elem x sx -> Elem (f x) (map f sx)
Lift the membership proof to a mapped list
Visibility: export