Idris2Doc : Misc

Misc

(source)

Definitions

constUnit : a-> ()
Totality: total
Visibility: public export
const2Unit : a->b-> ()
Totality: total
Visibility: public export
fromBool : Numa=>Bool->a
Totality: total
Visibility: public export
applyWhen : Bool-> (a->a) ->a->a
Totality: total
Visibility: public export
updateAt : Eqa=> (a->b) -> (a, b) ->a->b
Totality: total
Visibility: public export
graph : {t : a->Type} -> ((x : a) ->tx) ->a-> (x : a**tx)
  Graph of a dependent function

Totality: total
Visibility: public export
dependentMap : Functorf=> {t : a->Type} -> ((x : a) ->tx) ->fa->f (x : a**tx)
  Version of `map` for dependent function
Note that here `x : a` is identity in some sense, it comes from `f a`

Totality: total
Visibility: public export
dataIsNo : Deca->Type
  The proof that a decidable property leads to a contradiction
`IsNo` is a type Idris can automatically synthesise, unlike `Not`
See example below

Totality: total
Visibility: public export
Constructor: 
ItIsNo : IsNo (Nocontra)

Hint: 
{auto{conArg:18850} : DecEqa} ->IsNo (decEqxy) ->NotElemy [x]
isNoSym : {auto{conArg:11722} : DecEqa} ->IsNo (decEqxy) ->IsNo (decEqyx)
Totality: total
Visibility: public export
proofIneqIsNo : {auto{conArg:11829} : DecEqa} ->Not (x=y) ->IsNo (decEqxy)
  Proof of inequality yields IsNo

Totality: total
Visibility: public export
dataIsNothing : Maybea->Type
Totality: total
Visibility: public export
Constructor: 
ItIsNothing : IsNothingNothing

Hint: 
Uninhabited (IsNothing (Justx))
maybeVoidIsNothing : (x : MaybeVoid) ->IsNothingx
Totality: total
Visibility: public export
dataNotElem : DecEqa=>a->Vectna->Type
Totality: total
Visibility: public export
Constructors:
NotInEmptyVect : {auto{conArg:11972} : DecEqa} ->NotElemx []
NotInNonEmptyVect : {auto{conArg:11986} : DecEqa} -> (xs : Vectna) ->IsNo (decEqxy) ->NotElemxxs=>NotElemx (y::xs)
notEqualNotElem : {auto{conArg:12024} : DecEqa} ->IsNo (decEqxy) ->NotElemx [y]
Totality: total
Visibility: public export
notElemSym : {auto{conArg:12075} : DecEqa} ->NotElemi [j] ->NotElemj [i]
  If an element `i` is not in the singleton list `[j]`, then `j` is not in
the singleton list `[i]`

Totality: total
Visibility: public export
elemSym : DecEqa=>Elemi [j] ->Elemj [i]
  If an element `i` is in the singleton list `[j]`, then `j` is in the 
singleton list `[i]`

Totality: total
Visibility: public export
liftA2 : Applicativef=>fa->fb->f (a, b)
  Definition of liftA2 in terms of (<*>)

Totality: total
Visibility: public export
strength : Applicativef=>a->fb->f (a, b)
  Tensorial strength

Totality: total
Visibility: public export
toList' : Vectna->Lista
  toList with a different foldable implementation

Totality: total
Visibility: public export
fromList' : (xs : Lista) ->Vect (lengthxs) a
Totality: total
Visibility: public export
sum : Numa=>Vectna->a
Totality: total
Visibility: public export
prod : Numa=>Vectna->a
Totality: total
Visibility: public export
max : Orda=>Vectna->Maybea
Totality: total
Visibility: public export
argmax : Orda=>IsSuccn=>Vectna->Finn
Totality: total
Visibility: public export
argmin : Orda=>IsSuccn=>Vectna->Finn
Totality: total
Visibility: public export
unConcat : Vect (n*m) a->Vectn (Vectma)
  Dual to concat from Data.Vect

Totality: total
Visibility: public export
dropFromEnd : Eqa=>a->Vectna->Lista
  Trim a specified trailing value

Totality: total
Visibility: public export
consSnoc : Vectna->a->a->Vect (2+n) a
  Combination of `cons` and `snoc`: adds an element in front, and at the end

Totality: total
Visibility: public export
padToSize : Vectsizea-> (targetSize : Nat) ->a->LTEsizetargetSize=>VecttargetSizea
  Pad a vector with a specified element to exactly `targetSize`

Totality: total
Visibility: public export
drop : (i : Fin (Sn)) ->Vectna->Vect (minusn (finToNati)) a
  Drop the first i elements of a vector
Analogous to Data.Vect.drop, except the index is Fin n instead of Nat

Totality: total
Visibility: public export
drop : DecEqa=> (xs : Vectna) -> (elem : Elemxxs) ->Vect (minusn (finToNat (FS (elemToFinelem)))) a
  Drop all the elements up and until the element `x` from a vector

Totality: total
Visibility: public export
sum : Numa=>Lista->a
Totality: total
Visibility: public export
prod : Numa=>Lista->a
Totality: total
Visibility: public export
listZip : Lista->Listb->List (a, b)
Totality: total
Visibility: public export
mapWithIndex : (Nat->a->b) ->Lista->Listb
  Map each element along with its zero-based position in the list.

Totality: total
Visibility: public export
chunksOf : Nat->Lista->List (Lista)
  Split a list into consecutive chunks of size `n` (clamped to at least 1).
The final chunk may be shorter than `n`, this is why the length of the
list is needed as upper bound.

Totality: total
Visibility: public export
max : Orda=>Lista->Maybea
Totality: total
Visibility: public export
max : Orda=> (xs : Lista) ->NonEmptyxs=>a
Totality: total
Visibility: public export
dropFromEnd : Eqa=>a->Lista->Lista
  Trim a specified trailing value

Totality: total
Visibility: public export
consSnoc : Lista->a->a->Lista
  Combination of `cons` and `snoc`: adds an element in front, and at the end

Totality: total
Visibility: public export
padToSize : Nat->a->Lista->Lista
  Pad a list with a specified element to at least `targetSize`

Totality: total
Visibility: public export
dropAfterElem : (xs : Lista) ->Elemxxs->Lista
  Drop all the elements after the element `x` from a list

Totality: total
Visibility: public export
cons : x-> (Finl->x) ->Fin (Sl) ->x
  Analogue of `(::)`

Totality: total
Visibility: public export
head : (Fin (Sl) ->x) ->x
Totality: total
Visibility: public export
tail : (Fin (Sl) ->x) ->Finl->x
Totality: total
Visibility: public export
init : (Fin (Sn) ->a) ->Finn->a
  All but the last element

Totality: total
Visibility: public export
takeFin : (s : Fin (Sn)) ->Vectna->Vect (finToNats) a
  Analogus to `Data.Vect.take`

Totality: total
Visibility: public export
sum : Numa=> (Finn->a) ->a
Totality: total
Visibility: public export
prod : Numa=> (Finn->a) ->a
Totality: total
Visibility: public export
toList : (Finn->a) ->Lista
Totality: total
Visibility: public export
minusSuccLTE : LTEnm->minus (Sm) n=S (minusmn)
  Proof that subtracting from a successor is the same as taking the sucessor
of the subtraction

Totality: total
Visibility: public export
weakenN' : (0n : Nat) ->Finm->Fin (n+m)
  A version of `weakenN` from Data.Fin with `n` on the other side of `+`

Totality: total
Visibility: public export
weakenMultN : (m : Nat) ->IsSuccm=>Finn->Fin (m*n)
  Variant of `weakenN` from `Data.Fin`, but for multiplication
Like shiftMul, but without changing the value of the index

Totality: total
Visibility: public export
shiftMul : (stride : Nat) ->IsSuccstride=>Finn->Fin (n*stride)
  Variant of `shift` from Data.Fin, but for multiplication
Given a stride and an index `i : Fin n`, it returns a stride-sized step
That is, it returns `stride * i` : Fin (stride * n)
Implemented by recursing on i, adding stride each time

Totality: total
Visibility: public export
strengthenN : Fin (m+n) ->Either (Finm) (Finn)
  Analogue of `strengthen` from Data.Fin
Attempts to strengthen the bound on Fin (m + n) to Fin m
If it doesn't succeed, then returns the remainder in Fin n

Totality: total
Visibility: public export
finS' : Finn->Finn
  Analogue of `finS` from `Data.Fin`, but without without wrapping
That is, `finS' last = last`

Totality: total
Visibility: public export
lastBiggerThanOthers : (i : Fin (Sn)) ->So (last>=i)
  This can be implemented using `Data.Fin.Order`, but it doesn't seem worth
the effort, as the typechecker ends up needing a lot of extra hand holding

Totality: total
Visibility: public export
addFinsBounded : Finn->Finn->Finn
  Adds two bounded numbers, bounds the result
That is, `addFinsBounded {n=5} 3 4 = 4`
`assert_smaller` is only needed for totality checking

Totality: total
Visibility: public export
half : Finn->Finn
  Divides a Fin by 2, rounding down
`half {n=10} 6 = 3`
`half {n=10} 5 = 2`
`half {n=10} 4 = 2`
`half {n=10} 3 = 1`
`half {n=10} 2 = 1`
`half {n=10} 1 = 0`

Totality: total
Visibility: public export
mid : (low : Finn) -> (high : Finn) ->So (high>=low) =>Finn
  Computes the midway index between two bounds

Totality: total
Visibility: public export
multSucc : IsSuccm->IsSuccn->IsSucc (m*n)
Totality: total
Visibility: public export
allSuccThenProdSucc : (xs : ListNat) ->AllIsSuccxs=>IsSucc (prodxs)
Totality: total
Visibility: public export
findBinBetween : Orda=>IsSuccn=>Vectna->a->Rangen->Maybe (Finn)
  Given a non-empty sorted vector `xs`, an element `x` and a lower and upper
bound, it finds the "right bin", i.e. the index of the smallest element
between the bounds that's bigger than `x`
If `x` is bigger than the largest element, returns `Nothing`
`findBinBetween [2,7,10] 1 (MkRange 0 2) = Just 0`
`findBinBetween [2,7,10] 3 (MkRange 0 2) = Just 1`
`findBinBetween [2,7,10] 9 (MkRange 0 2) = Just 2`
`findBinBetween [2,7,10] 7 (MkRange 0 2) = Just 2`
`findbinbetween [2,7,15] 7 (MkRange 0 2) = Nothing`
`findBinBetween [1,2,3,4,5] 6 (MkRange 0 4) = Nothing`
Done using binary search

Totality: total
Visibility: public export
findBin : Orda=>IsSuccn=>Vectna->a->Maybe (Finn)
  Todo can this eventually be generalised to non-cubical tensors?
Given a non-empty sorted vector `xs` and an element `x` it finds the
"right bin", i.e. the index of the smallest element that's bigger than `x`
If `x` is bigger than the highest element, returns `Nothing`
`findBin [2,7,10] 1 = Just 0`
`findBin [2,7,10] 3 = Just 1`
`findBin [2,4,6,8] 7 = Just 3`

Totality: total
Visibility: public export
mkDepPairShow : Showa=> ((x : a) ->Show (bx)) =>DPairab->String
Totality: total
Visibility: public export
runIf : HasIOio=>Bool->io () ->io ()
Totality: total
Visibility: public export
pairIO : HasIOio=>ioa->iob->io (a, b)
Totality: total
Visibility: public export
rewriteAllMap : Allp (f<$>xs) ->All (p.f) xs
Totality: total
Visibility: public export
rewriteAllMap' : All (p.f) xs->Allp (f<$>xs)
Totality: total
Visibility: public export
rewriteAllMap : Allp (f<$>xs) ->All (p.f) xs
Totality: total
Visibility: public export
allToVect : Allp (replicatena) ->Vectn (pa)
  Cnvert an all to a vector if it's made out of replicated things

Totality: total
Visibility: public export
constantToVect : All (constb) xs->Vectnb
Totality: total
Visibility: public export
dTraverse : Applicativef=> ((p : pType) ->f (qp)) -> (xs : VectnpType) ->f (Allqxs)
  Dependent parametric traverse

Totality: total
Visibility: public export
recordIso : Type->Type->Type
Totality: total
Visibility: public export
Constructor: 
MkIso : (forward : (a->b)) -> (backward : (b->a)) -> ((x : a) ->backward (forwardx) =x) -> ((y : b) ->forward (backwardy) =y) ->Isoab

Projections:
.backward : Isoab->b->a
.backwardForward : ({rec:0} : Isoab) -> (y : b) ->forward{rec:0} (backward{rec:0}y) =y
.forward : Isoab->a->b
.forwardBackward : ({rec:0} : Isoab) -> (x : a) ->backward{rec:0} (forward{rec:0}x) =x
.forward : Isoab->a->b
Totality: total
Visibility: public export
forward : Isoab->a->b
Totality: total
Visibility: public export
.backward : Isoab->b->a
Totality: total
Visibility: public export
backward : Isoab->b->a
Totality: total
Visibility: public export
.forwardBackward : ({rec:0} : Isoab) -> (x : a) ->backward{rec:0} (forward{rec:0}x) =x
Totality: total
Visibility: public export
forwardBackward : ({rec:0} : Isoab) -> (x : a) ->backward{rec:0} (forward{rec:0}x) =x
Totality: total
Visibility: public export
.backwardForward : ({rec:0} : Isoab) -> (y : b) ->forward{rec:0} (backward{rec:0}y) =y
Totality: total
Visibility: public export
backwardForward : ({rec:0} : Isoab) -> (y : b) ->forward{rec:0} (backward{rec:0}y) =y
Totality: total
Visibility: public export
index : (i : Fink) ->Allpts->p (indexits)
Totality: total
Visibility: public export
testFun : Nat-> (m : Nat**VectmNat)
filter2 : (a->Bool) ->Vectlena->Vectpa
Totality: total
Visibility: public export