auto x = Optional!string.some("foo"); assert(x.fmapOrElse!(str => str.length, () => 42) == 3); auto y = Optional!string.none(); assert(y.fmapOrElse!(str => str.length, () => 42) == 42);
See Implementation