Commit Graph

2475 Commits

Author SHA1 Message Date
Peter Hajdu
2d7ddc6e64 [ fix #472 ] Port doc about comments from Idris1 2021-08-27 14:58:35 +01:00
G. Allais
e2addcf27d
[ new ] semantic highlighting via the IDE mode (#1868) 2021-08-27 14:47:35 +01:00
loovjo
70ac0f4101 Specify libc-name for tarm64osx 2021-08-25 12:03:01 +01:00
Guillaume ALLAIS
99b005886f [ fix ] invalid Cast instances
integerToNat is only equal to `believe_me` at runtime, not at compile
time. You'd believe it cannot be a problem given that the implementation
of `Cast` is not exported but the REPL reduces everything.
2021-08-25 12:02:04 +01:00
Stefan Höck
2465418610
[ fix ] fix #1839 (#1857)
* [ fix ] fix #1839

* [ test ] console width 0 in test
2021-08-24 15:43:22 +01:00
Niklas Larsson
a940c37742
Merge pull request #1858 from stefan-hoeck/browser_putStr
[ new ] support prim__putStr in browser backend
2021-08-24 11:58:48 +02:00
stefan-hoeck
ed9a21f6bc [ new ] support prim__putStr in browser 2021-08-24 03:44:57 +00:00
Guillaume ALLAIS
4a9f00078a [ close #1313 ] test case
This was fixed by, I believe, the addition of `withExtendedNS` in #1342
2021-08-20 16:47:59 +01:00
G. Allais
8d8a135237
[ fix #1496, fix #1345 ] propagate lex & lit fails too (#1850) 2021-08-20 16:47:47 +01:00
Guillaume ALLAIS
1df84e8b5c [ fix #1635 ] Show module docstring in HTML backend 2021-08-20 14:43:07 +01:00
Guillaume ALLAIS
e1bfaa7ae0 [ cleanup ] remove commented out code
I think I'm now happy with the doc-free `:browse`.
2021-08-20 14:43:07 +01:00
Guillaume ALLAIS
6f5e5da4f5 [ pretty ] cleaning up binder names
Rather than printing

map : {__con : Functor f} -> (a -> b) -> (f a -> f b)

we print

map : Functor f => (a -> b) -> (f a -> f b)
2021-08-20 14:43:07 +01:00
Guillaume ALLAIS
2f53e565a7 [ new ] semantic highlighting for the html backend
* Refactored the annotations to be more uniform
* KindedNames now carry both a fullName and a rawName
  (useful in the HTML backend where we use the fullName for links)
* Removed the ad-hoc handling of qualified names in the html backend
2021-08-20 14:43:07 +01:00
Guillaume ALLAIS
089e2ec141 [ refactor ] introduce defNameType 2021-08-20 14:43:07 +01:00
Guillaume ALLAIS
58907de84b [ new ] specify data/record/interface 2021-08-20 14:43:07 +01:00
Daniel Kröni
370a273b35 Inline Neg implementations 2021-08-17 19:34:52 +01:00
stefan-hoeck
1e8f9b3c36 [ fix ] export Show instance for Bounds 2021-08-15 08:49:19 +01:00
Denis Buzdalov
dd7d77d416 [ visibility ] Make Monad of Vect to the visible from outside 2021-08-13 18:59:54 +01:00
Denis Buzdalov
c29dc73c62 [ base ] Add semigroup and monoid instances for Vect 2021-08-13 18:59:54 +01:00
G. Allais
c1ebc0535d
[ new ] semantic highlighting in REPL & holes (#1836) 2021-08-13 16:00:54 +01:00
André Videla
82796b3936 print full names in linear checking 2021-08-12 14:14:44 +01:00
Denis Buzdalov
23bb381f0f [ cleanup ] Small code cleanup, less mutual block and one \case use 2021-08-12 12:38:06 +01:00
Denis Buzdalov
940f588890 [ ttimp ] Add a utility function returning an FC by TTImp 2021-08-11 14:18:41 +01:00
Denis Buzdalov
c3398274d5 [ elab ] Add an ability to fail elab script with a custom FC 2021-08-11 14:18:41 +01:00
Denis Buzdalov
377b21e376 [ doc ] Remove trailing spaces from doc files 2021-08-11 12:50:02 +01:00
Denis Buzdalov
8fb18e24a1 [ fix ] Make standard monad transformer's Alternative be lazy on 2nd arg 2021-08-11 11:33:46 +01:00
Denis Buzdalov
99f1e11ddb [ cleanup ] Slightly improve readability 2021-08-11 11:33:46 +01:00
Denis Buzdalov
9357d777f6 [ base ] Relax requirement of Alternative implementation for ReaderT 2021-08-11 11:33:46 +01:00
G. Allais
21c6f4fb79
[ breaking ] remove parsing of dangling binders (#1711)
* [ breaking ] remove parsing of dangling binders

It used to be the case that

```
ID : Type -> Type
ID a = a

test : ID (a : Type) -> a -> a
test = \ a, x => x
```

and

```
head : List $ a -> Maybe a
head [] = Nothing
head (x :: _) = Just x
```

were accepted but these are now rejected because:

* `ID (a : Type) -> a -> a` is parsed as `(ID (a : Type)) -> a -> a`
* `List $ a -> Maybe a` is parsed as `List (a -> Maybe a)`

Similarly if you want to use a lambda / rewrite / let expression as
part of the last argument of an application, the use of `$` or parens
is now mandatory.

This should hopefully allow us to make progress on #1703
2021-08-10 19:24:32 +01:00
Niklas Larsson
c9f9e1e667
Merge pull request #1827 from buzden/fix-docs-linting
[ doc ] Hopefully fix the linting problem in the docs
2021-08-10 20:07:00 +02:00
Denis Buzdalov
150bffc307 [ doc ] Hopefully fix the linting problem in the docs 2021-08-10 15:11:32 +03:00
Mathew Polzin
590a9b15b3
Add a --list-packages command to the idris2 executable (#1824) 2021-08-10 09:44:53 +01:00
Tim Engler
be37e5b458 Added "lookupBetween" "leftMost" and "rightMost" to Data.SortedMap 2021-08-10 09:42:53 +01:00
Denis Buzdalov
15ccebbcf2 [ contrib ] Implementation of Zippable was added for Validated 2021-08-09 10:06:20 +01:00
Ellis Kesterton
0d6049cbcf
Fix error message for incorrect function patterns (#1816) 2021-08-09 10:00:34 +01:00
Edwin Brady
170af1e87a
Use Closures instead of NF in binders for normal forms (#1823)
* Skip forced arguments in conversion check

This isn't always safe - we have to have also checked the type of the
things we're converting - but in the place where it is safe it can be a
pretty significant saving.

* Use Closures, not NF, in Binders for normal forms

This means we don't need to reduce argument types during unification if
we don't need to. Also, we now try to avoid reducing closures during
unification if they are unified with a metavariable. Together, this
saves a huge amount of unnecessary evaluation in programs that do a lot
of compile time evaluation.

* Didn't mean to update idris2api.ipkg

* Fix dodgy merge
2021-08-08 17:05:29 +01:00
Edwin Brady
cd86340311 Skip forced arguments in conversion check
This isn't always safe - we have to have also checked the type of the
things we're converting - but in the place where it is safe it can be a
pretty significant saving.
2021-08-07 16:23:57 +01:00
Alex Humphreys
f3855d7100
Update contrib Text.Parser to match Library.Text.Parser (#1808)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-08-06 10:03:13 +01:00
Las Safin
ca95781a74 flake.nix: Use Racket's Chez for non-x86_64-linux platforms
It supports many more platforms, excerpt from the README:
> Supported platforms:
>
>     Windows: x86, x86_64
>     Mac OS: x86, x86_64, AArch64, PowerPC32
>     Linux: x86, x86_64, ARMv6, AArch64, PowerPC32
>     FreeBSD: x86, x86_64, ARMv6, AArch64, PowerPC32
>     OpenBSD: x86, x86_64, ARMv6, AArch64, PowerPC32
>     NetBSD: x86, x86_64, ARMv6, AArch64, PowerPC32
>     Solaris: x86, x86_64
>     Android: ARMv7, AArch64
>     iOS: AArch64

Link to the fork: https://github.com/racket/ChezScheme
2021-08-06 08:54:14 +02:00
Edwin Brady
1b6cc3ba1b More Scheme readback machinery
We need these things in the next version so that the next-but-one
version can have a scheme evaluator!
2021-08-05 17:01:53 +01:00
Mathew Polzin
976586ff86
Merge pull request #1806 from mattpolzin/overridable-version-suffix 2021-08-03 08:20:47 -07:00
Zoe Stafford
1669fc351b
Refactor %builtin (#1803)
* Stub for future 'identity' optimisation
I plan to add this later, but I'm using for now for
NaturalToInteger and IntegerToNatural

* Refactor `%builtin`
fixes #1799

- automatically optimise all Natural shaped things
- NaturalToInteger and IntegerToNatural now use
  new `Identity` flag (internal use only for now)
  which signals the function is identity at runtime

* Use NaturalToInteger and IntegerToNatural for Nat and Fin
Also define show fin in terms of finToInteger, for speed

* Fix name handling for %builtin

* [ tests ] fixes + #1799

* remove %builtin from libs
Add back after next version

* Use resolved names where convenient
2021-08-03 14:19:17 +01:00
Mathew Polzin
ed0c8d60bc
Merge pull request #1807 from mattpolzin/correct-gmp-install-directions 2021-07-31 12:56:42 -07:00
Mathew Polzin
52cc1554e3 get a bit more specific about the GMP library requirement. 2021-07-30 23:10:59 -07:00
Mathew Polzin
fe306f8e4b support explicitly setting a version tag during build. 2021-07-30 21:51:59 -07:00
Guillaume ALLAIS
94811ba8e7 [ ci ] bring racket builds back
A new environment seems to have solved our issue.
Cf. actions/virtual-environments#3774
2021-07-30 16:18:58 +01:00
Zoe Stafford
8e1ca0eddf
Add break in each case alt in js backend (#1796)
* Add `break` in each case alt in js backend
Fixes #1795

* Remove some uneeded `break`s

* linter

* Follow @stefan-hoeck 's advice
This is neater
Note: I renamed breakAfterAssignment because it's too much work to type

* [ test ] Test for #1795

* cleanup: remove unneeded vcat
2021-07-30 07:16:23 +01:00
Sventimir
4920601fe9
Add tests for Nat ranges and fix bad range [1,2..1] behaviour. (#1794)
Co-authored-by: Marcin Pastudzki <marcin.pastudzki@gmail.com>
2021-07-28 06:52:59 +01:00
Guillaume ALLAIS
84b064330c [ ci ] add collie & frex
[ci: libs]
2021-07-27 13:58:41 +01:00
Guillaume ALLAIS
c48fe486fa [ cleanup ] on is meant to be used with 2 arguments
The previous definition means it won't reduce until it's applied to
4 arguments which may have detrimental effects: ``f `on` fst`` would
for instance stay blocked, with some implicit arguments of the form
`DPair a b`. This means that `b` appears in a negative position in
the expression which may lead to positivity checking rejecting a
datatype defined using `on`!

I have decided to leave `g` and `f` on the LHS because I expect `on`
to be used either:
  1. partially applied to two arguments
  2. in a section if only applied to 1 and sections get eta-expanded
     by the parser so that's fine.
2021-07-27 13:58:41 +01:00