56 Commits

Author SHA1 Message Date
5453c646f6
Replace Variant with SumType 2022-06-06 09:46:45 +02:00
cfcb1e727a
Fix foldr scope 2022-05-30 05:43:08 +02:00
0155039071
Replace rotate with bringToFront 2021-06-04 09:37:50 +02:00
938a1bb5b4
Replace short preconditions in the main package 2021-05-25 09:03:00 +02:00
b62cbb0647
Use std searching and iteration 2021-05-16 07:52:46 +02:00
92284c8541
Replace Option with Nullable 2021-03-27 10:28:49 +01:00
f27f62b80a
Fix InputRanges for non-copyable elements 2021-03-11 10:18:02 +01:00
a227b58407 Remove deprecated functionality 2020-05-06 07:08:14 +02:00
3ce5e8153c Update copyrights 2020-05-05 07:46:10 +02:00
c68b8d1bdd Update compiler, remove deprecated modules 2020-05-04 06:03:45 +02:00
0a973b46ba Add algorithm.iteration.foldr 2019-04-24 06:53:08 +02:00
76bda0ac8d Add getAndPopFront()/getAndPopBack() 2019-04-17 06:27:18 +02:00
f214f3baa2 Add algorithm.iteration.foldl 2019-04-16 07:20:52 +02:00
f66935f40d Build with -dip1000. Fix #85 2019-04-15 07:05:56 +02:00
Nathan Sashihara
10afe47bae In tanya.algorithm.iteration.take & retro preserve const/inout for empty/front/etc. 2019-03-23 23:41:20 -04:00
0fe7308a22 algorithm: import searching publically 2019-03-20 07:30:47 +01:00
484cb13317 Separate non-documentation tests from the code 2019-03-19 07:45:52 +01:00
5ab99cf887 Move memory functions into memory.lifecycle
- move
- moveEmplace
- forward
- emplace
- swap
2019-03-17 10:56:44 +01:00
8fd0452cd0 algorithm.iteration: Add singleton()
... iterating over a single value.
2019-02-25 09:27:03 +01:00
0c8f1eb4ce Deprecate InputRange source for OutputRanges
An output range for E won't be automatically an output range for [E]
anymore. The same, an output range for [E] won't be automatically an
output range for E. Automatic E <-> [E] conversion seems to be a nice
feature at first glance, but it causes much ambiguity.

1) If I want that my output range accepts only UTF-8 strings but not
single characters (because it could be only part of a code point and
look like broken UTF-8 without the remaining code units), I can't do it
because an OutputRange(R, E) can't distinguish between char and string.

2) Here is an example from 2013:

import std.range;
import std.stdio;
Appender!(const(char)[][]) app;
put(app, "aasdf");
put(app, 'b');
writeln(app.data);

This outputs: ["aasdf", "\0"].
Whether it is a common case or not, such code just shouldn't compile.
2019-02-06 07:26:28 +01:00
bf197a6554 Deprecate put() as an OutputRange primitive 2019-02-04 10:49:12 +01:00
7af5c30820 move(): Give compiler an opportunity to optimize
Fix #75.
2019-02-01 06:33:41 +01:00
Nathan Sashihara
ff7d20f167 retro supports slicing if source range supports slicing 2019-01-08 20:19:53 -05:00
e67a05138e range.primitive: Support non copyable elements
... in all ranges.
2018-11-19 21:37:58 +01:00
7585bf59e7 Add test.stub. Fix #51 2018-11-18 06:32:10 +01:00
0a121d9d19 Disable length when taking from a lengthless range
Fix #79.
2018-11-13 08:29:51 +01:00
9e6f5c3105 Add algorithm.mutation.rotate 2018-11-12 07:54:52 +01:00
3c8f6e3435 Merge remote-tracking branch 'n8sh/take-slice' 2018-11-07 07:08:52 +01:00
ee8b7ef719 Merge remote-tracking branch 'retro-retro' 2018-11-06 16:59:57 +01:00
Nathan Sashihara
6b22cd60df take(take(range,...),n) is take(range, n) and use slicing in take like in takeExactly
Also take!R is the same as takeExactly!R when isInfinite!R.
2018-11-05 22:49:10 -05:00
Nathan Sashihara
c290c85088 retro(retro(range)) is range 2018-11-05 18:43:58 -05:00
1e46109e50 algorithm.mutation.destroyAll: New
Fix #71.
2018-10-29 11:14:33 +01:00
ff58b5e81c Add algorithm.mutation.initializeAll 2018-10-24 08:14:15 +02:00
Nathan Sashihara
4e8c9bd28f Use new __traits(isZeroInit) to check for a null initializer at compile time instead of runtime 2018-10-21 18:52:02 -04:00
3b5709821a Add algorithm.mutation.uninitializedFill 2018-10-20 10:42:01 +02:00
4f9927a8c3 Add algorithm.mutation.fill() 2018-10-06 16:00:08 +02:00
772e87739c Replace memory.op.cmp with optimized equal version
Deprecate cmp.
Fix #68.
2018-10-02 08:55:29 +02:00
2a90a812db Add algorithm.searching.count 2018-09-30 15:25:10 +02:00
c5eb2f27be Add algorithm.iteration 2018-09-28 05:40:33 +02:00
b0dc7b59e5 Add predicate support for algorithm.comparison.equal 2018-09-17 19:17:39 +02:00
b6d1766d58 Implement compare algorithm. Fix #50 2018-09-11 10:05:15 +02:00
94c7fd2231 Move range.adapter to algorithms + take() bugfixes
A lot of algorithms like lazy sort() can be also classified as adapters
since it wraps the original range and allows to access the elements of
the range in a particular order. The only reason why take() was in
range.adapter is that take() is trivial - it doesn't change the order of
elements but can turn an infinite range into finite one. This
distinction between trivial and non-trivial algorithms isn't absolutely
clear. So let us put all algorithms and any adapters that change the
range iteration in some way into "algorithm" package to avoid any
confusion later.

- range.adapter is renamed into algorithm.iteration
- range.adapter is deprecated
- Added missing imports for take() and takeExactly()
- takeExactly() doesn't wrap ranges that have slicing anymore
- Voldemort structs for take() takeExactly() are now static
2018-09-06 12:50:42 +02:00
41878cde50 Fix #60: Copying overlapping array slices 2018-08-30 07:12:38 +02:00
abd286064b Add algorithm.mutation.copy 2018-08-05 07:19:30 +02:00
f51e9405c9 Update socket documentation 2018-06-20 07:59:37 +02:00
a86b6690f0 Implement auto-decoding free equal comparison
Fix #39.
2018-06-12 20:19:06 +02:00
6e2852000b Deprecate math.min/max in favour of tanya.algorithm 2018-04-27 11:32:22 +02:00
3468d6ea00 Accept/return as inout in min/max 2018-04-26 08:06:06 +02:00
86053de8c9 Add min/max algorithms 2018-04-22 12:08:33 +02:00
c9e4871fb5 algorithm.mutation: Fix param name in the docs 2018-03-21 08:15:58 +01:00