Mathew Polzin
5f34801200
Make drop and drop' public exported from the vect module.
2021-07-20 14:27:43 +01:00
Stepan Koltsov
ce44d3b50a
Change semantics of lines and unlines function to match Haskell and other languages ( #1585 )
...
* Add trailing newline on non-empty list in unlines
There are several reasons to do that:
* a line in a text file is something which ends with newline,
and the last line is not special
* `unlines []` should be different from `unlines [""]`
* `unlines (a ++ b) = unlines a ++ unlines b`
* Haskell does it
* Change lines function behaviour
2021-07-17 14:54:23 +01:00
Edwin Brady
66217b6fa6
Merge branch 'master' into refc-buffer
2021-07-16 09:44:40 +01:00
Edwin Brady
a880b9884c
Merge pull request #1670 from stepancheg/buffer-names
...
Add parameter names to Buffer builtins parameter names
2021-07-16 00:53:42 +01:00
Stiopa Koltsov
c80a502627
Return Bool from IOArray.writeArray
...
As suggested in #1677 .
Crashing on out-of-bounds might be more practical, but we can
reconsider it later.
2021-07-15 22:16:22 +01:00
Stiopa Koltsov
f81c37ea3a
Pass Buffer as char* when using C functions in RefC
...
To be able to use `C` functions for both Scheme and RefC: it was
not possible for `Buffer` before this PR.
As an example, `writeBufferData` and `readBufferData` functions are
removed: generic C backend implementations are used instead.
2021-07-13 23:04:36 +01:00
Nick Drozd
9cca3a7d35
Use Not instead of -> Void ( #1667 )
2021-07-13 15:32:01 +01:00
Johann Rudloff
d5abff4e46
[ fix #1260 ] Use blodwen-stringbytelen
instead of C's strlen
( #1261 )
2021-07-13 11:52:15 +01:00
Stiopa Koltsov
b4918d51ff
Add parameter names to Buffer builtins parameter names
...
Also rename `loc` -> `offset`.
2021-07-11 10:43:12 +01:00
Stefan Höck
599d0635e9
[ refactor ] JS backend overhaul ( #1609 )
2021-07-10 11:15:21 +01:00
Nick Drozd
61b9a3e4e5
Define and implement Relation interfaces ( #1472 )
...
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-07-09 09:06:27 +01:00
Alissa Tung
2865a70a6e
[ base ] add List functions ( #1550 )
...
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-07-01 08:00:12 +01:00
Nick Drozd
9cb20f3653
Clean up some assert_total instances ( #1644 )
2021-06-29 22:05:40 +01:00
kasiaMarek
6f9b926b1b
module Data.SnocList.Elem ( #1478 )
...
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-06-28 20:34:39 +01:00
Stefan Höck
6ed266d306
[ new ] Missing integer type interfaces ( #1629 )
...
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-06-28 20:00:10 +01:00
Fabián Heredia Montiel
d5167a0108
[ fix #1581 ] public export Range functions and implementations ( #1602 )
...
Since `[a..b]` uses `takeUntil`/`takeBefore` indirectly those too had to
be changed to `public export` clashing with `Data.Stream` definitions.
A small readability refactor was made with the `compare` function from
`EqOrd`.
2021-06-28 16:52:23 +01:00
Nick Drozd
63a6b16517
Cut unneeded type specifications
2021-06-28 16:22:27 +01:00
Kamiλ Shakirov
8e30b296c0
[ refactor ] Remove Data.Strings module ( #1607 )
2021-06-28 13:48:37 +01:00
Edwin Brady
a93def90a9
Merge github.com:idris-lang/Idris2 into prepare-040
2021-06-23 18:16:36 +01:00
Edwin Brady
5689786b26
Merge pull request #1598 from gallais/show-void
...
[ fix ] missing Show implementations in libs
2021-06-23 18:11:40 +01:00
Edwin Brady
7d3e3e0719
Check sizes of buffers and strings in TTCs
...
They need to be positive or we can't make the buffer, which causes a
segfault. This happened when loading old TTCs with a different format.
Fixes #1503
2021-06-23 18:08:27 +01:00
Guillaume ALLAIS
afd55951c2
[ fix ] missing Show (Fin n) in base
2021-06-23 16:46:25 +01:00
Edwin Brady
c1057a19af
Merge pull request #1489 from buzden/some-uninhabiteds
...
[ base ] Some lacking implementations for `Uninhabited`
2021-06-23 16:17:32 +01:00
G. Allais
49f8cefeff
[ cleanup ] Test.Golden ( #1526 )
2021-06-21 17:30:11 +01:00
CodingCellist
55f8bc3b90
Improve case-splitting formatting to not introduce new whitespace; add a bit of comments+docs. ( #1553 )
2021-06-17 16:48:59 +01:00
Nick Drozd
ec438760d9
Simplify some lambdas ( #1561 )
2021-06-16 15:22:30 +01:00
Denis Buzdalov
927c358bef
[ base ] Some lacking implementations for Uninhabited
were added
2021-06-15 15:07:54 +03:00
Nick Drozd
488b4709f4
Use map for some maybes ( #1548 )
2021-06-14 17:52:43 +01:00
Robert Wright
1875f62248
Remove freeBuffer function
...
Each backend is now responsible for freeing Buffers in the same way as other objects
2021-06-14 15:06:44 +01:00
Robert Wright
c6a5827319
Add RefC readBufferData/writeBufferData support
2021-06-14 15:06:44 +01:00
Robert Wright
d202139171
Distinguish common C and RefC Buffer functions
2021-06-14 15:06:44 +01:00
Mathew Polzin
0209cee41a
include the other definition of drop because both are quite useful.
2021-06-14 11:44:38 +01:00
Mathew Polzin
bdd8f4157b
Add drop for Vect.
2021-06-14 11:44:38 +01:00
Nick Drozd
4a0a5759b8
Return Maybe from strengthen ( #1540 )
...
Co-authored-by: Fabián Heredia Montiel <303897+fabianhjr@users.noreply.github.com>
2021-06-14 10:59:49 +01:00
Fabián Heredia Montiel
dad4dcdaf8
Add totality annotations to src
and libs/{prelude, base}
2021-06-12 21:06:08 -05:00
madman-bob
98d67499db
RefC Integer Support ( #1480 )
...
* Add utility functions to treat All as a heterogeneous container
* Distinguish RefC Int and Bits types
* Change RefC Integers to be arbitrary precision
* Add RefC Bits maths operations
* Make RefC div and mod Euclidean
* Add RefC bit-ops tests
* Add RefC integer comparison tests
* Add RefC IntN support
2021-06-03 10:44:42 +01:00
Zoe Stafford
24f7c9d5be
Add foldMap
to Foldable
( #1483 )
2021-06-01 15:05:04 +01:00
G. Allais
1fd5ccf080
[ fix #1453 ] rename cast -> coerce ( #1468 )
2021-05-26 08:12:58 +01:00
Robert Wright
cf2b05ce02
Add RefC Buffer support
2021-05-20 14:25:16 +01:00
Robert Wright
2a957a38d9
Add RefC FFI header file support
2021-05-20 14:25:16 +01:00
Ohad Kammar
618c71477e
[ close #1384 ] built-in Snoc-lists [< 1, 2, 3 ] ( #1383 )
2021-05-20 12:56:25 +01:00
Stefan Höck
66f3787cb7
[ cleanup ] Annotate JS backend sources ( #1425 )
2021-05-18 12:37:51 +01:00
G. Allais
349308396c
[ fix #621 ] add warnings for shadowed global definition ( #1407 )
2021-05-14 17:35:21 +01:00
Edwin Brady
f21a495711
Merge github.com:idris-lang/Idris2 into tweak-cg
2021-05-11 11:37:12 +01:00
G. Allais
ab241213f3
[ breaking ] making toList part of Foldable ( #1395 )
2021-05-11 08:26:00 +01:00
Denis Buzdalov
8038f0a0f9
[ refactoring ] Tiny changes following up the idris-lang/Idris2#830
...
Some zeroes in signatures, one simpler implementation and formatting.
2021-05-10 09:07:36 +01:00
Edwin Brady
c54c1a6e97
Add some inlines
...
We should really get these automatically, but until we do, add the
flags. Chez seems to spot these anyway, but again it makes the generated
code easier to look at, and it removes some needless abstraction over
interfaces at runtime.
2021-05-09 17:31:44 +01:00
Edwin Brady
7f7b11ed54
Use transforms for fastPack/fastUnpack
...
We've had these for a while, used for interface specialisation, but
they're not yet used anywhere else or properly documented. We should
document them soon, but for now, it's a useful performance boost to
always use the fast versions of pack/unpack/concat at runtime.
Also moves a couple to the prelude, to ensure that the fast versions are
defined in the same place as the 'normal' version so that the
transformation will always fire (that is, no need to import Data.String
for the transformation to work).
2021-04-29 23:17:29 +01:00
stefan-hoeck
7863636490
[ new ] add Contravariant interface
2021-04-25 10:41:36 +01:00
Ruslan Feizerakhmanov
70158b9dd1
REPL commands: load-package & fuzzy-search ( #1318 )
...
REPL commands: load-package & fuzzy-search
Move REPL-related code over to its own namespace
2021-04-25 09:13:55 +01:00
Ohad Kammar
9a445f57e6
[base] Minor: change the order of terms in the IntegerView ( #1327 )
2021-04-23 14:52:44 +01:00
Denis Buzdalov
583442b359
[ contrib ] Arithmetic on Fin ( #830 )
...
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-04-23 12:05:13 +01:00
arty
48dc732788
[ base ] Not (a == b)
implies not a == b
( #1315 )
2021-04-22 13:16:26 +01:00
Stefan Höck
61c43e5337
[ new ] Add Bifoldable and Bitraversable interfaces to Prelude ( #1265 )
2021-04-08 17:25:37 +01:00
Guillaume ALLAIS
5af1efb56e
[ refactor ] introduce NonZero
...
This has a much better behaviour with respect to proof search and
the coverage checker realising we don't need to consider the Z case
than the `Not (x = Z)` we used earlier.
2021-03-31 17:59:58 +01:00
Guillaume ALLAIS
09d8e25441
[ refactor ] more efficient implementation of range
2021-03-30 10:51:56 +01:00
stefan-hoeck
6824111fd8
[ performance ] add fastUnlines to base
2021-03-26 12:35:29 +00:00
Alex Gryzlov
71abc8e33b
Add Path@contrib & small changes ( #1229 )
2021-03-25 16:01:32 +00:00
Denis Buzdalov
0749165245
[ base ] Properties of indexing after replaceAt
were added for Vect
2021-03-18 16:07:48 +00:00
Denis Buzdalov
941e3963fa
[ base ] DecEq implementations of Fin and Vect were exported publicly
2021-03-18 16:07:21 +00:00
Andy Lok
da92f9d676
Cleanup List1 ( #1091 )
2021-03-17 14:07:52 +00:00
robert
9300d22c31
colist
2021-03-15 13:36:05 +00:00
stefan-hoeck
0fd9ed0555
[ new ] Interface implementations for Subset
2021-03-09 11:25:03 +00:00
Stefan Höck
8d4321eb9a
Add Data.Bits to base ( #1033 )
2021-03-04 20:59:56 +00:00
Stefan Höck
4c7d0db4bc
[ fix #1148 ] Support hyphenated package names ( #1151 )
2021-03-04 19:09:15 +00:00
G. Allais
cee7e38894
[ new ] Proof search from 'Applications of Applicative Proof Search' ( #1093 )
2021-03-01 08:29:43 +00:00
Denis Buzdalov
7a8c12771b
[ base ] A property of interaction between zipWith
and index
( #1128 )
2021-03-01 08:29:17 +00:00
Andy Lok
5fed5c2b7a
Merge branch 'master' of https://github.com/idris-lang/Idris2 into multiline
2021-02-25 19:52:42 +08:00
Denis Buzdalov
874496e1ae
[base] Constructor's injectivity proofs for Exists
and Subset
( #1118 )
...
Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
2021-02-24 19:11:41 +00:00
Denis Buzdalov
69be8f2102
[base] bimap
functions were added for dependent pairs.
2021-02-24 16:41:33 +00:00
G. Allais
d2eeb7ce86
[ fix #758 ] desugar non-binding sequencing in do blocks to (>>) ( #1095 )
2021-02-24 11:07:16 +00:00
Mark Barbone
0f7fa149c7
Make zip
infixr 6
2021-02-23 10:54:28 +00:00
Guillaume ALLAIS
00067e8151
[ fix #637 ] force indentation after a with
2021-02-23 10:52:22 +00:00
G. Allais
74b051589b
[ new ] Perfect binary trees ( #1063 )
2021-02-22 09:54:16 +00:00
G. Allais
30d402ed7f
[ fix #899 ] Be careful when generating an impossible LHS ( #1081 )
2021-02-22 09:53:30 +00:00
Andy Lok
22a769e6b5
Implement multiline string
2021-02-20 18:05:26 +08:00
Denis Buzdalov
b355b12cdb
Some cleanup was done. Changed code is mosly equivalent to the former.
...
A lot of useless matches of implicit arguments were removed.
2021-02-16 19:05:33 +00:00
Denis Buzdalov
4f28b92a19
Zero quantities were added to some interface usages.
2021-02-12 20:51:13 +00:00
Denis Buzdalov
123fbb7f33
weakenN
's n
parameter was made to have zero quantity.
2021-02-09 14:15:59 +00:00
SmiVan
952e20cc57
IOArray.fromList moved to HasIO
2021-02-06 20:37:15 +00:00
Stefan Hoeck
39824c6295
[new] Add Colist and Colist1 to base ( #997 )
2021-02-01 10:27:07 +00:00
Andy Lok
5b367da2c9
[ refactor ] Rename Data.Strings to Data.String (1/2) ( #987 )
2021-01-27 19:18:34 +00:00
Kamiλ Shakirov
140879f7b9
[ new ] Zippable interface ( #990 )
2021-01-27 18:23:08 +00:00
Kamiλ Shakirov
3bbf52025a
Add zip*/unzip* for List1 ( #986 )
2021-01-26 10:39:16 +00:00
mapf0ld
e15b1f0c78
[ refactor ] ltrim in terms of asList ( #894 )
...
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-01-22 15:07:23 +00:00
Kamil Shakirov
b540313c57
Add unzipWith and unzipWith3 for Stream
2021-01-22 10:41:16 +00:00
Kamil Shakirov
29cd9e86ec
Add unzipWith and unzipWith3 for Vect
2021-01-22 10:41:16 +00:00
André Videla
60527d127f
Merge pull request #554 from Sventimir/validation
...
Input validation
2021-01-22 01:30:07 +00:00
Kamiλ Shakirov
db30dd3f16
Port Data.List.unzip from Idris1 ( #972 )
2021-01-21 16:30:00 +00:00
André Videla
0c665bc952
Merge pull request #884 from mattpolzin/list-reverse-involutory
...
Add proof that list reverse is involutive into base.
2021-01-21 13:33:34 +00:00
Jakub Okoński
1376bdf3f2
libs: mark Data.Nat.lteAddRight as public export
2021-01-21 12:40:17 +00:00
Stefan Hoeck
fb08004041
removed trailing whitespace ( #955 )
2021-01-21 11:33:03 +00:00
Stiopa Koltsov
7264d40c56
Make isElem, DecEq public, not just export
...
... so they could be used in proof search.
Follow-up to #942
2021-01-18 10:37:57 +00:00
Stiopa Koltsov
b76c9d91e0
Remove trailing whitespaces and add trailing newlines
2021-01-16 10:00:03 +00:00
Denis Buzdalov
4f05d227a6
List-level quantifier conversion to element-level and vice-versa
2021-01-15 18:57:01 +00:00
Denis Buzdalov
bcc8da5a6d
Currying and uncurrying functions for dependent pairs were added.
2021-01-15 18:53:40 +00:00
Denis Buzdalov
6d2dd935c4
Special variants of DPair
as records ( #922 )
2021-01-15 17:19:20 +00:00
André Videla
c1bd61b58d
Merge branch 'master' into validation
2021-01-13 17:07:18 +00:00
Edwin Brady
3621c5d1bd
Merge pull request #879 from edwinb/no-linearity-subtyping
...
Remove linearity subtyping
2021-01-12 12:33:26 +00:00
Edwin Brady
d4abbfdae2
Add HasLinearIO
...
Ideally, liftIO would always be linear, but that has lots of knock-on
effects for other monads which we might want to put in HasIO, now that
subtyping is gone. We'll have to revisit this when we have some kind of
multiplicity polymorphism.
2021-01-11 11:24:43 +00:00