Idris2Doc : Data.AssocList

Data.AssocList

(source)

Definitions

0Key : Type
Totality: total
Visibility: public export
0(<) : MaybeKey->MaybeKey->Type
Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 6
0(<=) : MaybeKey->MaybeKey->Type
Totality: total
Visibility: public export
Fixity Declaration: infix operator, level 6
dataAL : MaybeKey->Type->Type
  A provably sorted assoc list with `Bits64` as the key type.

This is mainly useful for short sequences of key / value pairs.
It comes with O(n) runtime complexity for `insert`, `update`,
`lookup` and `delete`, but also with fast O(n) complexity for
`union` and `intersection`.

Totality: total
Visibility: public export
Constructors:
Nil : ALNothinga
(::) : (p : (Key, a)) ->ALixa-> {auto0_ : Just (fstp) <ix} ->AL (Just (fstp)) a

Hints:
Eqa=>Eq (ALma)
Foldable (ALix)
Functor (ALix)
Showa=>Show (ALma)
Traversable (ALix)
foldlKV_ : (acc-> (Key, el) ->acc) ->acc->ALmel->acc
Totality: total
Visibility: public export
traverseKV_ : Applicativef=> ((Key, a) ->fb) ->ALma->f (ALmb)
Totality: total
Visibility: public export
lookup_ : Key->ALixa->Maybea
  Lookup a key in an assoc list.

Totality: total
Visibility: public export
nonEmpty_ : ALma->Bool
Totality: total
Visibility: public export
isEmpty_ : ALma->Bool
Totality: total
Visibility: public export
pairs_ : ALixa->List (Key, a)
  Extracts the key / value pairs from the assoc list.

Totality: total
Visibility: public export
keys_ : ALixa->ListKey
  Extracts the keys from the assoc list.

Totality: total
Visibility: public export
values_ : ALixa->Lista
  Extracts the values from the assoc list.

Totality: total
Visibility: public export
length_ : ALixa->Nat
Totality: total
Visibility: public export
heq : Eqa=>ALma->ALna->Bool
  Heterogeneous equality check.

Totality: total
Visibility: public export
recordInsertRes : Key->MaybeKey->Type->Type
  Inserting a new key / value pair leads to a new assoc list where the
key at the head is either equal to the new key or the one previously
at the head.

@ k New key that was inserted
@ mk Key index of the original assoc list

Totality: total
Visibility: public export
Constructor: 
IR : AL (JustfirstKey) a-> (0_ : Either (firstKey=k) (JustfirstKey=mk)) ->InsertReskmka

Projections:
0.firstKey : InsertReskmka->Key
.pairs : ({rec:0} : InsertReskmka) ->AL (Just (firstKey{rec:0})) a
0.prf : ({rec:0} : InsertReskmka) ->Either (firstKey{rec:0}=k) (Just (firstKey{rec:0}) =mk)
0.firstKey : InsertReskmka->Key
Totality: total
Visibility: public export
0firstKey : InsertReskmka->Key
Totality: total
Visibility: public export
.pairs : ({rec:0} : InsertReskmka) ->AL (Just (firstKey{rec:0})) a
Totality: total
Visibility: public export
pairs : ({rec:0} : InsertReskmka) ->AL (Just (firstKey{rec:0})) a
Totality: total
Visibility: public export
0.prf : ({rec:0} : InsertReskmka) ->Either (firstKey{rec:0}=k) (Just (firstKey{rec:0}) =mk)
Totality: total
Visibility: public export
0prf : ({rec:0} : InsertReskmka) ->Either (firstKey{rec:0}=k) (Just (firstKey{rec:0}) =mk)
Totality: total
Visibility: public export
insert_ : (k : Key) ->a->ALixa->InsertReskixa
  Inserts a new key / value pair into an assoc list.
The result type reflects the possibilities with regard
to the head pair of the new assoc list.

Note: If the given key `k` is already present in the assoc list,
its associated value will be replaced with `v`.

Totality: total
Visibility: public export
insertWith_ : (a->a->a) -> (k : Key) ->a->ALixa->InsertReskixa
  Like `insert` but in case `k` is already present in the assoc
list, the `v` will be cobine with the old value via function `f`.

Totality: total
Visibility: public export
recordDeleteRes : MaybeKey->Type->Type
  Deleting an entry from an assoc list results in a new assoc list
the index of which is equal to or smaller than the one from
the original list.

@ m1 : Key index of the original assoc list.

Totality: total
Visibility: public export
Constructor: 
DR : ALmxa-> (0_ : m1<=mx) ->DeleteResm1a

Projections:
0.mx : DeleteResm1a->MaybeKey
.pairs : ({rec:0} : DeleteResm1a) ->AL (mx{rec:0}) a
0.prf : ({rec:0} : DeleteResm1a) ->m1<=mx{rec:0}
0.mx : DeleteResm1a->MaybeKey
Totality: total
Visibility: public export
0mx : DeleteResm1a->MaybeKey
Totality: total
Visibility: public export
.pairs : ({rec:0} : DeleteResm1a) ->AL (mx{rec:0}) a
Totality: total
Visibility: public export
pairs : ({rec:0} : DeleteResm1a) ->AL (mx{rec:0}) a
Totality: total
Visibility: public export
0.prf : ({rec:0} : DeleteResm1a) ->m1<=mx{rec:0}
Totality: total
Visibility: public export
0prf : ({rec:0} : DeleteResm1a) ->m1<=mx{rec:0}
Totality: total
Visibility: public export
prependDR : (p : (Key, a)) ->DeleteResma-> {auto0_ : Just (fstp) <m} ->DeleteRes (Just (fstp)) a
Totality: total
Visibility: export
delete_ : Key->ALma->DeleteResma
  Tries to remove the entry with the given key from the
assoc list. The key index of the result will be equal to
or greater than `m`.

Totality: total
Visibility: export
mapMaybe_ : (a->Maybeb) ->ALma->DeleteResmb
  Applies the given function to all values, keeping only the
`Just` results.

Totality: total
Visibility: export
mapMaybeK_ : (Key->a->Maybeb) ->ALma->DeleteResmb
  Applies the given function to all key / value pairs, keeping only the
`Just` results.

Totality: total
Visibility: export
update_ : Key-> (a->a) ->ALma->ALma
  Updates the value at the given position by applying the given function.

Totality: total
Visibility: export
updateA_ : Applicativef=>Key-> (a->fa) ->ALma->f (ALma)
  Updates the value at the given position by applying the given effectful
computation.

Totality: total
Visibility: export
recordUnionRes : MaybeKey->MaybeKey->Type->Type
  Result of computing the union of two assoc lists with
key indices `m1` and `m2`. The result's key index is equal to either
`m1` or `m2`

Totality: total
Visibility: public export
Constructor: 
UR : ALmxa-> (0_ : Either (m1=mx) (m2=mx)) ->UnionResm1m2a

Projections:
0.mx : UnionResm1m2a->MaybeKey
.pairs : ({rec:0} : UnionResm1m2a) ->AL (mx{rec:0}) a
0.prf : ({rec:0} : UnionResm1m2a) ->Either (m1=mx{rec:0}) (m2=mx{rec:0})
0.mx : UnionResm1m2a->MaybeKey
Totality: total
Visibility: public export
0mx : UnionResm1m2a->MaybeKey
Totality: total
Visibility: public export
.pairs : ({rec:0} : UnionResm1m2a) ->AL (mx{rec:0}) a
Totality: total
Visibility: public export
pairs : ({rec:0} : UnionResm1m2a) ->AL (mx{rec:0}) a
Totality: total
Visibility: public export
0.prf : ({rec:0} : UnionResm1m2a) ->Either (m1=mx{rec:0}) (m2=mx{rec:0})
Totality: total
Visibility: public export
0prf : ({rec:0} : UnionResm1m2a) ->Either (m1=mx{rec:0}) (m2=mx{rec:0})
Totality: total
Visibility: public export
prepLT : (p : (Key, a)) ->UnionResm1 (Justk2) a-> {auto0_ : Just (fstp) <m1} -> {auto0_ : Just (fstp) <Justk2} ->UnionRes (Just (fstp)) (Justk2) a
Totality: total
Visibility: public export
prepGT : (p : (Key, a)) ->UnionRes (Justk1) m2a-> {auto0_ : Just (fstp) <m2} -> {auto0_ : Just (fstp) <Justk1} ->UnionRes (Justk1) (Just (fstp)) a
Totality: total
Visibility: public export
prepEQ : (p : (Key, a)) -> (0_ : fstp=k) ->UnionResm1m2a-> {auto0_ : Just (fstp) <m1} -> {auto0_ : Justk<m2} ->UnionRes (Just (fstp)) xa
Totality: total
Visibility: public export
union_ : ALm1a->ALm2a->UnionResm1m2a
  Computes the union of two assoc lists.

In case of identical keys, the value of the second list
is dropped. Use `unionWith` for better control over handling
duplicate entries.

Totality: total
Visibility: public export
unionMap_ : (a->a->b) -> (a->b) ->ALm1a->ALm2a->UnionResm1m2b
  Like `union` but in case of identical keys appearing in
both lists, the associated values are combined using
function `f`. Otherwise, values are converted with `g`.

Totality: total
Visibility: public export
unionWith_ : (a->a->a) ->ALm1a->ALm2a->UnionResm1m2a
  Like `union` but in case of identical keys appearing in
both lists, the associated values are combined using
function `f`.

Totality: total
Visibility: public export
recordIntersectRes : MaybeKey->MaybeKey->Type->Type
  The result of building the intersection of two assoc lists may
contain an arbitrary new key index, which is not smaller than
the head indices of the original lists.

Totality: total
Visibility: public export
Constructor: 
IS : ALmxa-> (0_ : m1<=mx) -> (0_ : m2<=mx) ->IntersectResm1m2a

Projections:
0.mx : IntersectResm1m2a->MaybeKey
.pairs : ({rec:0} : IntersectResm1m2a) ->AL (mx{rec:0}) a
0.prf1 : ({rec:0} : IntersectResm1m2a) ->m1<=mx{rec:0}
0.prf2 : ({rec:0} : IntersectResm1m2a) ->m2<=mx{rec:0}
0.mx : IntersectResm1m2a->MaybeKey
Totality: total
Visibility: public export
0mx : IntersectResm1m2a->MaybeKey
Totality: total
Visibility: public export
.pairs : ({rec:0} : IntersectResm1m2a) ->AL (mx{rec:0}) a
Totality: total
Visibility: public export
pairs : ({rec:0} : IntersectResm1m2a) ->AL (mx{rec:0}) a
Totality: total
Visibility: public export
0.prf1 : ({rec:0} : IntersectResm1m2a) ->m1<=mx{rec:0}
Totality: total
Visibility: public export
0prf1 : ({rec:0} : IntersectResm1m2a) ->m1<=mx{rec:0}
Totality: total
Visibility: public export
0.prf2 : ({rec:0} : IntersectResm1m2a) ->m2<=mx{rec:0}
Totality: total
Visibility: public export
0prf2 : ({rec:0} : IntersectResm1m2a) ->m2<=mx{rec:0}
Totality: total
Visibility: public export
prependIS : (p : (Key, a)) -> (0_ : fstp=k) ->IntersectResm1m2a-> {auto0_ : Just (fstp) <m1} ->IntersectRes (Just (fstp)) (Justk) a
Totality: total
Visibility: public export
intersect_ : ALm1a->ALm2a->IntersectResm1m2a
  Computes the intersection of two assoc lists, keeping
only entries appearing in both lists. Only the values of
the first list are being kept.

Totality: total
Visibility: public export
intersectWith_ : (a->a->b) ->ALm1a->ALm2a->IntersectResm1m2b
  Computes the intersection of two assoc lists, keeping
only entries appearing in both lists. Values of the two
lists are combine using function `f`.

Totality: total
Visibility: public export
recordAssocList : Type->Type
Totality: total
Visibility: public export
Constructor: 
MkAL : ALfirstKeya->AssocLista

Projections:
0.firstKey : AssocLista->MaybeKey
.repr : ({rec:0} : AssocLista) ->AL (firstKey{rec:0}) a

Hints:
Eqa=>Eq (AssocLista)
FoldableAssocList
FunctorAssocList
Showa=>Show (AssocLista)
TraversableAssocList
0.firstKey : AssocLista->MaybeKey
Totality: total
Visibility: public export
0firstKey : AssocLista->MaybeKey
Totality: total
Visibility: public export
.repr : ({rec:0} : AssocLista) ->AL (firstKey{rec:0}) a
Totality: total
Visibility: public export
repr : ({rec:0} : AssocLista) ->AL (firstKey{rec:0}) a
Totality: total
Visibility: public export
foldlKV : (acc-> (Key, el) ->acc) ->acc->AssocListel->acc
Totality: total
Visibility: public export
traverseKV : Applicativef=> ((Key, a) ->fb) ->AssocLista->f (AssocListb)
Totality: total
Visibility: public export
lookup : Key->AssocLista->Maybea
  Lookup a key in an assoc list.

Totality: total
Visibility: public export
nonEmpty : AssocLista->Bool
Totality: total
Visibility: public export
isEmpty : AssocLista->Bool
Totality: total
Visibility: public export
pairs : AssocLista->List (Key, a)
  Extracts the key / value pairs from the assoc list.

Totality: total
Visibility: public export
keys : AssocLista->ListKey
  Extracts the keys from the assoc list.

Totality: total
Visibility: public export
values : AssocLista->Lista
  Extracts the values from the assoc list.

Totality: total
Visibility: public export
length : AssocLista->Nat
Totality: total
Visibility: public export
insert : Key->a->AssocLista->AssocLista
  Inserts a new key / value pair into an assoc list.
The result type reflects the possibilities with regard
to the head pair of the new assoc list.

Note: If the given key `k` is already present in the assoc list,
its associated value will be replaced with `v`.

Totality: total
Visibility: public export
insertWith : (a->a->a) ->Key->a->AssocLista->AssocLista
  Like `insert` but in case `k` is already present in the assoc
list, the `v` will be cobine with the old value via function `f`.

Totality: total
Visibility: public export
fromList : List (Key, a) ->AssocLista
Totality: total
Visibility: public export
delete : Key->AssocLista->AssocLista
  Tries to remove the entry with the given key from the
assoc list. The key index of the result will be equal to
or greater than `m`.

Totality: total
Visibility: public export
mapMaybe : (a->Maybeb) ->AssocLista->AssocListb
  Applies the given function to all values, keeping only the
`Just` results.

Totality: total
Visibility: public export
mapMaybeK : (Key->a->Maybeb) ->AssocLista->AssocListb
  Applies the given function to all key / value pairs, keeping only the
`Just` results.

Totality: total
Visibility: public export
update : Key-> (a->a) ->AssocLista->AssocLista
  Updates the value at the given position by applying the given function.

Totality: total
Visibility: public export
updateA : Applicativef=>Key-> (a->fa) ->AssocLista->f (AssocLista)
  Updates the value at the given position by applying the given effectful
computation.

Totality: total
Visibility: public export
union : AssocLista->AssocLista->AssocLista
  Computes the union of two assoc lists.

In case of identical keys, the value of the second list
is dropped. Use `unionWith` for better control over handling
duplicate entries.

Totality: total
Visibility: public export
unionMap : (a->a->b) -> (a->b) ->AssocLista->AssocLista->AssocListb
  Like `union` but in case of identical keys appearing in
both lists, the associated values are combined using
function `f`. Otherwise, values are converted with `g`.

Totality: total
Visibility: public export
unionWith : (a->a->a) ->AssocLista->AssocLista->AssocLista
  Like `union` but in case of identical keys appearing in
both lists, the associated values are combined using
function `f`.

Totality: total
Visibility: public export
intersect : AssocLista->AssocLista->AssocLista
  Computes the intersection of two assoc lists, keeping
only entries appearing in both lists. Only the values of
the first list are being kept.

Totality: total
Visibility: public export
intersectWith : (a->a->b) ->AssocLista->AssocLista->AssocListb
  Computes the intersection of two assoc lists, keeping
only entries appearing in both lists. Values of the two
lists are combine using function `f`.

Totality: total
Visibility: public export