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