Commit Graph

1093 Commits

Author SHA1 Message Date
Guillaume ALLAIS
529944267b Revert "[ refactor ] Introducing Namespace and ModuleIdent (#631)"
This reverts commit 481dc431e7.
2020-09-04 09:16:06 +01:00
Niklas Larsson
71b9b9dc08
Merge pull request #611 from foss-mc/patch-racket
Improve Racket supporting code
2020-09-03 14:43:57 +02:00
G. Allais
481dc431e7
[ refactor ] Introducing Namespace and ModuleIdent (#631)
Until now namespaces were stored as (reversed) lists of strings.
It led to:

* confusing code where we work on the representation rather than say
  what we mean (e.g. using `isSuffixOf` to mean `isParentOf`)

* potentially introducing errors by not respecting the invariant cf.
  bug report #616 (but also name generation in the scheme backend
  although that did not lead to bugs as it was self-consistent AFAICT)

* ad-hoc code to circumvent overlapping interface implementations when
  showing / pretty-printing namespaces

This introduces a Namespace newtype containing non-empty lists of
strings. Nested namespaces are still stored in reverse order but the
exposed interface aims to support programming by saying what we mean
(`isParentOf`, `isApproximationOf`, `X <.> Y` computes to `X.Y`, etc.)
irrespective of the underlying representation.
2020-09-02 20:05:33 +01:00
MarcelineVQ
3e4e33110b add semigroup/monoid instances for Unit/()
quite useful to have for more complex libraries and types
2020-09-02 08:42:00 +01:00
stasoid
a70446c8ff
Clarify what 'invisible' code means in literate.rst (#615)
Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
Co-authored-by: stasoid <x@x.x>
2020-08-31 18:37:48 +01:00
Donald Thompson
ec65f101fc Update typedd.rst
Added implicit argument to exercise 5 of section 4.2
2020-08-31 18:37:14 +01:00
Guillaume ALLAIS
b449e5ae8a [ fix #361 ] Use the default totality by default 2020-08-31 16:42:53 +01:00
0xd34df00d
7dbafae052 Port Idris 1's Data.Vect.Quantifiers 2020-08-31 12:34:13 +01:00
Rodrigo B. de Oliveira
c5d1f6b4d3 Preserve foreign declaration types in Compiler.ES.ImperativeAst
So backends based on it can expose a simpler FFI.
2020-08-31 08:49:08 +01:00
MarcelineVQ
57e7f14bca add binary literals
Written via "0b" in the manner of other literals. e.g. 0b111001 = 57
2020-08-31 08:48:05 +01:00
russoul
7de26e7d75 Fix #616 2020-08-30 19:32:33 +01:00
foss-mc
d56b090c4c Add missing Data.Stream.Extra module to contrib.ipkg
I forgot to add it
2020-08-28 14:26:11 +01:00
foss-mc
4b7dc38e62 Add Data.Stream.Extra.startWith 2020-08-28 13:16:31 +01:00
foss-mc
e0e883a890
remove a reference to a function of racket/string 2020-08-28 19:23:30 +08:00
foss-mc
979424c8e4
Improve Racket supporting code 2020-08-28 19:02:04 +08:00
Guillaume ALLAIS
9c59542081 [ new ] allow auto fields in records 2020-08-28 11:38:10 +01:00
Guillaume ALLAIS
17b3bb8d3d [ fix ] parser for REPL command :log 2020-08-28 09:17:32 +01:00
Guillaume ALLAIS
c17c6fc522 [ log ] stuck functions found during evaluation 2020-08-27 19:42:52 +01:00
russoul
5d156167d3 Add dup 2020-08-27 18:30:31 +01:00
Alex Gryzlov
969f5443a9 additional refactor of Data.String.Parser 2020-08-27 15:27:52 +01:00
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
Guillaume ALLAIS
d9c0e5938e [ fix ] succInjective does not use its arguments 2020-08-27 10:14:55 +01:00
Guillaume ALLAIS
3a7b72f384 [ fix ] typo in eqTree 2020-08-27 10:14:55 +01:00
Thomas Dziedzic
a7ff5aa71f
implement HVect (#563) 2020-08-26 15:48:19 +01:00
Niklas Larsson
85ae87b07c
Merge pull request #595 from Russoul/master
Eliminate schemeCall
2020-08-25 18:27:48 +02:00
Russoul
720178ca37 Update bootstrap files V3 2020-08-25 18:05:48 +03:00
Russoul
0e408840fd Revert "Update bootstrap files V2"
This reverts commit 9acbdbfcd9.
2020-08-25 17:49:23 +03:00
russoul
9acbdbfcd9 Update bootstrap files V2 2020-08-25 17:31:36 +03:00
russoul
12194ed0b0 Revert "Update bootstrap files"
This reverts commit 906e521a71.
2020-08-25 17:21:39 +03:00
russoul
906e521a71 Update bootstrap files 2020-08-25 16:48:08 +03:00
russoul
3a9b1ac656 Add supporting code 2020-08-25 14:30:57 +03:00
russoul
50ac934747 Merge branch 'master' of https://github.com/idris-lang/Idris2 into master 2020-08-25 13:57:26 +03:00
MarcelineVQ
209de36ba0
add EitherT transformer (#590)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2020-08-25 11:14:09 +01:00
Niklas Larsson
8010f65529
Merge pull request #281 from idris-lang/concat-foreign
Make fastAppend a foreign call
2020-08-25 11:48:15 +02:00
Guillaume ALLAIS
e64a3e910c [ test ] cleanup basic044
All of these internal names are making the output fragile. This
cleanup should allow us to only have to update the golden file
when there is a genuinely interesting change.
2020-08-25 09:33:39 +01:00
Matus Tejiscak
f69443985b Revert addition to ES preamble. 2020-08-25 10:25:45 +02:00
Matus Tejiscak
e9e5ef3d6a Fix FFI specifier. 2020-08-25 10:23:07 +02:00
Matus Tejiscak
1eaecc5d66 Implement stringConcat in Node. 2020-08-25 09:46:35 +02:00
Matus Tejiscak
969a6e1a45 Make fastAppend a deprecated alias of fastConcat. 2020-08-24 19:51:23 +02:00
Matus Tejiscak
362d2204ab Make fastAppend a foreign call. 2020-08-24 19:51:22 +02:00
russoul
b1ec508a02 Eliminate SchemeCall ExtPrim 2020-08-24 19:47:16 +03:00
russoul
594105d5ac Eliminate schemeCall from the library 2020-08-24 19:38:29 +03:00
Alex Gryzlov
ef5299733a
refactor Data.String.Parser (#579) 2020-08-22 08:13:34 +01:00
G. Allais
56209de4ca
[ close #270 ] Add FC to Binder (#296) 2020-08-21 19:03:53 +01:00
Niklas Larsson
83d9374206
Merge pull request #583 from melted/api_ci
Add CI checking for the API
2020-08-21 12:53:04 +02:00
Niklas Larsson
5f1d391242 Make the run script executable 2020-08-21 12:24:23 +02:00
Niklas Larsson
de54c7feee Clean in case TTC version has changed 2020-08-21 12:08:49 +02:00
Niklas Larsson
b37387d394 Add a badge for API CI 2020-08-21 11:54:14 +02:00
Niklas Larsson
2a45854b96 Add CI checking for the API 2020-08-21 11:51:21 +02:00
lodi
3b49b10832
add extraRuntime option for Scheme backends (#578) 2020-08-21 09:34:57 +01:00