Idris2Doc : Data.Unique.Vect

Data.Unique.Vect

(source)

Definitions

dataUniqueVect : (0_ : Nat) -> (0a : Type) ->DecEqa=>Type
  A list with unique elements, length tracked statically
An element can be inserted if it is not already in the list
Like a Set, but with ordering
@ a The type of the elements in the list

Totality: total
Visibility: public export
Constructors:
Nil : {auto{conArg:16715} : DecEqa} ->UniqueVect0a
(::) : {auto{conArg:16728} : DecEqa} -> (x : a) -> (xs : UniqueVectna) ->NotElemxxs=>UniqueVect (Sn) a
dataNotElem : {auto{conArg:16750} : DecEqa} ->a->UniqueVectna->Type
  A proof that an element is *not* found in the unique vector

Totality: total
Visibility: public export
Constructors:
NotInEmptyVect : {auto{conArg:16766} : DecEqa} -> (x : a) ->NotElemx []
NotInNonEmptyVect : {autode : DecEqa} -> (xs : UniqueVectna) ->NotElemxxs->IsNo (decEqxy) => {autoprf : NotElemyxs} ->NotElemx (y::xs)

Hint: 
{auto{conArg:18435} : DecEqa} ->IsNo (decEqxy) ->NotElemy [x]
dataAll : {auto{conArg:16835} : DecEqa} -> (0_ : (a->Type)) ->UniqueVectranka->Type
  A proof that elements of a unique vector satisfy a property

Totality: total
Visibility: public export
Constructors:
Nil : {auto{conArg:16854} : DecEqa} ->Allp []
(::) : {auto{conArg:16875} : DecEqa} -> {auto{conArg:16890} : NotElemxxs} ->px->Allpxs->Allp (x::xs)
dataElem : {auto{conArg:16929} : DecEqa} ->a->UniqueVectna->Type
  A proof that an element is found in a vector with unique elements

Totality: total
Visibility: public export
Constructors:
Here : {auto{conArg:16942} : DecEqa} -> {autoprf : NotElemxxs} ->Elemx (x::xs)
There : {auto{conArg:16974} : DecEqa} -> {autoprf : NotElemyxs} ->Elemxxs->Elemx (y::xs)

Hint: 
{auto{conArg:17016} : DecEqa} ->Uninhabited (Elemx [])
decElemInUniqueVect : {auto{conArg:17063} : DecEqa} -> (x : a) -> (xs : UniqueVectna) ->Dec (Elemxxs)
  Decision procedure for unique vector's Elem

Visibility: public export
notElem : {auto{conArg:17322} : DecEqa} ->Not (Elemxxs) ->NotElemxxs
Visibility: public export
toVect : {auto{conArg:17462} : DecEqa} ->UniqueVectna->Vectna
Visibility: public export
fromVect : {auto{conArg:17502} : DecEqa} ->Vectna-> (m : Nat**UniqueVectma)
  Converts a vector to a unique vector, removing duplicates if they exist

Visibility: public export
indexOf : {auto{conArg:17639} : DecEqa} ->Elemxxs->Finn
  Turn the proof that an element `x` is in a vector into the index of `x`

Visibility: public export
length : {auto{conArg:17708} : DecEqa} ->UniqueVectna->Nat
Visibility: public export
drop : {auto{conArg:17750} : DecEqa} -> (xs : UniqueVectna) -> (elem : Elemxxs) ->UniqueVect (minusn (finToNat (FS (indexOfelem)))) a
  Drop all the elements up and until the element `x` from a unique vector

Visibility: public export
Test1 : UniqueVect5String
Visibility: public export
wher : Elem"c"Test1
Visibility: public export
removeIndex : {auto{conArg:18158} : DecEqa} ->UniqueVect (Sn) a->Fin (Sn) ->UniqueVectna
  Remove element from a unique vector at a given index

Visibility: public export
removingElemIsStillNotElem : {auto{conArg:18175} : DecEqa} ->NotElemxxs=>NotElemx (removeIndexxsi)
  Given a vector `xs` and a proof that `x` is not in `xs`, then even if
we remove any elemens from `xs`, `x` will still not be in the result

Visibility: public export
notEqualNotElem : {auto{conArg:18365} : DecEqa} ->IsNo (decEqxy) ->NotElemx [y]
  If `x` is not equal to `y`, then `x` is not in the list `[y]`
It seems that Idris manages to discover this proof automatically, so
this is not needed in practice
Its dual is needed, hence the %hint in for the declaration below

Visibility: public export
notEqualNotElem2 : {auto{conArg:18435} : DecEqa} ->IsNo (decEqxy) ->NotElemy [x]
Visibility: public export
numUnique : {auto{conArg:18496} : DecEqa} ->UniqueVectna->UniqueVectma->Nat
  Number of elements found in any of two unique vectors
Effectively, union

Visibility: public export
numOverlap : {auto{conArg:18617} : DecEqa} ->UniqueVectna->UniqueVectma->Nat
  Number of elements found in both of the two unique vectors
Effectively, intersection

Visibility: public export
numSymmetricDifference : {auto{conArg:18738} : DecEqa} ->UniqueVectna->UniqueVectma->Nat
  Number of elements that are found in one but not both of the two vectors
Effectively, symmetric difference

Visibility: public export
(+++) : {auto{conArg:18912} : DecEqa} -> (xs : UniqueVectna) -> (ys : UniqueVectma) ->UniqueVect (numUniquexsys) a
  Union

Visibility: public export
Fixity Declaration: infixr operator, level 5
expandUnique : {auto{conArg:18931} : DecEqa} ->NotElemxxs=>NotElemxys=>NotElemx (xs+++ys)
  If `x` is not in `xs` nor `ys`, then it also won't be in `xs +++ ys`
intersect : {auto{conArg:19076} : DecEqa} -> (xs : UniqueVectna) -> (ys : UniqueVectma) ->UniqueVect (numOverlapxsys) a
Visibility: public export
notElemIntersect : {auto{conArg:19095} : DecEqa} ->NotElemxxs=>Elemxys=>NotElemx (intersectxsys)
  If `x` is not in `xs`, then we can intersect `xs` with any other list,
and `x` still wont' be in the result (even if `x` was in the other list)
allElemIntersectFst : {auto{conArg:19235} : DecEqa} -> (xs : UniqueVectna) -> (ys : UniqueVectma) ->All (\x=>Elemxxs) (intersectxsys)
  All elements of the intersection of two vectors `xs` and `ys`
will be elements of `xs`

Visibility: public export
allElemIntersectSnd : {auto{conArg:19273} : DecEqa} -> (xs : UniqueVectna) -> (ys : UniqueVectma) ->All (\x=>Elemxys) (intersectxsys)
  All elements of the intersection of two vectors `xs` and `ys`
will be elements of `ys`

Visibility: public export
symmetricDifference : {auto{conArg:19311} : DecEqa} -> (xs : UniqueVectna) -> (ys : UniqueVectma) ->UniqueVect (numSymmetricDifferencexsys) a
Visibility: public export
l1 : UniqueVect3String
Visibility: public export
l2 : UniqueVect3String
Visibility: public export
l3 : UniqueVect5String
Visibility: public export
l4 : UniqueVect1String
Visibility: public export