Commit Graph

75 Commits

Author SHA1 Message Date
Edwin Brady
69a7640a6e Allow flagging types as externally defined
e.g. in a C file. This means we don't accidentally treat things as
empty, since previously we just defined these as empty types, but that
broke coverage checking. Fixes #240
2020-04-10 11:45:52 +01:00
Edwin Brady
7c0581a10a
Merge pull request #245 from ziman/stable-sort
Make `List.sortBy` stable
2020-03-31 18:15:27 +01:00
Edwin Brady
04c63b593f
Merge pull request #243 from deviant-forks/intercalate-list
Add `intercalate` for `Data.List`
2020-03-31 18:14:29 +01:00
Edwin Brady
7ff1e6275f Allow setting logging mid term
Sometimes this makes debugging easier since the logging is more
localised.
2020-03-30 22:55:08 +01:00
Matus Tejiscak
fcdfa8e191 Fix comment. 2020-03-29 19:50:43 +02:00
Matus Tejiscak
9154a9b02b Add comments. 2020-03-29 19:48:00 +02:00
Matus Tejiscak
2b264d0517 Make sortBy stable. 2020-03-29 19:38:54 +02:00
Marshall Bowers
5b1e8bf436 Add intercalate for Data.List 2020-03-28 13:18:51 -04:00
Edwin Brady
d666ed50c9 A couple of library functions 2020-03-19 22:14:48 +00:00
Edwin Brady
b5b9372fff Add delete and union to Data.List 2020-03-10 14:52:46 +00:00
Edwin Brady
625027f278 Add nub to Data.List 2020-02-09 21:45:36 +00:00
Edwin Brady
6f4fa7ade9 More Data.List functions 2020-02-01 13:32:30 +00:00
Edwin Brady
7d47c08140 Add Data.List.isPrefix 2020-02-01 12:57:14 +00:00
Edwin Brady
284a3ded69 Add strIndex and strTail 2020-01-31 23:06:08 +00:00
Edwin Brady
2465e5a149 Some buffer updates
Initialising buffers from files, error checking on creation, resizing.
2020-01-31 16:49:31 +00:00
Edwin Brady
854e39936e Some Data.Buffer bits
Need to know length of strings in bytes sometimes, not just characters,
to check we have enough space.
Also add copyData
2020-01-30 18:36:59 +00:00
Edwin Brady
bb6cefc0a9 Added Data.IOArray
plus scheme primitives for runtime, via vectors
2020-01-30 17:04:33 +00:00
Edwin Brady
04e4ebf80e Better approach to erasure in pattern matching
It's a big patch, but the summary is that it's okay to use a pattern in
an erased position if either:

- the pattern can also be solved by unification (this is the same as
  'dot patterns' for matching on non-constructor forms)
- the argument position is detaggable w.r.t. non-erased arguments, which
  means we can tell which pattern it is without pattern matching

The second case, in particular, means we can still pattern match on
proof terms which turn out to be irrelevant, especially Refl.

Fixes #178
2020-01-21 18:47:43 +00:00
Edwin Brady
ea8c22135c
Merge pull request #156 from clayrat/misc-fixes
Misc fixes and additions
2020-01-19 16:48:47 +00:00
Alex Gryzlov
ce15b48a78 Merge remote-tracking branch 'upstream/master' into misc-fixes 2020-01-15 22:52:38 +01:00
Ohad Kammar
be90749e22 Create a contrib directory in the standard library
Move the TailRec.idr and current poor-man's syntax for:
  equational reasoning (`Syntax.PreorderReasoning`)
  with proof           (`Syntax.WithProof`)
2020-01-09 12:54:55 +00:00
Edwin Brady
ebb1ec3a3a
Merge pull request #167 from ska80/unwords+unlines/idris1
Add unwords and unlines to base/Data.Strings from Idris 1
2019-12-07 15:28:14 +00:00
Edwin Brady
0c4301d1c2
Merge pull request #159 from ska80/integral-nat
Add an implementation of Integral for Nat
2019-12-07 15:26:50 +00:00
Edwin Brady
050fcfa45a
Merge pull request #148 from msmorgan/list-replicate
Add replicate to base/Data.List.
2019-12-06 10:59:12 +00:00
Edwin Brady
468555bb2e
Merge pull request #143 from ohad/bugfix-#133
Bugfix #133 and library support for tail-recursive list manipulation
2019-12-06 10:56:03 +00:00
Edwin Brady
262177016c
Merge pull request #147 from msmorgan/list-zip
Add zip functions to base/Data.List.
2019-12-06 10:42:11 +00:00
Edwin Brady
d9f1b01ef7
Merge branch 'master' into bugfix-#133 2019-12-06 10:28:07 +00:00
Kamil Shakirov
8afad8ef0a Add unwords and unlines to base/Data.Strings from Idris 1 2019-11-26 01:17:18 +06:00
Alex Gryzlov
1652a6be7d Merge remote-tracking branch 'upstream/master' into misc-fixes 2019-11-25 19:18:09 +03:00
Kamil Shakirov
15f6e863c4 Add implementation of Integral for Nat 2019-11-15 17:46:26 +06:00
Alex Gryzlov
f0ca75b537 add some lib fuctions from Idris1 2019-11-12 15:58:21 +03:00
Michael Morgan
9190ccf883 Add replicate to base/Data.List. 2019-10-29 16:08:13 -07:00
Michael Morgan
2a014d1e19 Add zip functions to base/Data.List.
This includes the following functions: zipWith, zip, zipWith3, zip3
2019-10-29 15:51:15 -07:00
Ohad Kammar
fd980bc92f Add tail-recursive versions for most of the Data.List functions
Also include proof the tail-recursive versions are extensionally equivalent to the non-tail-recursive one

I'm a bit worried that some of those proofs came through, as
visibility modifiers should get in the way. If they cause problems at
some future point, just delete/comment them out.
2019-10-27 04:07:01 +02: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
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
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
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
fb11b89a4e Make some things public export
Anything which might appear in types should be! Fixes #93
2019-08-21 17:44:17 +02: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
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
02978c81fc
Merge branch 'master' of https://github.com/edwinb/Idris2 into network-lib 2019-07-27 17:27:49 +02:00