fmap

Undocumented in source.
template fmap(alias pred)
fmap
(
T
E
)
(
auto ref scope Result!(T, E) result
)

Members

Functions

fmap
auto fmap(Result!(T, E) result)
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

assert(Result!int.ok(3).fmap!(n => n + 7) == 10.ok);

import std.algorithm: equal, map;
import std.range : only;
assert(Result!int.ok(3).only.map!(fmap!(n => n + 7)).equal(10.ok.only));

Meta