Commit Graph

980 Commits

Author SHA1 Message Date
Edwin Brady
6f933ba230
Merge pull request #221 from ziman/parser-lazy
Make the applicative combinators in `Text.Parser.Core` lazier
2020-03-18 20:35:01 +00:00
Edwin Brady
8b6527867a
Merge pull request #220 from ziman/lexer-parser-core
Add Text.{Lexer,Parser}.Core to the list of installed modules
2020-03-18 20:34:30 +00:00
Edwin Brady
745c3a4f29
Merge pull request #219 from diakopter/patch-3
various copyedits
2020-03-18 20:34:15 +00:00
Edwin Brady
c1bc4330fa Don't build run time case trees for Rig0 defs
They might match on runtime-erased things (which is okay, since they're
erased too!) and if we try building the tree, it'll report an error
incorrectly. Fixes #229
2020-03-18 20:09:11 +00:00
Edwin Brady
59b66d6134 Add prettyName
This is to display names in a user friendly way, especially case and
with block names
2020-03-18 19:33:19 +00:00
Edwin Brady
fbff80545d Add coverage006 test 2020-03-18 14:39:59 +00:00
Edwin Brady
22febdf7ff Take environment into account in coverage check
We weren't using the surrounding environment for building the patterns
for an impossible case, so getting strange errors. Fixes #228
2020-03-18 14:05:01 +00:00
Edwin Brady
1f0212c20d Update test output 2020-03-17 21:55:34 +00:00
Edwin Brady
8db29f5b35 Add --no-banner to test 2020-03-17 21:34:16 +00:00
Edwin Brady
102fb7fdb6 Coverage checker improvement
Check that none of the generated missing cases match explicitly given
clauses, which might happen if there's some overlaps in the clauses or
if there's some matching on implicits. Ignore erased argument positions
when checking the match.
2020-03-17 21:12:21 +00:00
Matthew Wilson
2c70f2b744
gitignore .so files under tests 2020-03-17 01:29:21 -04:00
André Videla
b69af3a868 Add version and file to TTCError 2020-03-13 21:43:04 +00:00
Kamil Shakirov
1704495f06 Port code examples for chapters 13 and 14 from TypeDD book 2020-03-13 09:50:22 +06:00
Edwin Brady
946881d56c Make sure we only insert 'Delay' at the top level
If we postpone unification problems, it's not necessarily at the top
level of a term, but then if we retry and find we need to insert a
'Delay' or 'Force' then it had better be at the top level or we'll get
an incorrect term. So, keep track of this in postponed constraints.
2020-03-12 14:58:06 +00:00
Edwin Brady
20686425de Use expected type on adding laziness annotations
This will be the correct one, since the annotations get us to the
expected type.
2020-03-12 11:13:50 +00:00
Edwin Brady
fc9863b275 Fix Nat optimisation hack
I dont know how I thought that was supposed to work, but it needs to get
the S and Z cases separately then build the 'if' expression, with the
default case if either are missing.
2020-03-11 17:54:38 +00:00
Edwin Brady
cd57190f44 Erase LHS before case tree compilation
I had thought this was unnecessary, because it treats erased patterns as
variables, but it turns out we do need to erase variables where they're
sometimes used in erased positions, and sometimes not, to ensure we use
the right one.
2020-03-11 16:40:32 +00:00
Edwin Brady
7c8651a70c Don't keep appending directives
This could get really big given that there'll be lots of repetition in a
bigger project, and causes a segfault due to a stack overflow.
2020-03-11 10:20:27 +00:00
Edwin Brady
8507ccbeb7 Don't use force/delay in generated scheme
It's a bit more expensive than just using a lambda, because they cache
the result in a thread safe way, and the Idris Force/Delay doesn't
promise to cache the result anywya.
2020-03-11 10:10:11 +00:00
Edwin Brady
b52a10356c Fix ! notation in lists 2020-03-11 10:09:58 +00:00
Edwin Brady
9229cdbf1f Fix order of metavariable substitution
Need to substitute the one applied to most things, or it won't want to
substitute at all. Fixes #226
2020-03-10 19:39:36 +00:00
Edwin Brady
e342fce41e Detaggability under where clauses
Need to make sure we've got the right real name for the function - this
had previously only been tested in parameters blocks where the name
doesn't change.
2020-03-10 17:07:54 +00:00
Edwin Brady
b5b9372fff Add delete and union to Data.List 2020-03-10 14:52:46 +00:00
Edwin Brady
e342559afd Postpone (don't give up) on laziness mismatch
If there's a conversion failure in unification, there could still be a
way to rescue it if one of the terms is a lazy type, so postpone rather
than giving up. Fixes #225
2020-03-10 11:58:27 +00:00
Edwin Brady
0d7f241847
Merge pull request #224 from chrrasmussen/fix-macos-build
Fix build on macOS
2020-03-09 23:07:34 +00:00
Edwin Brady
288a92424a Unifier mustn't resolve things which aren't holes
For example, delayed elaborators. If it resolves one, and it's not a
complete solution, we might end up with unsolved holes. Or - possibly
worse - we might end up with an error in a program that is silently
fixed rather than reported!

Fixes #223
2020-03-09 23:04:02 +00:00
Christian Rasmussen
645f0a809e Add import to fix build on macOS 2020-03-09 22:47:04 +01:00
Edwin Brady
1b5c763265 Fix for linearity/case/hole interaction
If there's a 'case' with multiple branches, some of which have holes, we
don't know what the effect on the usage should be, so leave it alone and
just update the hole types. It's get fully checked when all the holes
are resolved.
2020-03-09 21:24:23 +00:00
Edwin Brady
5bc11e4698 Add 'new1' to Control.App
Sometimes useful in App1 programs to add new state.
2020-03-09 21:23:56 +00:00
Matus Tejiscak
4dc0625237 Adapt Data.Sorted{Map,Set} from Idris 1. 2020-03-08 22:03:32 +01:00
Edwin Brady
b0d640fa55 Some tiny updates
Most importantly: Case operators should not be inlined indiscriminately,
because that might duplicate work (e.g. via a variable pattern for the
scrutinee, where the variable is used more than once)
2020-03-08 20:10:08 +00:00
Matus Tejiscak
9f793c31aa Change Lazy to Inf. 2020-03-08 20:53:39 +01:00
Matus Tejiscak
a32d1ca50f Make the applicative combinators in Text.Parser.Core lazy. 2020-03-08 20:35:08 +01:00
Matus Tejiscak
952d5c3c00 Add Text.{Lexer,Parser}.Core to the list of installed modules. 2020-03-08 20:23:27 +01:00
Edwin Brady
25843793c7 Improve linearity in Control.App
There are a few things that have linear usage but wasn't explicit in
types, so this will make some things easier to use in linear protocols.
2020-03-08 12:53:59 +00:00
Matthew Wilson
6c11d7a162
various copyedits 2020-03-07 23:18:49 -05:00
Edwin Brady
34044597c0
Merge pull request #213 from ska80/prelude/getchar-putchar
Add getChar, putChar and putCharLn to prelude
2020-03-07 14:15:22 +00:00
Edwin Brady
1bcc428147
Merge pull request #211 from ska80/repl-cwd
Add 'cwd' REPL command to show the current working directory
2020-03-07 14:14:15 +00:00
Edwin Brady
28f47963df
Merge pull request #215 from ska80/fix-bsd-sed
Make BSD 'sed' happy
2020-03-07 14:06:38 +00:00
Arnaud Bailly
3a98ce91ea cope with different number of :ok return values 2020-03-06 19:20:25 +01:00
Edwin Brady
dcaaed2060 Remove -DHAS_PTHREAD from rts
We don't use it (the performance overhead is too much) so don't require
it to be linked in.
2020-03-06 15:48:01 +00:00
Edwin Brady
2eb9a52727 Tests need to know where to find idris_net.so 2020-03-06 15:38:47 +00:00
Edwin Brady
09447e3dc6 Add our own version of fileModifiedTime
This is needed to get the time correctly on 32 bit systems (for example,
a Raspberry Pi!) otherwise it reports a negative number for the current
time...
2020-03-06 09:30:33 +00:00
Kamil Shakirov
2d1f35ab21 Fix indentation 2020-03-06 12:36:43 +06:00
Kamil Shakirov
0e01c2aa0b Make BSD 'sed' happy 2020-03-06 12:32:16 +06:00
Edwin Brady
edc3e2a4cd Need the network libs in the path for tests 2020-03-05 18:46:26 +00:00
Edwin Brady
9060b24f2f Move network test to chez test suite 2020-03-05 18:03:12 +00:00
Edwin Brady
2c2acdcfac Reorganise build system to go via generating C
This has two main advantages: firstly, it actually makes the build slightly
faster and less memory intensive, because Idris doesn't fork a new
process and eat all the memory! Secondly, it means we can build a
distribution with the C file, for building on machines which don't have
Idris 1 available.

Also includes a script for building such a distribution.

I expect someone who is better a writing Makefiles than me can tidy this
up. There are almost certainly problems on Windows too - please help if
you can!

There are new Make targets 'all-fromc' and 'install-fromc' which don't
require building from Idris source, so that we can build with no Idris 1
available.

A small consequence: make install-exec no longer builds the idris2
executable, just installs it.
2020-03-05 17:16:20 +00:00
Edwin Brady
1dd81ff10b Look under . for function name on lhs
Need this to rule out some ambiguous names. Fixes #204.
2020-03-05 11:22:48 +00:00
Edwin Brady
fc0cfcb22b
Merge pull request #210 from ska80/chez010-test-makefile
Use Makefile for tests/chez/chez010
2020-03-05 10:31:45 +00:00