Commit Graph

406 Commits

Author SHA1 Message Date
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
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
c39df89f84 deleted 'head' from Data.Stream 2021-01-11 09:36:13 +00: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
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
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
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