Commit Graph

95 Commits

Author SHA1 Message Date
Edwin Brady
078b5be85f
Merge pull request #144 from sysvinit/debug-trace
Port Debug.Trace from Idris 1
2019-12-06 10:38:28 +00:00
Edwin Brady
0a51a72806 Add runElab to syntax tree
Nothing done yet in the elaborator, but it's ready to be filled in later
2019-12-05 18:58:53 +00:00
Edwin Brady
07509f6103 Begin elaboration of quoting terms 2019-11-30 15:26:17 +00:00
Edwin Brady
aae3d0f718 Reorganise Language.Reflection modules 2019-11-30 13:23:03 +00:00
Edwin Brady
1c006b647a Reflect/reify for TTImp
This is further progress towards a metaprogramming system in a form
similar to Elaborator Reflection or Template Haskell, but trying to
avoid leaking too many implementation details of the elaborator itself.
2019-11-24 21:17:16 +00:00
Edwin Brady
2e9eabff71 Merge branch 'master' of github.com:edwinb/Idris2 2019-11-19 14:07:55 +00:00
Edwin Brady
ca3ea38cde Make sure Force is erased for termination checker
But only for 'Lazy', not for 'Inf'. This is necessary to build the size
change graphs correctly.
2019-11-11 19:35:23 +00:00
Molly Miller
0fb873949f Implement Debug.Trace, from Idris 1's base package 2019-10-28 20:23:11 +00:00
Michael Morgan
e6121e0935 Remove trailing whitespace from Idris sources.
This is the result of running the command:

$ find . -name '*.idr' -type f -exec sed -i -E 's/\s+$//' {} +

I confirmed before running it that this would not affect any markdown
formatting in documentation comments.
2019-10-25 14:24:25 -07:00
Edwin Brady
83673b7295
Merge pull request #125 from msmorgan/list-head-tail
Add `head` and `tail` to base/Data.List.
2019-10-19 14:00:08 +01:00
Edwin Brady
1a6c314d15
Merge pull request #119 from timsueberkrueb/add-missing-exports
Add some missing public exports
2019-10-19 13:53:23 +01:00
Michael Morgan
33110d1cda Add head and tail to base/Data.List.
These functions use the NonEmpty predicate type in order to prove
that the operation will be valid.

Implementations copied from Idris1's Prelude.List module, except without
expanding the auto implicit argument.
2019-10-16 15:49:52 -07:00
Edwin Brady
bb6d0e07a7 Fix pruning ambiguities under 'Delayed'
Need to strip the 'delayed' or we'll miss some things
2019-10-13 17:09:31 +01:00
Edwin Brady
6cebc5ca4f Add some handy list functions/properties 2019-10-13 13:59:42 +01:00
Edwin Brady
d9ff8d65a6 Allow implementations to have implicits given
See e.g. Applicative instance in Data.Vect. This allows implementations
to use implicits at run time (by default, they'd be 0 multiplicity so
erased, but it might be useful to have an index available at run time).

At the moment, the parser requires implicits to be given before
constraints. Ideally it should be possible to give them in any order.
I'll come back to this.
2019-10-13 12:32:07 +01:00
Edwin Brady
a162425384 Add curry/uncurry to Prelude 2019-10-13 12:12:49 +01:00
Edwin Brady
519415f82f Add decidable equality for List 2019-10-10 17:38:09 +01:00
Tim Süberkrüb
fb0d2b45d6 Make reverse public export 2019-10-08 21:33:05 +02:00
Tim Süberkrüb
7e72f9d2f4 Add some missing public exports 2019-10-08 21:16:41 +02:00
Edwin Brady
c6039e4fe5 Support callbacks in foreign calls to C
Currently Chez backend only
2019-09-29 17:25:26 +01:00
Edwin Brady
78e44a4353 Reading/writing buffers can fail
So, make them return and Either and wrap the scheme definitions in an
exception handler that returns an error code on failure
2019-09-28 18:33:46 +01:00
Edwin Brady
bf69b89b0d Support for buffers and file erros in Racket CG 2019-09-28 18:10:14 +01:00
Edwin Brady
65b3ddb81b Add --libdir option
This makes it easier for more complicated packages (e.g. network, which
needs to install a C shared library) to know where to put things without
having to work out the prefix themselves.
2019-09-19 13:04:39 +01:00
Edwin Brady
33780dd5e1 Merge branch 'master' of github.com:edwinb/Idris2 2019-09-14 11:34:32 +01:00
Arnaud Bailly
4194409682 remove another message to make network tests more reliable 2019-09-13 18:43:35 +02:00
Edwin Brady
412930522e Put idris version number in package install path
Since they'll be incompatible between different Idris2 versions, this
helps protect against importing the wrong thing by mistake. Also, it
means the canonical place for the version number is now the top level
Makefile.

You'll need to delete src/YafflePaths.idr before rebuilding, since it's
now generated slightly differently.
2019-09-04 16:20:26 +01:00
Edwin Brady
65db4fbf96 Put built ttcs in build/ttc, rather than build
This is so that we can put other build artefacts (e.g. executables) in
properly organised subdirectories of build, e.g. build/bin/chez,
build/bin/js, etc.
2019-09-04 12:41:16 +01:00
Edwin Brady
68b0d64879 Add parameterised pointer type
For at least a bit of safety in foreign APIs. AnyPtr has the old Ptr
behaviour.
2019-09-04 10:25:45 +01:00
Edwin Brady
bb246a072a Experimenting with a new FFI
Functions can be declared as %foreign with a list of calling
conventions, which a backend will work through until it finds one it can
understand. Currently implemented only in Chez backend. If this works
out, I'll implement it for Racket too, and remove the old primitive
functions.

There's a bit more boiler plate here than before, but it has the benefit
of being more extensible and portable between different back ends.

Some examples, pending proper documentation:

%foreign "C:puts,libc" "scheme:display"
putline : String -> PrimIO ()

%foreign "C:exp, libm.so.6, math.h"
fexp : Double -> Double

%foreign "C:initscr, ncurses_glue.so, ncurses.h"
prim_initscr : PrimIO ()
2019-09-02 17:10:48 +01:00
Edwin Brady
f123fcaf84 Display output on network test fail
This still seems to be failing on travis, so let's see what it looks
like!
2019-08-29 12:56:13 +01:00
Edwin Brady
6a0cfa125a Update network build test
Since it's just to check that it's built successful and we can send a
message back and forth, remove the diagnostic message that might come
out in a different order depending on scheduling.
2019-08-29 11:50:14 +01:00
Edwin Brady
ea75fd21a1 Merge branch 'master' of github.com:edwinb/Idris2 2019-08-29 11:10:44 +01:00
Edwin Brady
09b13eef21
Merge pull request #89 from chrrasmussen/fix-integerToNat
Fixes #88: integerToNat hangs for negative integers
2019-08-29 11:07:50 +01:00
Edwin Brady
02c5aa7b61
Merge pull request #76 from ska80/ignore-build-artifacts
Ignore build artifacts
2019-08-29 11:01:06 +01:00
Edwin Brady
8975eeafb7 Make a start on reflection 2019-08-27 15:49:21 +01:00
Edwin Brady
fb11b89a4e Make some things public export
Anything which might appear in types should be! Fixes #93
2019-08-21 17:44:17 +02:00
Christian Rasmussen
14db785ebe Fixes #88: integerToNat hangs for negative integers 2019-08-20 18:26:13 +02:00
Kamil Shakirov
a6f9fb5e18 Ignore build artifacts 2019-08-07 09:40:30 +06:00
Edwin Brady
0b692e4379 Pack/unpack should be public export
They're likely to be useful when manipulating strings in proofs.
2019-08-01 11:18:04 +01:00
Edwin Brady
89eb495d97 Merge branch 'network-lib' of https://github.com/abailly/Idris2 into abailly-network-lib 2019-08-01 11:11:45 +01:00
Arnaud Bailly
f66d681893
linked libraries should be after the source file referencing them
http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html
2019-07-31 14:13:32 +02:00
Edwin Brady
47ad8ee7f5 Propagate implicits to with clauses
Fixes #57. Also move much of the 'with' machinery to its own source
file.
2019-07-30 12:32:33 +01:00
Arnaud Bailly
d600a3980c
added back missing file extension 2019-07-29 13:15:52 +02:00
Arnaud Bailly
ec402c3c4a
reference idris_net library as idris_net.so for all OSes 2019-07-29 12:46:23 +02:00
Arnaud Bailly
75459e7fca
fix execution of network test to correctly load library 2019-07-28 22:53:05 +02:00
Arnaud Bailly
f6b746e7ac
set LD_LIBRARY_PATH for network tests to run 2019-07-28 09:53:33 +02:00
Arnaud Bailly
02978c81fc
Merge branch 'master' of https://github.com/edwinb/Idris2 into network-lib 2019-07-27 17:27:49 +02:00
Arnaud Bailly
a87639d53a
refactor code to be more compact
uses alternative branches for failed pattern matches in do-notation
2019-07-26 09:51:49 +02:00
Arnaud Bailly
87b754de45
fix execution of tests to actually fail if there's an error 2019-07-25 19:49:15 +02:00
Arnaud Bailly
055a5f2449
got a first basic test passing 2019-07-25 09:43:33 +02:00