Idris2Doc : Data.Unique.Vect

Data.Unique.Vect

(source)

Definitions

dataUniqueVect : (0_ : Nat) -> (0a : Type) ->DecEqa=>Type
  A vector that cannot contain duplicates
An element can be inserted only if it is not already in the vector
Mathematically can be thought of as an ordered set
@ a The type of the elements in the list

Totality: total
Visibility: public export
Constructors:
Nil : {auto{conArg:17229} : DecEqa} ->UniqueVect0a
(::) : {auto{conArg:17242} : DecEqa} -> (x : a) -> (xs : UniqueVectna) ->NotElemxxs=>UniqueVect (Sn) a
dataNotElem : {auto{conArg:17264} : DecEqa} ->a->UniqueVectna->Type
  A proof that an element `x` is not found in `xs`

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

Hint: 
{auto{conArg:18942} : DecEqa} ->IsNo (decEqxy) ->NotElemy [x]
dataElem : {auto{conArg:17342} : DecEqa} ->a->UniqueVectna->Type
  A proof that an element `x` is found in `xs`

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

Hint: 
{auto{conArg:17523} : DecEqa} ->Uninhabited (Elemx [])
dataAll : {auto{conArg:17427} : 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:17446} : DecEqa} ->Allp []
(::) : {auto{conArg:17467} : DecEqa} -> {auto{conArg:17482} : NotElemxxs} ->px->Allpxs->Allp (x::xs)
decElemInUniqueVect : {auto{conArg:17570} : DecEqa} -> (x : a) -> (xs : UniqueVectna) ->Dec (Elemxxs)
  A decision procedure for determining whether an element `x` is in `xs`

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

Visibility: public export
indexOf : {auto{conArg:18146} : 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:18215} : DecEqa} ->UniqueVectna->Nat
Visibility: public export
drop : {auto{conArg:18257} : 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:18665} : DecEqa} ->UniqueVect (Sn) a->Fin (Sn) ->UniqueVectna
  Remove element from a unique vector at a given index

Visibility: public export
removingElemIsStillNotElem : {auto{conArg:18682} : 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:18872} : 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:18942} : DecEqa} ->IsNo (decEqxy) ->NotElemy [x]
Visibility: public export
numUnique : {auto{conArg:19003} : DecEqa} ->UniqueVectna->UniqueVectma->Nat
  Number of elements found in any of two unique vectors
Effectively, union

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

Visibility: public export
numSymmetricDifference : {auto{conArg:19245} : 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:19419} : DecEqa} -> (xs : UniqueVectna) -> (ys : UniqueVectma) ->UniqueVect (numUniquexsys) a
  Union

Visibility: public export
Fixity Declaration: infixr operator, level 5
expandUnique : {auto{conArg:19438} : 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:19583} : DecEqa} -> (xs : UniqueVectna) -> (ys : UniqueVectma) ->UniqueVect (numOverlapxsys) a
Visibility: public export
notElemIntersect : {auto{conArg:19602} : 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:19742} : 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:19780} : 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:19818} : 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