ddash 0.15.1
Utility library for D
To use this package, put the following dependency into your project's dependencies section:
ddash
Full API docs available here
A utility library that was inspired by the a javascript library called lodash. The algorithms operate on sequences that are either:
 value sequences:
assert(1.concat(2, 3, 4).array == [1, 2, 3, 4]);
 ranges:
assert(1.concat([2, 3, 4]).array == [1, 2, 3, 4]);
 a mixture of the above two:
assert(1.concat([2, 3], 4).array == [1, 2, 3, 4]);
 associative arrays:
auto aa = ["a": 1, "b": 0, "c": 2]; assert(aa.compactValues!(a => a == 0) == ["a": 1, "c": 2]);
Furthermore, a number of algorithms allow you to:
operate on members of types:
This would be akin to passing in a predicate that extracts a member variable from a type to operate on instead of operating on the whole type. These algorithms usually have a
By
prefix:class C {
int x;
} auto arr1 = [new C(2), new C(3)]; auto arr2 = [new C(2), new C(3)]; assert(arr1.equalBy!"x"(arr2));
operate via unary or binary predicates:
import std.math: ceil; assert([2.1, 2.4, 1.2, 2.9].difference!ceil([2.3, 0.1]).equal([1.2])); assert([2.1, 2.4, 1.2, 2.9].difference!((a, b) => ceil(a) < ceil(b))([2.3, 3.4]).equal([1.2]));
or both:
struct A { int x; } auto arr = [A(4), A(8), A(12)]; assert(arr.pullBy!("x", a => a / 2)(5, 9).array == [A(12)]);
Features:
 Algorithms that are possibly nontrivial to figure out from D's stadard library Phobos
 Algorithms that are not in D's standard library
 Ability to execute the algorithms on sequences other than ranges
 Integration with Optional!T
 Common utility functions
 Functional programming utilities
Subpackages:
 algorithm: contains algorithms that operate mostly on sequences
 ranges: contains navigational algorithms over ranges (moving/jumpting/iterating/etc)
 functional: contains utilties for functional programming
 lang: contains techniques that fill in required language bits (or just stuff I didn't know where to put)
 utils: contains utility types and functions
Benchmarks
There's a benchmark dub configuration that can be used to run algorithms and check their speeds. The idea behind this is supposed to be to help with regressions once I figure out how to generate reports.
 Registered by ali akhtarzada
 0.15.1 released 3 months ago
 aliak00/ddash
 MIT
 Copyright © 2017, Ali Akhtarzada
 Authors:
 Sub packages:
 ddash:algorithm, ddash:functional, ddash:utils, ddash:lang, ddash:range, ddash:common
 Dependencies:
 ddash:range, ddash:utils, ddash:algorithm, ddash:functional, ddash:lang
 Versions:

0.19.0 2019Jul20 0.18.0 2019Jul18 0.17.1 2019Jul17 0.17.0 2019Jul16 0.16.0 2019Jul09  Download Stats:


0 downloads today

19 downloads this week

25 downloads this month

228 downloads total

 Score:
 0.2
 Short URL:
 ddash.dub.pm