Commit Graph

102 Commits

Author SHA1 Message Date
Alex Gryzlov
afde930e7a
Vect updates (#335) 2020-07-04 11:02:04 +01: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
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
Edwin Brady
8c556d0c26
Merge pull request #340 from edwinb/strefs
Control.Monad.ST and Refs interface
2020-06-20 13:16:27 +01:00
Edwin Brady
d18aac7afd Move Data.ST to Control.Monad.ST
Seems a more appropriate place in the hierarchy (also roughly consistent
with where it is in Haskell base)
2020-06-20 12:51:38 +01:00
Edwin Brady
ab03249d49 Add Data.STRef and a generic Ref interface 2020-06-20 00:46:20 +01:00
Denis Buzdalov
c121181776
Function mapping Not (x=True) to x=False was added for Bools (#322) 2020-06-19 11:13:13 +01:00
Nicolas Biri
c72cb849a8 Add missing modules in base.ipkg 2020-06-18 10:32:51 +01:00
Niklas Larsson
630e4219fc Fix unsetenv
implement Windows support
2020-06-16 12:09:22 +02:00
Nick Drozd
b096062858 Fill in missing Nat proofs 2020-06-15 14:56:19 -05:00
Niklas Larsson
4dc151086c
Merge pull request #283 from timsueberkrueb/more-file-io
Extend Control.App.FileIO
2020-06-15 14:13:17 +02:00
Tim Süberkrüb
30410eda52 Add fflush to Control.App.FileIO 2020-06-12 17:30:54 +02:00
Tim Süberkrüb
535918a3ac Deduplicate Control.App.FileIO 2020-06-12 17:30:54 +02:00
Tim Süberkrüb
e9a80891b7 Extend Control.App.FileIO 2020-06-12 17:30:54 +02:00
Alex Gryzlov
4fffdec6e8 Merge remote-tracking branch 'upstream/master' 2020-06-12 16:39:37 +02:00
Edwin Brady
c3c556f192 Merge https://github.com/idris-lang/Idris2 into linear-things 2020-06-12 14:16:01 +01:00
Edwin Brady
1c576cb068 Add experimental support for linear arrays
Backed by Data.IOArray. Also moved the array external primitives to a
separate module Data.IOArray.Prims, since the next step is to add a
linear bounded array type where the bounds checks are done at compile
time, so we'll want to read and write without bounds likes.
2020-06-12 14:08:00 +01:00
Niklas Larsson
9e4c7c3019
Merge pull request #289 from jfdm/comment-out-unimplemented-proofs-from-data-nat
Remove unsolved holes from `base`.
2020-06-12 14:57:12 +02:00
Jan de Muijnck-Hughes
da81146388 Remove unsolved holes from base.
Having unsolved holes in a 'core' library unneccessarily pollutes the list of holes shown to the user.
Thus, having unfilled holes in a 'core' library is not right.
These constructs can be re-added once the holes have been filled in.
2020-06-12 13:13:48 +01:00
Jan de Muijnck-Hughes
f7cf2dfb06 Ported safe indexing of Lists from Idris1 prelude. 2020-06-12 13:12:15 +01:00
Edwin Brady
c9b20911e1 Add linear pair/dependent pair to the prelude
I'm playing with some linear structures and finding these useful a lot,
so good to have a consistent syntax for it. '#' is chosen because it's
short, looks a bit like a cross if you look at it from the right angle
(!) and so as not to clash with '@@' in preorder reasoning syntax.
2020-06-12 11:18:12 +01:00
Alex Gryzlov
cd443f24f6 various stdlib updates 2020-06-11 23:14:11 +02:00
Edwin Brady
07ae16123c Only open in binary mode on windows 2020-06-11 14:53:54 +01:00
Edwin Brady
4b1667fdcf Open files in binary mode
Needed for windows, and harmless on Unix (Idris 1 did it this way).
2020-06-11 14:35:26 +01:00
Edwin Brady
0a246af449 Make Buffer more primitive
Meaning that the FFI is aware of it, so you can send arbitrary byte data
to foreign calls. Fixes #209

This means that we no longer need the hacky way of reading and writing
binary data via scheme, so can have a more general interface for reading
and writing buffer data in files.

It will also enable more interesting high level interfaces to binary
data, with C calls being used where necessary.

Note that the Buffer primitive are unsafe! They always have been, of
course... so perhaps (later) they should have 'unsafe' as part of their
name and better high level safe interfaces on top.

This requires updating the scheme to support Buffer as an FFI primitive,
but shouldn't affect Idris2-boot which loads buffers its own way.
2020-06-11 14:05:52 +01:00
Edwin Brady
4cc4099ace
Merge branch 'master' into nats 2020-06-08 12:11:10 +01:00
Alex Gryzlov
14002213a1 Merge remote-tracking branch 'upstream/master' 2020-06-08 00:27:58 +02:00
Nick Drozd
5665cfab21 Copy over more Nat proofs 2020-06-07 12:19:32 -05:00
Nick Drozd
4292d735eb Simplify Nat proofs
These changes are strictly nonfunctional.
2020-06-07 12:19:32 -05:00
Edwin Brady
d5e4dec119 Reflect 'display names' and record field names
These arise in interface declarations (to give a nicer way of displaying
auto generated names) and for record fields.
2020-06-07 11:51:09 +01:00
Edwin Brady
7733c85fd5 New way of instantiating metavariables
The old way only worked by chance, because the argumemt order happens to
be the same in all cases. I noticed due to some experiments elsewhere
with different ways of elaborating case, which broke that assumption.

The meaning of the list of Vars is actually the opposite of what it was
taken to be... fortunately, the performance works out roughly the same.
Also this way is (arguably) simpler, which is usually a good sign.
2020-06-06 18:43:06 +01:00
Alex Gryzlov
ca32ff9000 Merge remote-tracking branch 'upstream/master' 2020-06-04 00:23:35 +02:00
Edwin Brady
b9ac6e14db Make lambda elaborator dependent
Also remove forall, since I haven't tested it and its type was wrong
anyway. It can go back when we have a use for it...
2020-06-03 20:23:36 +01:00
Edwin Brady
3a7aedf0f4 Add reflection under (explicit) binders
This allows writing a staged well typed interpreter, for example (see
reflection008 test)
2020-06-03 09:17:37 +01:00
Alex Gryzlov
30be32cf85 Merge remote-tracking branch 'upstream/master' 2020-06-03 02:46:45 +02:00
Edwin Brady
08b56e9e75 Add quote operation to Elab
Allows quoting a term back to a TTImp. Test reflection007 shows one
possible use for this, building a reflected, type safe, representation
of an expression.
2020-06-02 23:36:20 +01:00
Edwin Brady
2a75731916 In reflection, check now takes a concrete type
So the type of Elab now gives the expected type that's being elaborated
to, meaning that we can run 'check' in the middle of scripts and use the
result.
2020-06-02 22:41:37 +01:00
Alex Gryzlov
d4f4a74fbf add Data.Fuel 2020-06-02 17:20:42 +02:00
Edwin Brady
a33136aa00 A couple more elab reflection primitives
Get the names of local variables. and add the ability to look up their
types.
When we get a reflected TTImp, either checking the Goal or looking up a
type, it's not impossible that there'll be some repeated binder names,
so also make sure binders are unique relative to the current context.
Ideally we'd also rename things in the environment to guarantee that all
names are unique, but we don't yet.

(This would be much easier if reflected terms were typed such that they
were well scoped, but that would also make reflection harder to use.)
2020-06-01 22:16:27 +01:00