Commit Graph

805 Commits

Author SHA1 Message Date
Edwin Brady
4389224694 Merge github.com:idris-lang/Idris2 into caseofcase 2021-05-08 18:19:21 +01:00
Edwin Brady
196194c73f Add case-of-case transform
This lifts case blocks out of the scrutinee of a case expression, in
some limited but useful circumstances.
2021-05-07 10:17:51 +01:00
Ruslan Feizerakhmanov
af7edd72bb [prelude] Add explicit constructor to every interface 2021-05-06 18:32:51 +03:00
Edwin Brady
587f73a256 Make documentation from Makefile
The documentation is now also linked from
https://www.idris-lang.org/pages/documentation.html
and https://www.idris-lang.org/pages/idris-2-documentation.html
2021-05-01 17:09:25 +01:00
Edwin Brady
ad78f8210a
Merge pull request #903 from cypheon/mkdoc
WIP: Generate documentation from source code (aka `--mkdoc` support)
2021-05-01 16:26:19 +01:00
Edwin Brady
d6d68ff09b
Merge pull request #1195 from buzden/some-funs-to-lazy-list
[ contrib ] Some functions for lazy list + fix for `foldlM`
2021-05-01 16:18:24 +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
Johann Rudloff
8d21a292d0 Add Text.PrettyPrint.Prettyprinter.Render.HTML to contrib as well 2021-04-29 13:49:04 +02:00
G. Allais
96a2809f62
[ fix #1169 ] primitive types are not NTCon (#1340) 2021-04-28 09:33:27 +01:00
stefan-hoeck
0858c26dcf [ refactor ] renamed value to runConst 2021-04-25 10:41:36 +01:00
stefan-hoeck
7863636490 [ new ] add Contravariant interface 2021-04-25 10:41:36 +01:00
stefan-hoeck
047fdb50dd [ new ] missing Identity implementations 2021-04-25 10:41:36 +01:00
stefan-hoeck
cb7add2eca [ new ] add Const applicative functor 2021-04-25 10:41:36 +01:00
Guardian Spirit
15bd6823d2
Add identity cast (#1332) 2021-04-25 09:22:01 +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
Johann Rudloff
489b85aae5 PrettyPrint: Fix SimpleDocTree.fromStream dropping parts of documents
When flattening the `SimpleDocTree` created from a `SimpleDocStream`, the
first part of a concatenated doc was sometimes dropped, depending on the
result of the recursive call to `flatten`.
2021-04-25 09:10:22 +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-hoeck
181b26b250 [ fix ] broken unicode parsing in JSON 2021-04-22 10:59:14 +01:00
Tung Alissa
1bf46bc458
[ REPL ] Improving :doc (fixity, totality, colours) (#1316)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-04-21 09:39:18 +01:00
Guillaume ALLAIS
96cc7fd273 [ new ] depthFirst, findFile 2021-04-19 10:58:40 +01:00
G. Allais
5946442dc2
[ new ] idris2 --init (#1299) 2021-04-15 14:08:50 +01:00
Zoe Stafford
52af4bf3c7
Add missing modules to contrib.ipkg (#1302) 2021-04-14 22:51:00 +01:00
Niklas Larsson
473b8ee740 Windows test fixes
Translate node error codes
Strip 'b' from flags
Simplify directory wrangling in chez016
2021-04-12 18:47:57 +02:00
Niklas Larsson
b32a2593ff Node fixes
Don't assume that errno exists. There might never have been an error.

Quote executable path to handle path with spaces.
2021-04-12 16:43:54 +02:00
Niklas Larsson
69c29269ed add tests to Windows CI 2021-04-12 15:48:46 +02:00
Raoul Hidalgo Charman
1211f860b6
Fix issues with use of unix sockets (#1284)
This change adds logic to set up sockaddr correctly for connect and
bind, handles the AF_UNIX case for getSockAddr and expands the existing
test to cover unix sockets.
2021-04-12 11:22:45 +01:00
Niklas Larsson
bb59efa395
Merge pull request #1269 from melted/fix_arg_prims
Replace prim__getArgs with prim__getArgsCount and prim__getArg
2021-04-11 09:40:56 +02:00
G. Allais
b7bdd0a99f
Various improvements (#1286) 2021-04-09 13:02:37 +01:00
Niklas Larsson
9ffc346ebb
Use file extensions when looking for exes on windows (#1268)
Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
2021-04-08 21:11:34 +01:00
Ruslan Feizerakhmanov
0cef4e3743 Introduce aliases L0 & L1 as specialised versions of L 2021-04-08 21:11:03 +01:00
Ruslan Feizerakhmanov
8d806552b0 Add explicit names in place of underscores 2021-04-08 21:11:03 +01:00
Ruslan Feizerakhmanov
2548f11d52 Make the SM more explicit 2021-04-08 21:11:03 +01:00
Ruslan Feizerakhmanov
1a7dc83ccb Fix a linearity leak in network; expose error codes to the user 2021-04-08 21:11:03 +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
23b67d18ab [ lint ] remove trailing whitespace 2021-04-07 16:33:59 +01:00
Niklas Larsson
084997a880 Replace prim__getArgs with prim__getArgsCount and prim__getArg
This spares us from having to build Idris data structures in the foreign
code.
2021-04-03 10:45:02 +02: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
Ruslan Feizerakhmanov
802113772f Tune precedence of (===), (~=~) and (<+>) 2021-03-29 11:29:58 +01:00
CodingCellist
ec77ad21ab
[ re #1185 ] Add primitive for obtaining number of processors (#1209)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-03-26 18:27:25 +00:00
stefan-hoeck
6824111fd8 [ performance ] add fastUnlines to base 2021-03-26 12:35:29 +00:00
Zoe Stafford
028f82f70c
Add Data.Monoid.Exponentiation to contrib.ipkg (#1232) 2021-03-26 12:35:19 +00:00
Denis Buzdalov
a6a82a18b5 [ prelude ] foldlM was made to be in the Foldable interface. 2021-03-26 00:59:13 +03:00
Denis Buzdalov
9ee0063a7f [ contrib ] Some useful functions were added for lazy lists. 2021-03-26 00:59:13 +03:00
Alex Gryzlov
71abc8e33b
Add Path@contrib & small changes (#1229) 2021-03-25 16:01:32 +00:00
G. Allais
97fb5d7b94
[ fix #893 ] proof gadget for with clauses (#1222) 2021-03-25 10:02:06 +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
Guillaume ALLAIS
80f8a0f8fe [ re #1185 ] add threads option to test runner 2021-03-16 14:03:46 +00:00
Denis Buzdalov
c7f510c9de [ fix ] Change one implementation according to recent lib change 2021-03-15 15:18:16 +00:00
Denis Buzdalov
cf981d4c68
Validated data structure was added (#1098) 2021-03-15 14:33:01 +00:00
CodingCellist
89a84a34a4
Patch CVs and sleep in Racket (#1059) 2021-03-15 13:43:12 +00:00
Stefan Höck
1784593abb
[ new ] Applicative and Monad for Pair (#1188) 2021-03-15 13:42:04 +00:00
robert
9300d22c31 colist 2021-03-15 13:36:05 +00:00
Edwin Brady
17cdc7fa88
Merge pull request #1171 from edwinb/fix1163
Correct multiplicities when checking Pi binders
2021-03-09 18:36:08 +00:00
Mathew Polzin
06586d401a
Add a test package to the Idris 2 project (#1162) 2021-03-09 18:27:05 +00:00
Edwin Brady
04a0f5001f Correct multiplicities when checking Pi binders
We've always just used 0, which isn't correct if the function is going
to be used in a runtime pattern match. Now calculate correctly so that
we're explicit about which type level variables are used at runtime.

This might cause some programs to fail to compile, if they use functions
that calculate Pi types. The solution is to make those functions
explicitly 0 multiplicity. If that doesn't work, you may have been
accidentally trying to use compile-time only data at run time!

Fixes #1163
2021-03-09 17:23:05 +00:00
stefan-hoeck
0fd9ed0555 [ new ] Interface implementations for Subset 2021-03-09 11:25:03 +00:00
Donovan Crichton
8d4e7cc581
List elem extra move/rename (#1165) 2021-03-07 18:00:03 +00:00
Donovan Crichton
06c4daa9bc [ fix ] added Data.Elem.Extra to contrib.ipkg
Added the missing module path in contrib.ipkg.
2021-03-07 11:56:23 +00:00
G. Allais
1d96dd2bd7
[ refactor ] generalise open union machinery (#1157) 2021-03-05 09:28:23 +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
stefan-hoeck
d952741563 [new] instances for SortedMap and Set 2021-03-04 14:54:27 +00:00
Donovan Crichton
2de2ac2e2c
[ new ] Lemmas: append preserves List membership. (#1152) 2021-03-04 14:50:10 +00:00
Denis Buzdalov
2bb8ff90e2 [contrib] Existing natToFinLTE was reimplemented to have 0 LT argument 2021-03-01 08:31:09 +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
Edwin Brady
4726c32d94 Add --ignore-missing-ipkg flag
When bootstrapping, we're building things without packages being
available, so we can't expect to find them when looking for
dependencies. So, we find them another way, with an environment
variable. This flag is to tell Idris not to worry about missing
dependencies in this situation.

We also need to update the bootstrapping code, to deal with the new
version number format and new flag in the ipkg files for the libraries.
I think it's still safe to build from the previous version though - lets
see if CI agrees!
2021-02-27 19:39:47 +00:00
Edwin Brady
37cc095f7a Merge github.com:idris-lang/Idris2 into versions 2021-02-27 18:00:18 +00:00
Edwin Brady
1052c41a3c Use version number field in ipkg
Packages are now installed in a directory with their version number.
On adding a package directory, we now look in a local 'depends'
directory first (to allow packages to be installed locally to another
project) before the global install directory.
Dependencies can have version bounds (details yet to be implemented) and
we pick the package with the highest version number that matches.
2021-02-27 14:15:19 +00:00
André Videla
aa27ccbdb6
Merge pull request #1097 from andylokandy/multiline
Implement multi-line string
2021-02-26 21:50:54 +00:00
Denis Buzdalov
9b5a773376 Double fixity/priority definition of >> in a single file was removed 2021-02-26 14:20:49 +00:00
G. Allais
59de5f1326
[ fix #762 ] Different case tree building strategy (#1125) 2021-02-26 09:33:07 +00:00
claymager
33e336ad27
Give App1 implementation of (>>) (#1122) 2021-02-25 17:09:24 +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
Denis Buzdalov
95af3cf4be
More compose instances and one usage of them (#1089) 2021-02-23 10:53:43 +00:00
Guillaume ALLAIS
00067e8151 [ fix #637 ] force indentation after a with 2021-02-23 10:52:22 +00:00
Dong Tsing-hsuen
505224e9fc
[ typo ] Enum -> Range (#1099) 2021-02-22 10:05:08 +00:00
Donovan Crichton
1b9a220c42 Added comment descriptions for FC and FilePos. 2021-02-22 09:55:34 +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
Mathew Polzin
c3a42966e7 fix indentation in Golden so that prompt happens after both paths under expected and actual outputs don't match. 2021-02-22 09:39:57 +00:00
Andy Lok
22a769e6b5 Implement multiline string 2021-02-20 18:05:26 +08:00
Guillaume ALLAIS
5b5bdfe769 [ contrib ] Positions in strings
This is an alternative to using `fastUnpack` and `fastPack` to work
on lists of characters.

Using this to refactor the lexer and benchmarking the resulting
compiler on building idris2 shows it's 3 to 5s slower than the
current implementation that goes via `List Char`.

This may be backend-dependent so I still push this to contrib,
with the plan of running further benchmarks in the future.
2021-02-18 17:52:25 +00:00
Mathew Polzin
d5d0b64b4a
withFile & writeFile cleanup (#1085) 2021-02-18 17:51:45 +00:00
Mathew Polzin
9f8a8b5d76
Add a total way of reading files in. (#1070) 2021-02-18 11:13:25 +00:00
Stiopa Koltsov
1cf9de4021 Hide countFrom function from prelude
`countFrom` must have been made public accidentally:
* it is defined in the ranges section of the file, not stream section
* it is used only in `Range` implementation
* the same function `iterate` is defined in `Data.Stream`

```
countFrom start next
```

is the same as

```
iterate next start
```
2021-02-16 19:20:54 +00: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
0ac34538ec A function from Not (x = y) to decEq x y = No _ was added. 2021-02-16 12:43:50 +00:00
Giuseppe Lomurno
70d1505c5c Change PreorderReasoning arguments to 0 2021-02-14 15:12:17 +00:00
Denis Buzdalov
4f28b92a19 Zero quantities were added to some interface usages. 2021-02-12 20:51:13 +00:00
Michael Messer
4baacc322b Generalize Category 2021-02-11 09:38:26 +00:00
russoul
b8aaaf3275 Add named instances for functor & applicative composition 2021-02-10 18:00:14 +00:00
G. Allais
8ba3d8572b
[ new ] Data.OpenUnion (#1050) 2021-02-10 15:25:35 +00:00
Ohad Kammar
aa72203fc8
Preliminary datatypes for telescopes (#703)
Co-authored-by: Ohad Kammar <ohad.kammar@ed.ac.uk>
Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
2021-02-09 14:18:41 +00:00
Denis Buzdalov
123fbb7f33 weakenN's n parameter was made to have zero quantity. 2021-02-09 14:15:59 +00:00
stefan-hoeck
8102e9e495 add Data.Int.Order to contrib.ipkg 2021-02-07 11:49:35 +00:00
SmiVan
952e20cc57 IOArray.fromList moved to HasIO 2021-02-06 20:37:15 +00:00
Wen Kokke
bd683938bf
Overhaul of concurrency primitives (#968)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-02-05 16:16:20 +00:00
GustavoMF31
7f495999bd
Make :typeat a useful command (#998)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2021-02-05 16:15:40 +00:00
G. Allais
d9e0841245
[ contrib ] support for C backend (#1015) 2021-02-02 15:31:30 +00:00
Denis Buzdalov
5beda25da6 Seemingly outdated and non-typechecking module was removed. 2021-02-01 16:10:54 +00:00
Kamil Shakirov
173edb14a6 Remove unused modules 2021-02-01 14:26:18 +00:00
Stefan Hoeck
39824c6295
[new] Add Colist and Colist1 to base (#997) 2021-02-01 10:27:07 +00:00
Stiopa Koltsov
cff7db38cb Control.App: use new type instead of Void as marker for I/O
Took me some time to figure out that `Void` means `IO`.

Express that knowledge more explicitly.
2021-01-31 11:58:10 +00:00
Denis Buzdalov
72229e3232 Important LazyList's operations were made to be truly lazy. 2021-01-27 19:38:08 +00:00
Andy Lok
5b367da2c9
[ refactor ] Rename Data.Strings to Data.String (1/2) (#987) 2021-01-27 19:18:34 +00:00
Stiopa Koltsov
901a15e8f8 Move Cast interface to Prelude.Cast
Extract 200 lines file from 1000 lines `Prelude/Types.idr`.  To
make code more discoverable.
2021-01-27 18:31:43 +00:00
Guillaume ALLAIS
708b5c300a [ new ] Order relations on Int 2021-01-27 18:23:40 +00:00
Kamiλ Shakirov
140879f7b9
[ new ] Zippable interface (#990) 2021-01-27 18:23:08 +00:00
Denis Buzdalov
bd87bd0f7c The blackbird operator (in the variant of .:) was added 2021-01-27 15:08:25 +00:00
Kamiλ Shakirov
3bbf52025a
Add zip*/unzip* for List1 (#986) 2021-01-26 10:39:16 +00:00
Rodrigo B. de Oliveira
dbea094a31 Fix Language.Reflection definition of INamespace
Fixes #943
2021-01-22 18:10:01 +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
stefan-hoeck
7ef6b79ab1 Remove Control.Monad.Trans.Either from contrib 2021-01-22 08:10:47 +01:00
stefan-hoeck
8074ad1f8d Make Control.Validation use Control.Monad.Error.Either 2021-01-22 08:08:34 +01:00
André Videla
60527d127f
Merge pull request #554 from Sventimir/validation
Input validation
2021-01-22 01:30:07 +00:00
André Videla
3bd2fae525
Update Arrow.idr 2021-01-22 00:54:58 +00:00
André Videla
2e063544e8
Update Category.idr 2021-01-22 00:53:59 +00:00
André Videla
016cd213b9
Delete Either.idr 2021-01-22 00:53:12 +00:00
Stefan Hoeck
0906ac30b9
added System.Console.GetOpt to contrib (#974) 2021-01-21 17:59:06 +00:00
G. Allais
af94feb18e
Merge pull request #960 from stefan-hoeck/transformer-overhaul 2021-01-21 16:30:59 +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
Ruslan Feizerahmanov
515453329a
Revert back to linear iterators (#938) 2021-01-21 12:37:30 +00:00
Stiopa Koltsov
0d363c9732 Add isYes function and friends
Added several functions for `Dec`. The set of functions and names
are picked consistently with `Maybe`:

* `isNothing` -> `isNo`
* `isJust` -> `isYes`
* `IsJust` -> `IsYes`
* `isItJust` -> `isItYes`

This is follow-up to #942
2021-01-21 12:36:02 +00:00
stefan-hoeck
92b9833ee2 fixed doc for WriterT 2021-01-21 13:25:48 +01:00
stefan-hoeck
fd4851c0f5 strict, not stricht 2021-01-21 13:24:40 +01:00
Stefan Hoeck
fb08004041
removed trailing whitespace (#955) 2021-01-21 11:33:03 +00:00
stefan-hoeck
d36a234041 finished MonadRWS 2021-01-20 05:58:19 +01:00
stefan-hoeck
e906b28cae removed MonadState functions from RWS.CPS.idr 2021-01-20 05:51:39 +01:00
stefan-hoeck
e8f2f56768 removed MonadWriter functions from RWS.CPS.idr 2021-01-20 05:48:43 +01:00
stefan-hoeck
6f2e358f1b removed MonadReader functions from RWS.CPS.idr 2021-01-20 05:45:32 +01:00
stefan-hoeck
2776eaa1b1 remove MonadWriter functions from Writer.CPS module 2021-01-20 05:41:01 +01:00
stefan-hoeck
b6e5ba0830 minor MonadWriter cleanup 2021-01-20 05:27:56 +01:00
stefan-hoeck
313f52a88a explicit lambdas for mapXYZ functions 2021-01-20 05:27:08 +01:00
Fabián Heredia Montiel
a23871e57e Execute tests concurrently 2021-01-19 18:40:35 +00:00
stefan-hoeck
a42a34e9f0 removed trailing whitespace 2021-01-19 17:53:42 +01:00
stefan-hoeck
b5ab96477c some cleanups in State 2021-01-19 17:47:06 +01:00
stefan-hoeck
8c9e318a6d some cleanups in Reader 2021-01-19 17:43:47 +01:00
stefan-hoeck
7999420e88 made functions in EitherT and MaybeT public export 2021-01-19 17:38:59 +01:00
stefan-hoeck
c75d14fa8a implemented MonadWriter 2021-01-19 16:19:27 +01:00
stefan-hoeck
01ba3aa365 moved MonadState to its interface module 2021-01-19 15:45:19 +01:00
stefan-hoeck
dac566152b moved MonadReader to its interface module 2021-01-19 15:12:36 +01:00
stefan-hoeck
12f1ff493e added mapStateT function 2021-01-19 14:57:10 +01:00
stefan-hoeck
8eb0e855f1 removed RWST function reader 2021-01-19 14:41:26 +01:00
stefan-hoeck
8cb2220e58 implemented cps-style Writer 2021-01-19 14:34:15 +01:00
stefan-hoeck
b9f7683fbd mapRWST needs only a Functor 2021-01-19 14:11:06 +01:00
stefan-hoeck
b2e7384a80 implemented cps-style RWST 2021-01-19 13:58:18 +01:00
stefan-hoeck
81efdd7992 implementations for MonadError 2021-01-19 12:35:05 +01:00
stefan-hoeck
124afd89b1 moved transformer impls to their own directory 2021-01-19 11:53:23 +01:00
stefan-hoeck
b926e13b96 new transformer layout 2021-01-19 11:45:54 +01: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
Edwin Brady
c7783c553c Make the linter happier 2021-01-16 17:18:38 +00:00
Edwin Brady
efae2682bd
Merge pull request #896 from Russoul/toString-iterators
Add withIteratorString
2021-01-16 15:47:45 +00:00
Edwin Brady
6df2955a72
Merge pull request #909 from stefan-hoeck/maybeT
added MaybeT monad transformer to base
2021-01-16 15:43:14 +00:00
Edwin Brady
70c87e49da
Merge pull request #920 from stefan-hoeck/eithert-foldable-fix
fixed bug in Foldable of EitherT
2021-01-16 15:40:33 +00:00
Alex Gryzlov
c67fc5d7c0
add Inspect idiom (#919) 2021-01-16 14:18:34 +00:00
Edwin Brady
96257f23c3
Merge pull request #914 from stefan-hoeck/lazy-list-impls
Eq, Ord, and Show instances for LazyList
2021-01-16 14:07:26 +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
bea840418a
Merge pull request #823 from andylokandy/path
Changes to System.Path

- Rename `startWith` to `isBaseOf`
- Rename `stripPrefix` to `dropBase`
- Add `dropExtension`
- Add `splitPath`
2021-01-14 22:09:04 +00:00
Andy Lok
4f8bd22b35 Use present tense in doc for Path 2021-01-14 05:26:42 +08:00
Andy Lok
f1d6d4d6f4 Use dot syntax to avoid path argument 2021-01-14 05:05:59 +08:00
André Videla
c1bd61b58d
Merge branch 'master' into validation 2021-01-13 17:07:18 +00:00
stefan-hoeck
7b73072554 fixed bug in Foldable of EitherT 2021-01-13 13:21:20 +01:00
Stefan Hoeck
77a911aa8a
Update libs/base/Control/Monad/Maybe.idr
Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
2021-01-13 11:19:03 +01:00
stefan-hoeck
e52b658d78 no linearity annotation for MkMaybeT 2021-01-13 05:34:07 +01:00
stefan-hoeck
2301826a4e improved documentation for 'on' 2021-01-13 05:06:01 +01: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
stefan-hoeck
530e62a156 Eq, Ord, and Show instances for LazyList 2021-01-11 11:45:56 +01:00
stefan-hoeck
c39df89f84 deleted 'head' from Data.Stream 2021-01-11 09:36:13 +00:00
Mathew Polzin
ab96d771c9 finish removing duplication between the exported 'list reverse' properties in base and those in contrib. 2021-01-10 20:40:45 -08:00
stefan-hoeck
31f50a793c added prelude function 'on' 2021-01-11 05:26:17 +01:00
Mathew Polzin
a32aa42d3f Merge branch 'master' into list-reverse-involutory 2021-01-10 20:17:55 -08:00
stefan-hoeck
c1912cb212 Monad prerequisite for Semigroup instance 2021-01-11 05:05:33 +01:00
stefan-hoeck
e71c7b8946 added MaybeT monad transformer to base 2021-01-08 06:04:41 +01:00
André Videla
3478297557
Merge pull request #905 from alebahn/master
Add public export to types/functions in Data.Fin.Order
2021-01-07 13:46:23 +00:00
André Videla
e99a9b0c84
Merge pull request #901 from andrevidela/fold-count
Add count and foldMap to prelude
2021-01-06 19:29:50 +00:00
Mathew Polzin
e9324fcd60 Rename to reverseInvolutive 2021-01-06 08:45:44 -08:00
André Videla
28c4d1e3bb Add count and foldMap to prelude 2021-01-05 21:59:01 +00:00
André Videla
e4fcd4a089
Merge pull request #900 from andrevidela/vect-snoc
Add `snoc` to Data.Vect
2021-01-05 21:54:47 +00:00
Michael Messer
a1f3424ab8 Remove lamdaRequire 2021-01-05 16:30:11 +00:00
Aaron Lebahn
ce6465e279 Add public export to types/functions in Data.Fin.Order 2021-01-05 07:56:04 -06:00
André Videla
738c9d77d2 Add snoc to Data.Vect
Snoc add an element at the end of the vector. The main use case
for such a function is to get the expected type signature
Vect n a -> a -> Vect (S n) a instead of
Vect n a -> a -> Vect (n + 1) a which you get by using `++ [x]`

Snoc gets is name from `cons` by reversin each letter, indicating
tacking on the element at the end rather than the begining.
`append` would also be a suitable name.
2021-01-03 21:48:31 +00:00
Felix Springer
54d400dad4
Add countExactly to Text.Parser in libs/contrib to return a Vect (#875) 2021-01-01 10:01:42 +00:00
russoul
79d0cd1ba6 Add withIteratorString 2020-12-31 20:36:07 +03:00
Edwin Brady
3b987b10e9 Another multiplicity subtyping fix 2020-12-29 21:47:53 +00:00
Edwin Brady
cc6530026d Merge github.com:idris-lang/Idris2 into no-linearity-subtyping 2020-12-29 21:37:56 +00:00
Edwin Brady
8d034a0a91 Relax some linearities in the base libraries 2020-12-29 21:34:35 +00:00
Edwin Brady
69cb7c6ac4 Relax linearities in prelude 2020-12-29 21:32:01 +00:00
Edwin Brady
b75dcd5c17 Some multiplicity fixes in the libraries 2020-12-29 21:25:00 +00:00
Mathew Polzin
bc76809288 Add proof that list reverse is involutory. 2020-12-28 17:30:24 -08:00
Joey Eremondi
0eef8e58f9
Some utilities for Fin, relations and decidability (#857) 2020-12-28 21:41:12 +00:00
Edwin Brady
5b97cd4499 Fix annotaion in Stream 2020-12-27 20:13:21 +00:00
Edwin Brady
61ba5e086f Fix linearity annotation in take
Hopefully this fixes the bootstrap build
2020-12-27 20:11:06 +00:00
Edwin Brady
ad632d825d Remove linearity subtyping
It's disappointing to have to do this, but I think necessary because
various issue reports have shown it to be unsound (at least as far as
inference goes) and, at the very least, confusing. This patch brings us
back to the basic rules of QTT.

On the one hand, this makes the 1 multiplicity less useful, because it
means we can't flag arguments as being used exactly once which would be
useful for optimisation purposes as well as precision in the type. On
the other hand, it removes some complexity (and a hack) from
unification, and has the advantage of being correct! Also, I still
consider the 1 multiplicity an experiment.

We can still do interesting things like protocol state tracking, which
is my primary motivation at least.

Ideally, if the 1 multiplicity is going to be more generall useful,
we'll need some kind of way of doing multiplicity polymorphism in the
future. I don't think subtyping is the way (I've pretty much always come
to regret adding some form of subtyping).

Fixes #73 (and maybe some others).
2020-12-27 19:58:35 +00:00
alissa42
02e12a82cf Adding default implementation of Foldable.null 2020-12-24 08:49:32 +00:00
André Videla
9c400a185e Add Traversable to List1 2020-12-21 15:10:00 +00:00
Denis Buzdalov
60e9cf44b0 Add List, LazyList and Stream unfolds and some LazyList's functions 2020-12-18 22:54:03 +00:00
Denis Buzdalov
bff74807fd
Some functions, mostly for lazy lists (#854)
Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
2020-12-18 10:33:56 +00:00
tensorknower69
aa940c3d18 change runState's signature 2020-12-17 10:10:18 +00:00
tensorknower69
c48b1e090e add execStateT and evalStateT 2020-12-17 10:10:18 +00:00
Edwin Brady
c1f58d963f
Merge branch 'master' into interfaces 2020-12-14 13:34:31 +00:00
Wen Kokke
daff1f2fb8
Added assert_linear. (#844)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2020-12-13 16:06:18 +00:00
G. Allais
3f6b99e979
[ fix #657 ] RigCount for interface parameters (#808) 2020-12-11 11:58:26 +00:00
Dong Tsing-hsuen
88aa55e875
[ new ] null method in Foldable (#832)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2020-12-10 18:04:23 +00:00
Andy Lok
9f72a514f1 Rename startWith to isBaseOf 2020-12-07 15:26:00 +08:00
Andy Lok
5578761bdb Improve splitPath 2020-12-07 05:19:53 +08:00
Andy Lok
d3a74e0199 Update document 2020-12-07 04:27:54 +08:00
Andy Lok
f5e0853264 Refactor Utils.Path 2020-12-07 04:16:28 +08:00
Andy Lok
8eea90527a Refactor System.Path 2020-12-07 04:10:15 +08:00
Edwin Brady
63a46722ef Force/Delay need to be inlined in Builtins
Otherwise (especially in the case of delay) the argument might be
evaluated prematurely.
2020-12-06 20:00:48 +00:00
Andy Lok
9e22a6e07b
Add javascript FFI for fastUnpack (#816) 2020-12-06 09:54:58 +00:00
Denis Buzdalov
13cc27da1f An alternative (Fin-based) indexing function was added for lists. 2020-12-04 19:09:05 +00:00
Denis Buzdalov
4364793484 Type definition from Decidable.Equality was moved to a separate module
This is done to make able for `Data.*` modules of datatypes declared in
prelude to import modules that have their own definitions of `DecEq`
inside them (i.e. modules of datatypes declared in the `base`).
2020-12-04 19:09:05 +00:00
Edwin Brady
778d6026e5
Merge pull request #607 from Russoul/record-init
New syntax for named applications and "record" updates
2020-12-04 11:35:05 +00:00
Denis Buzdalov
f2596318e5 Proof of list bounds was made to be not present at runtime when indexing 2020-12-04 11:26:11 +00:00
Fabián Heredia Montiel
57a8ef4609
Implement Futures as a Parallelism Primitive (#753)
Co-authored-by: Christian Rasmussen <christian.rasmussen@me.com>
2020-12-04 10:58:26 +00:00
russoul
46519237cd Merge 2020-12-03 15:28:20 +03:00
Mathew Polzin
6ca03acd71
Add replaceWhen for lists. (#755) 2020-11-27 19:10:08 +00:00
G. Allais
502f544d73
[ fix #775 ] integerToNat is not, in fact, id (#799) 2020-11-27 18:48:19 +00:00
G. Allais
5e799563fa
[ contrib ] adding Data.Container (#781) 2020-11-27 15:29:19 +00:00
Alex Humphreys
71a638ef28 Add extra parsers
This also changes the return type of `char` and `string`. They
previously returned `()`, they now return `Char` and `String`
repectively.

Signed-off-by: Alex Humphreys <alex.humphreys@here.com>
2020-11-27 11:54:12 +00:00
Guillaume ALLAIS
a9ff13c663 [ new ] proof that evaluation is Domain-independent 2020-10-29 23:05:41 +00:00
Alex Gryzlov
f79b86ae41
contrib.Data.String.Parser updates (#713) 2020-10-24 12:33:15 +01:00
Jan de Muijnck-Hughes
de58c66ab2
Make Idris2 test harness available for the many and not the few. (#719)
Co-authored-by: Guillaume ALLAIS <guillaume.allais@ens-lyon.org>
2020-10-19 09:26:23 +01:00
Guillaume ALLAIS
14d0141ca2 [ fix #735 ] Make sure type constructors are fully applied 2020-10-16 14:44:11 +01:00
Guillaume ALLAIS
482527063c [ new ] Variant with a runtime irrelevant Domain
Rather than translating the constraints to a Dybjer-Setzer IR code
we can produce an ad-hoc definition of a `Domain` that we will be
able to make runtime irrelevant.

This means that compiled code will never need to construct a proof
that a value is in the domain of the function: it will simply run
the function!
2020-10-15 17:03:32 +01:00
Guillaume ALLAIS
864be2c9dc [ contrib ] add McBride's General monad 2020-10-15 17:03:32 +01:00
russoul
fd90141ed9 Merge branch 'master' of https://github.com/idris-lang/Idris2 into master 2020-10-12 17:36:45 +03:00
Matúš Tejiščák
1a58075a54
Merge pull request #716 from sysvinit/fix-network-constants
Retrieve network address family preprocessor constants from C runtime code
2020-10-11 08:37:44 +02:00
Matus Tejiscak
f64163de1f Merge branch 'unscheme' into master 2020-10-11 08:20:01 +02:00
Matus Tejiscak
668762e693 Merge branch 'revert-projections' into master 2020-10-11 08:12:00 +02:00
Ohad Kammar
ef730c7eb1
preorder reasoning: introduce a Step datatype (#734)
Refactor the DIY equational reasoning library to be a bit more like
the generic pre-order reasoning library:

Change the `...` notation into a constructor for a new `Step` datatype.

This seems to help idris disambiguate between the two kinds of
reasoning when they're used in the same file (e.g., frex).

Co-authored-by: Ohad Kammar <ohad.kammar@ed.ac.uk>
2020-10-07 17:44:18 +01:00
Ohad Kammar
0c1a124704
Division theorem (#695)
Division Theorem. For every natural number `x` and positive natural
number `n`, there is a unique decomposition:
`x = q*n + r`
with `q`,`r` natural and `r` < `n`.

`q` is the quotient when dividing `x` by `n`
`r` is the remainder when dividing `x` by `n`.

This commit adds a proof for this fact, in case
we want to reason about modular arithmetic (for example, when dealing
with binary representations). A future, more systematic, development could
perhaps follow: @clayrat 's (idris1) port of Coq's binary arithmetics:

    https://github.com/sbp/idris-bi/blob/master/src/Data/Bin/DivMod.idr
    https://github.com/sbp/idris-bi/blob/master/src/Data/Biz/DivMod.idr
    https://github.com/sbp/idris-bi/blob/master/src/Data/BizMod2/DivMod.idr

In the process, it bulks up the stdlib with:
+ a generic PreorderReasoning module for arbitrary preorders,
analogous for the equational reasoning module
+ some missing facts about Nat operations.
+ Refactor some Nat order properties using a 'reflect' function

Co-authored-by: Ohad Kammar <ohad.kammar@ed.ac.uk>
Co-authored-by: G. Allais <guillaume.allais@ens-lyon.org>
2020-10-06 13:09:02 +01:00