fmap

Undocumented in source.
template fmap(alias pred)
fmap
(
T
)
(
auto ref scope Optional!T optional
)

Members

Functions

fmap
auto fmap(Optional!T optional)
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

assert(Optional!int.some(3).fmap!(n => n + 7) == 10.some);

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

Meta