Commit Graph

137 Commits

Author SHA1 Message Date
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
Nick Drozd
3b0496b8ab Port over some contrib stuff
I didn't add any export labels because none of this is actually useful
for anything, but the proofs are cool.
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
Alex Gryzlov
2ee42e777a Merge remote-tracking branch 'upstream/master' 2020-06-15 03:01:57 +02:00
Niklas Larsson
d79d1b5587 Align last row with ugly hack 2020-06-14 00:57:53 +02:00
Niklas Larsson
0afd1eb3a2 Add character printing 2020-06-13 22:09:51 +02:00
Niklas Larsson
1227f2e8a1 Add buffer dumping 2020-06-13 21:57:20 +02:00
Niklas Larsson
232c69de0d
Merge pull request #245 from FrederikVigen/master
Added fix to recvAll that doesn't use signal (Left 0)
2020-06-12 17:50:05 +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
84adbe6dc8 Be explicit about multiplicity in Array
The bootstrap version can't infer it!
2020-06-12 14:18:57 +01: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
d60feaace0 Add finalisers to Chez back end
This involves new primitives GCPtr and GCAnyPtr which are pointer types
that have finalisers attached. The finalisers are run when the
associated pointer goes out of scope.

In the test, I am assuming that the GC will only be called once, right
at the end. Otherwise, the output isn't guaranteed to be deterministic!
Let's see how this assumption holds...

This is currently Chez only. I think it'll be easy enough to add to
the Racket and Gambit back ends too.
2020-06-08 20:34:23 +01:00
Edwin Brady
4cc4099ace
Merge branch 'master' into nats 2020-06-08 12:11:10 +01:00
Edwin Brady
6b0118d7ca
Merge pull request #227 from clayrat/master
add Data.Fuel
2020-06-08 11:46:48 +01:00
Edwin Brady
e033609310
Merge pull request #207 from mb64/assert_smaller-linear
Make assert_smaller and assert_total linear
2020-06-08 10:19:33 +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
595e1768e2
Merge pull request #246 from edwinb/unifier-fix
Various fixes
2020-06-06 21:18:25 +01:00
Frederik Vigen
2f34f85e2f Added fix to recvAll that doesn't use signal (Left 0) but the size of the buffer 2020-06-06 20:51:19 +02: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
Niklas Larsson
8af183d52b
Merge pull request #217 from Sventimir/factorisation
Factors of natural numbers
2020-06-06 13:20:44 +02: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
Sventimir
7a874b28a4 Merge branch 'master' into factorisation 2020-06-03 11:13:01 +02: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
Mark Barbone
18c6c4a385
Clarify assert_{total,smaller} docs 2020-06-01 15:37:34 -04:00
Mark Barbone
58532a6a6c
Explain multiplicity 0 in assert_smaller docs 2020-06-01 15:37:34 -04:00
Mark Barbone
4bf2d11f6c
Add appropriate linearity annotation to assert_smaller and assert_total 2020-06-01 15:37:33 -04:00
Edwin Brady
d45f92fd97 Add some reflected name manipulation
genSym, for generating a unique global name, and inCurrentNS for putting
a name in the current namespace.
2020-06-01 15:13:42 +01:00