Commit Graph

1132 Commits

Author SHA1 Message Date
MarcelineVQ
961a28ee64 fix idiom brackets to account for IAlternative
Things like (,) () aren't straightforward IVar's but are IAlternative's
which present options about how the term should resolve. [| |] was not
accounting for this.
2020-09-24 15:27:40 +01:00
MarcelineVQ
315fc8ce2d change ForeignFn to use TTImp to match RawImp version 2020-09-24 09:00:00 +01:00
Guillaume Allais
6d8bd62795 [ cleanup ] we only need one ifThenElse 2020-09-23 22:20:45 +01:00
Guillaume ALLAIS
cc31076849 [ test ] more corner cases
Making sure the test can distinguish between truncating & rounding.
2020-09-23 19:48:58 +01:00
Guillaume ALLAIS
621a9202ed [ test ] making sure cast works 2020-09-23 19:48:58 +01:00
russoul
883a8df429 Fix String->Int cast on Scheme backends 2020-09-23 19:48:58 +01:00
Christian Rasmussen
091465525b Remove FArgList 2020-09-23 18:33:19 +01:00
Brandon Elam Barker
9aefc9f60c Updating info about backends in FAQ 2020-09-23 18:32:46 +01:00
G. Allais
d105dd11a7
[ breaking ] remove List1 related ambiguities (#690) 2020-09-22 15:07:40 +01:00
Jan de Muijnck-Hughes
8adfefa4e5
Added some logging information to the totality checker. (#679) 2020-09-22 12:44:13 +01:00
Ohad Kammar
e77b9b4631
[minor] Make base/Data.Nat.divNatNZ compile-time reducible (#689)
Co-authored-by: Ohad Kammar <ohad.kammar@ed.ac.uk>
2020-09-22 09:53:05 +01:00
MarcelineVQ
c4abdb4480 add Semigroup for Ordering and a -> b
useful items for applying multiple predicates, e.g.
sortBy (comparing length <+> compare)
To sort some lists elements by length and then lexographically
2020-09-21 08:07:21 +01:00
G. Allais
8d09ec9c93
[ new ] comma-separated interface parameters (#682) 2020-09-19 15:29:23 +01:00
G. Allais
3008c48f77
Adding a whole bunch of tuple sections (#680) 2020-09-19 14:51:57 +01:00
Guillaume ALLAIS
09f418f250 [ admin ] removing useless import 2020-09-16 15:45:16 +01:00
Guillaume ALLAIS
2bb95e59ef [ re #660 ] eta-contract parameter candidates 2020-09-16 15:45:16 +01:00
Guillaume ALLAIS
88c4b4d02f [ new ] mapTermM and mapTerm 2020-09-16 15:45:16 +01:00
Guillaume ALLAIS
1152aa3cdd [ re #660 ] inline lets when detecting parameters 2020-09-16 15:45:16 +01:00
Guillaume ALLAIS
644495f097 [ debug ] logging for datatype parameters 2020-09-16 15:45:16 +01:00
Guillaume ALLAIS
364ff73a1f [ refactor ] split up Core.Context
`Core.Context` is 2k+ LoC and contains a *lot* of different thins.
Rather than moving the `log` functions above of `addData` to be able
to add logging there, fork them off to independent files to make the
whole thing more readable.
2020-09-16 15:45:16 +01:00
Giuseppe Lomurno
98e54cea2f Missing runElab decl check 2020-09-16 12:06:38 +01:00
Chetan Taralekar
3c24bc5ed5
Fix ide mode repl not converting escaped characters (#665) 2020-09-16 10:55:44 +01:00
MarcelineVQ
ea0df039fe change runReader's to take state first to allow easier use
following up on the change made in 5c76053cf3
to encourage people to do it in this manner going forward
2020-09-15 22:46:07 +01:00
MarcelineVQ
19bad79847 change runState's to take state first to allow easier use 2020-09-15 09:23:41 +01:00
MarcelineVQ
5c76053cf3 change StateT, swap result parameters
Nipping this historical artifact in the bud before it roots. It's often
useful to be able to `map` directly to the result of a StateT computation
and due to how Functor works this is made harder when the tuple is
(a,state) vs (state,a)
2020-09-15 09:23:41 +01:00
Guillaume ALLAIS
65e194e9bb [ re #660 ] Positivity checking for empty types 2020-09-14 18:37:47 +01:00
Ohad Kammar
2ae330785b
[contrib] Add misc libraries to contrib (#667)
* [contrib] Add misc libraries to contrib

Expose some `private` function in libs/base that I needed, and seem like
their visibility was forgotten

I'd appreciate a code review, especially to tell me I'm
re-implementing something that's already elsewhere in the library

Mostly extending existing functionality:
* `Data/Void.idr`: add some utility functions for manipulating absurdity.
* `Decidable/Decidable/Extra.idr`: add support for double negation elimination in decidable relations
* `Data/Fun/Extra.idr`:
  + add `application` (total and partil) for n-ary functions
  + add (slightly) dependent versions of these operations
* `Decidable/Order/Strict.idr`: a strict preorder is what you get when
  you remove the diagonal from a pre-order. For example, `<` is the
  associated preorder for `<=` over `Nat`.
  Analogous to `Decidable.Order`. The proof search mechanism struggled
  a bit, so I had to hack it --- sorry.

Eventually we should move `Data.Fun.Extra.Pointwise` to `Data.Vect.Quantifiers` in base
but we don't have any interesting uses for it at the moment so it's not
urgent.

Co-authored by @gallais
2020-09-14 16:22:46 +01:00
MarcelineVQ
5673d188f3 add nicer errors for bad specifiers 2020-09-13 10:10:53 +01:00
MarcelineVQ
5acb306bf9 add ability to target scheme flavor in foreign specifiers
There's some missing flexibility in how foreign specifiers can be used with
scheme that is addressed here with minimal changes to how scheme specifiers
are read. This opens up uses for users that they otherwise would have had
to modify the compiler's support files to accomplish.
2020-09-13 10:10:53 +01:00
Ohad Kammar
cdd0d07877 [minor] Remove whitespace 2020-09-10 08:08:59 +01:00
Ohad Kammar
2ece0e438f Refactor dynamic rebinding of default totality requirement
Dynamic rebind now reinstates default if an error is raised

(following @gallais 's code review)
2020-09-10 08:08:59 +01:00
Ohad Kammar
b2a9ba651c Bugfix 654: forgot to update GenerateDef
When synthesizing clauses, allow synthesised clauses to be
partial.

It's an arbitrary choice, the other choice can be the default
option. But if the place in which we're synthesising has a non-default
choice, then we're synthesising under the wrong option too.
2020-09-10 08:08:59 +01:00
Ohad Kammar
2f5ae26f36 Fix typo 2020-09-10 08:08:59 +01:00
Ohad Kammar
0600a9ba11 Fix bug #654
Auxiliary functions introduced in elaboration (e.g., through case splits and with clauses) now
have the same totality annotation as the function they're defined in.

Moved auxiliary function `findSetTotal` into `Context.idr` since it's
now used by `ProcessDef.idr` too.

Added a totality requirement argument to `checkClause` so that the
with-clause case could propagate it to the functions it generates in
elaboration.

Sandwhich the rhs elaboration in pattern matches with code that sets
the global, default, totality requirement to the current one, and
restores the previous default afterwards. It's a bit of a hacky way to
do it, but I don't think we have a better alternative with the current
design.
2020-09-10 08:08:59 +01:00
Shay Lewis
53c2bf5885 make constructor injectivity proofs use arguments at 0 multiplicity 2020-09-09 19:57:12 +01:00
G. Allais
1963ac8786
[ fix #650 ] Lazier match in NPrimVal vs. ConCase (#655) 2020-09-09 17:17:07 +01:00
G. Allais
a0c0974676
[ debug ] pretty printer for case trees (#652) 2020-09-09 16:22:22 +01:00
russoul
9565f6cf8b Fix DPair parsing 2020-09-05 11:08:44 +01:00
G. Allais
937aa8fc43
[ refactor ] introducing Namespace (#638)
Until now namespaces were stored as (reversed) lists of strings.
It led to:

* confusing code where we work on the underlying representation of
  namespaces rather than say what we mean (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 implementation when
  showing / pretty-printing namespaces

This PR introduces a `Namespace` newtype containing a list 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-05 09:41:31 +01:00
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