Commit Graph

141 Commits

Author SHA1 Message Date
Ohad Kammar
915b7bea38 Add various instances from stdlib interfaces (Eq, Ord, DecEq)
For Void and Either

This is because I ended up using them elsewhere, so why not include them in the stdlib.

Also expose left/rightInjective functions, as are used in the DecEq proofs.
2020-07-26 10:47:38 +01:00
Niklas Larsson
8a210d536e
Merge pull request #408 from melted/buffer_api
Add concatBuffers and splitBuffer to Data.Buffer
2020-07-21 10:43:17 +02:00
Jonathan Chan
dab2b0d146 Export (~>) publicly.
If `(~>)` isn't publicly exported, the type checker doesn't know that `Mor` constructs something of type `~>`.
2020-07-20 15:55:24 +01:00
Edwin Brady
f303e469fb Improve elaborator reflection performance
In a 'Bind', normalise the result of the first action, rather than
quoting the HNF. This improves performance since the HNF could be quite
big when quoted back.

Ideally, we wouldn't have to quote and unquote here, and we can probably
achieve this by tinkering with the evaluator.

This has an unfortunate effect on the reflection002 test, in that the
"typed template Idris" example now evaluates too much. But, I think the
overall performance is too important for the primary motivation
behind elaborator reflection. I will return to this!
2020-07-17 15:18:23 +01:00
G. Allais
0908e76515
[ fix #346 ] Pull List.length into prelude (#450) 2020-07-14 12:15:57 +01:00
Nicolas Biri
aba76206c9 Remove dependency to Vector length in deleteAt 2020-07-14 09:45:33 +01:00
Nick Drozd
e14a589e90 Consolidate boolean expressions 2020-07-12 21:00:33 -05:00
Nick Drozd
6519b5608d Further simplify List 2020-07-12 21:00:33 -05:00
Nick Drozd
718da3d7e6 Simplify Vect 2020-07-12 20:59:00 -05:00
Edwin Brady
b3bb73cfd6
Merge pull request #455 from edwinb/export-nat-prfs
Data.Nat proofs should be exported
2020-07-10 23:30:09 +01:00
Edwin Brady
58e28170ac Data.Nat proofs should be exported
I assumed these were copied directly from the Idris 1 libraries, where
there was an %access directive that we don't have any more.
2020-07-10 22:59:46 +01:00
Jan de Muijnck-Hughes
fcbfcf6fe2 Added take to Vect. 2020-07-10 21:00:38 +01:00
Ohad Kammar
eceaf98007 Generalise cons-specialised linear zipWith to linear zipWith (lzipWith) 2020-07-10 17:17:19 +01:00
Ohad Kammar
8f09ef9b93 Include a (non-linear) definition for transpose that uses zipWith,
as it might be easier to reason about, since users may already have proved
stuff about zipWith that they want to reuse
2020-07-10 12:47:05 +01:00
Edwin Brady
23cbc28b1d
Merge pull request #415 from rbarreiro/javascript
Javascript
2020-07-08 22:27:58 +01:00
Matus Tejiscak
3484510f5a Implement postfix dotted application. 2020-07-07 21:06:35 +01:00
Rui Barreiro
2feb4b8299 Merge branch 'master' of github.com:idris-lang/Idris2 into javascript 2020-07-07 14:18:00 +01:00
Markus Pfeiffer
63ddd149ed Remove a superflousy declared argument to idris2_openFile
This didn't cause a problem before as it was likely just ignored by the C
function. According to Edwin the extra argument is a leftover from when this
was a pure scheme call.
2020-07-07 11:44:37 +01:00
Nick Drozd
2ae6e06565 Simplify Fin 2020-07-07 10:48:23 +01:00
Nick Drozd
7d1ee9dd08 Simplify Equality 2020-07-07 10:48:23 +01:00
Nick Drozd
48fe4382eb Simplify List 2020-07-07 10:48:23 +01:00
Nick Drozd
877f3702ad Simplify Maybe 2020-07-07 10:48:23 +01:00
Nick Drozd
465be9cb86 Simplify Either 2020-07-07 10:48:23 +01:00
Nick Drozd
faabbfcea1 Add some Uninhabited implementations 2020-07-07 10:48:23 +01:00
Nick Drozd
7c923944ae Add %default total to a few modules 2020-07-07 10:48:23 +01:00
Rui Barreiro
3acc30599e Merge branch 'master' of github.com:idris-lang/Idris2 into javascript 2020-07-06 17:09:11 +01:00
Rui Barreiro
68c9990c8a moved big foreign functions to support and added outputDir 2020-07-06 16:58:02 +01:00
Rui Barreiro
b3216758e9 Merge branch 'master' of github.com:idris-lang/Idris2 into javascript 2020-07-06 11:32:59 +01:00
Niklas Larsson
bba15974a5 Add takeWhile
add substring and length primitives to Data.Strings
2020-07-05 21:51:11 +02:00
Edwin Brady
5487290499
Merge pull request #282 from ether42/master
Fix MkRecord signature
2020-07-05 14:03:57 +01:00
Rui Barreiro
88f8e745b1 Merge branch 'master' of github.com:idris-lang/Idris2 into javascript 2020-07-05 12:19:45 +01:00
Jan de Muijnck-Hughes
874236aac0 A port of Subset and Exists from Idris1.
The ports are rather straight forward and I have purposefully written
the documentation to be beginner friendly.

Note, I have diverged from Idris1 over the naming of the projection
functions to make them consistent with `Pair` and `DPair`.
2020-07-04 11:03:14 +01:00
Alex Gryzlov
afde930e7a
Vect updates (#335) 2020-07-04 11:02:04 +01:00
Niklas Larsson
862bbeb308 Reverse the size check
I'm unsure how it would handle zero-size buffers if size==pos and no one
would need those anyway.
2020-07-04 11:37:51 +02:00
Niklas Larsson
ce3096f919 Add concatBuffers and splitBuffer to Data.Buffer
Expand the buffer test.
2020-07-04 02:25:41 +02:00
Guillaume ALLAIS
bd14d37ddc [ fix ] make some exports public 2020-07-03 12:01:09 +01:00
Jan de Muijnck-Hughes
5abf053818 Fixed visibility of some list functions. 2020-07-03 11:59:55 +01:00
Niklas Larsson
6673f49731 Convert Data.Buffer to HasIO 2020-07-01 23:33:30 +02:00
André Videla
cec56561c6
Merge pull request #387 from LibreCybernetics/fix-export-vect
Make Applicative implementation of Vect n public export.
2020-07-01 17:26:08 +01:00
Mark Barbone
4916dd23a9
Make Data.Vect linear (#333) 2020-06-30 15:05:19 +01:00
Fabián Heredia Montiel
e488c6cf0e Make applicative implementation of Vect public export 2020-06-29 18:27:57 -05:00
Ohad Kammar
6683a2147f Export the lengthCorrect proof, as users might want to use it
Change the `len` to be irrelevant, as it's uniquely determined by
matching on the input vector
2020-06-27 15:54:35 +01:00
Edwin Brady
5ed27947cb Small concurrency fixes
Conditional variables with timeout in Chez didn't work, so changed to a
consistent meaning of the timeout (microseconds). Also fix linearity of
unsafePerformIO.
2020-06-23 19:06:30 +01:00
Edwin Brady
1e6314c4cc
Merge pull request #345 from edwinb/hasio
HasIO interface for IO actions
2020-06-21 20:24:29 +01:00
Edwin Brady
dbdf7dab3d Back to HasIO, remove MonadIO
Following a fairly detailed discussion on slack, the feeling is
generally that it's better to have a single interface. While precision
is nice, it doesn't appear to buy us anything here. If that turns out to
be wrong, or limiting somehow, we can revisit it later. Also:

- it's easier for backend authors if the type of IO operations is
  slightly less restrictive. For example, if it's in HasIO, that limits
  alternative implementations, which might be awkward for some
  alternative back ends.
- it's one less extra detail to learn. This is minor, but there needs to
  be a clear advantage if there's more detail to learn.
- It is difficult to think of an underlying type that can't have a Monad
  instance (I have personally never encountered one - if they turns out
  to exist, again, we can revisit!)
2020-06-21 19:21:22 +01:00
Rui Barreiro
ca0c8f9d42 node018 passes 2020-06-21 17:54:50 +01:00
Edwin Brady
28855088c2 Split HasIO into HasIO and MonadIO
For things which don't require (>>=), HasIO is fine, otherwise MonadIO
gives access to the monad interface.
2020-06-21 14:46:14 +01:00
Matthew Baulch
916c3e7090 Import fgetc and listen from libc (where they actually reside) rather than the support libs 2020-06-21 15:24:45 +10:00
Edwin Brady
d12487f529 HasIO interface for IO actions
Also updates the Prelude and some base libraries to use HasIO rather
than using IO directly.
2020-06-21 01:18:43 +01:00
Rui Barreiro
1d2f3d8883 Merge branch 'master' of github.com:idris-lang/Idris2 into javascript 2020-06-20 15:11:08 +01:00