alias O = Optional!int; assert(O.none.andThen!(i => O.some(i + 3)) == none); assert(O.some(7).andThen!(i => O.some(i + 3)) == 10.some);
See Implementation