Idris2Doc : Util

Util

Miscellaneous library utilities.

Reexports

importpublic Control.Monad.Reader
importpublic Data.List
importpublic Data.List.Quantifiers
importpublic Data.Nat
importpublic Data.Vect

Definitions

dflip : {0c : a->b->Type} -> ((x : a) -> (y : b) ->cxy) -> (y : b) -> (x : a) ->cxy
  A dependent variant of `flip` where the return type can depend on the input values. `dflip`
flips the order of arguments for a function, such that `dflip f x y` is the same as `f y x`.

Totality: total
Visibility: public export
0Neq : Nat->Nat->Type
  A `Neq x y` proves `x` is not equal to `y`.

Totality: total
Visibility: public export
range : (n : Nat) ->VectnNat
  All numbers from `0` to `n - 1` inclusive, in increasing order.

@n The (exclusive) limit of the range.

Totality: total
Visibility: export
enumerate : Vectna->Vectn (Nat, a)
  Enumerate entries in a vector with their indices. For example, `enumerate [5, 7, 9]`
is `[(0, 5), (1, 7), (2, 9)]`.

Totality: total
Visibility: export
range : Nat->ListNat
  All numbers from `0` to `n - 1` inclusive, in increasing order.

@n The (exclusive) limit of the range.

Totality: total
Visibility: export
enumerate : Lista->List (Nat, a)
  Enumerate entries in a list with their indices. For example, `enumerate [5, 7, 9]`
is `[(0, 5), (1, 7), (2, 9)]`.

Totality: total
Visibility: export
unique : Eqa=>Lista->Bool
  `True` if there are no duplicate elements in the list, else `False`.

This function has time complexity quadratic in the list length.

Totality: total
Visibility: public export
map : ((x : a) ->b) -> (xs : Lista) -> {auto0_ : Allpxs} ->Listb
  Map a constrained function over a list given a list of constraints.

Totality: total
Visibility: public export
multiIndex : (idxs : ListNat) -> (xs : Lista) -> {auto0_ : All (flipInBoundsxs) idxs} ->Lista
  Index multiple values from a list at once. For example,
`multiIndex [1, 3] [5, 6, 7, 8]` is `[6, 8]`.

@idxs The indices at which to index.
@xs The list to index.

Totality: total
Visibility: public export
deleteAt : (idxs : ListNat) -> (xs : Lista) -> {auto0_ : All (flipInBoundsxs) idxs} ->Lista
  Delete values from a list at specified indices. For example `deleteAt [0, 2] [5, 6, 7, 8]`
is `[6, 8]`.

@idxs The indices of the values to delete.
@xs The list to delete values from.

Totality: total
Visibility: public export
dataAll2 : (0_ : (a->b->Type)) ->Lista->Listb->Type
  A binary version of `All` from the standard library.

Totality: total
Visibility: public export
Constructors:
Nil : All2p [] []
(::) : pxy->All2pxsys->All2p (x::xs) (y::ys)
dataSorted : (a->a->Type) ->Lista->Type
  A `Sorted f xs` proves that for all consecutive elements `x` and `y` in `xs`, `f x y` exists.
For example, a `Sorted LT xs` proves that all `Nat`s in `xs` appear in increasing numerical
order.

Totality: total
Visibility: public export
Constructors:
SNil : Sortedf []
  An empty list is sorted.
SOne : Sortedf [x]
  Any single element is sorted.
SCons : (y : a) ->fyx->Sortedf (x::xs) ->Sortedf (y:: (x::xs))
  A list is sorted if its tail is sorted and the head is sorted w.r.t. the head of the tail.
inBoundsCons : (xs : Lista) ->InBoundskxs->InBoundsk (x::xs)
  If an index is in bounds for a list, it's also in bounds for a longer list

Totality: total
Visibility: public export
(>$<) : (env'->env) ->ReaderTenvma->ReaderTenv'ma
  Apply a function to the environment of a reader.

Totality: total
Visibility: export
Fixity Declaration: infixl operator, level 4