darjeeling 0.3.0
A library for functional data types in D.
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
Darjeeling
A library for functional data types in D.
Usage
import std.stdio : writeln;
import darjeeling.maybe : Maybe;
import darjeeling.either : Either;
import darjeeling.trial : Trial;
void main()
{
auto maybe = Maybe!int.just(42);
if (maybe.isJust)
{
writeln(maybe.fromJust()); //#=> 42
}
auto either = Either!(string, int).right(33-4);
if (either.isRight)
{
writeln(either.right()); //#=> 29
}
auto trial = Trial!int.trying({
auto x = 1;
if (x > 0) throw new Exception("positive");
return x;
});
if (trial.isFailure)
{
auto left = trial.getOrLeft();
writeln(left.left().msg); //#=> positive
}
}
Installation
You can use this package with DUB:
dependencies {
"darjeeling": "~>0.3.0"
}
Documentation
TODO
- 0.3.0 released 8 years ago
- Gab-km/darjeeling
- github.com/Gab-km/darjeeling
- BSL-1.0
- Copyright © 2016, Kazuhiro Matsushima
- Authors:
- Dependencies:
- none
- Versions:
-
0.3.0 2016-May-27 0.2.0 2016-May-23 0.1.0 2016-May-20 ~master 2016-May-27 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
73 downloads total
-
- Score:
- 0.5
- Short URL:
- darjeeling.dub.pm