Idris2/libs/base/Data
Guillaume ALLAIS 1d4c84171d [ refactor ] suggested during SPLV
Main change
===========

The main change is to the type of function dealing with an untouched
segment of the local scope. e.g.

```
weak : {outer, vars : _} -> (ns : List Name) ->
       tm (outer ++ inner) -> tm (outer ++ ns ++ inner)
```

Instead we now write

```
weak : SizeOf ns -> tm (outer ++ inner) -> tm (outer ++ ns ++ inner)
```

meaning that we do not need the values of `outer`, `inner` and `ns`
at runtime. Instead we only demand a `SizeOf ns` which is a `Nat`
together with an (erased) proof that `ns` is of that length.

Other modifications
===================

Quadratic behaviour
-------------------

A side effect of this refactor is the removal of two sources of
quadratic behaviour. They typically arise in a situation where
work is done on a scope of the form

```
outer ++ done ++ ns ++ inner
```

When `ns` is non-empty, some work is performed and then the variable
is moved to the pile of things we are `done` with. This leads to
recursive calls of the form `f done` -> `f (done ++ [v])` leading
to a cost quadratic in the size of `ns`.

Now that we only care about `SizeOf done`, the recursive call is
(once all the runtime irrelevant content is erased) for the form
`f n` -> `f (S n)`!

More runtime irrelevance
------------------------

In some places we used to rely on a list of names `vars` being
available. However once we only care about the length of `vars`,
the fact it is not available is not a limitation.

For instance a `SizeOf vars` can be reconstructed from an environment
assigning values to `vars` even if `vars` is irrelevant. Indeed the
size of the environment is the same as that of `vars`.
2020-08-27 10:14:55 +01:00
..
Bool Add some algebra implementations 2020-07-17 08:25:20 -05:00
Fin Port Decidable.Order from Idris1 (#543) 2020-08-18 22:26:56 +01:00
IOArray Add experimental support for linear arrays 2020-06-12 14:08:00 +01:00
List Add list lemmas (#491) 2020-07-29 10:51:07 +01:00
Nat Port Decidable.Order from Idris1 (#543) 2020-08-18 22:26:56 +01:00
Primitives Add libraries 2020-05-18 14:00:08 +01:00
Vect Simplify Vect 2020-07-12 20:59:00 -05:00
Bool.idr Function mapping Not (x=True) to x=False was added for Bools (#322) 2020-06-19 11:13:13 +01:00
Buffer.idr Merge pull request #408 from melted/buffer_api 2020-07-21 10:43:17 +02:00
DPair.idr A port of Subset and Exists from Idris1. 2020-07-04 11:03:14 +01:00
Either.idr Add various instances from stdlib interfaces (Eq, Ord, DecEq) 2020-07-26 10:47:38 +01:00
Fin.idr Simplify Fin 2020-07-07 10:48:23 +01:00
Fuel.idr add Data.Fuel 2020-06-02 17:20:42 +02:00
Fun.idr Port Decidable.Order from Idris1 (#543) 2020-08-18 22:26:56 +01:00
IOArray.idr Back to HasIO, remove MonadIO 2020-06-21 19:21:22 +01:00
IORef.idr Back to HasIO, remove MonadIO 2020-06-21 19:21:22 +01:00
List1.idr [ refactor ] introduce List1 to remove impossible case (#520) 2020-08-04 20:03:18 +01:00
List.idr [ refactor ] suggested during SPLV 2020-08-27 10:14:55 +01:00
Maybe.idr Simplify Maybe 2020-07-07 10:48:23 +01:00
Morphisms.idr Export (~>) publicly. 2020-07-20 15:55:24 +01:00
Nat.idr [ fix ] succInjective does not use its arguments 2020-08-27 10:14:55 +01:00
Ref.idr Back to HasIO, remove MonadIO 2020-06-21 19:21:22 +01:00
Rel.idr Port Decidable.Order from Idris1 (#543) 2020-08-18 22:26:56 +01:00
So.idr various stdlib updates 2020-06-11 23:14:11 +02:00
Stream.idr [ refactor ] suggested during SPLV 2020-08-27 10:14:55 +01:00
Strings.idr Revert addition to ES preamble. 2020-08-25 10:25:45 +02:00
Vect.idr Remove dependency to Vector length in deleteAt 2020-07-14 09:45:33 +01:00