Abstract
Similar to Opt.map, but function is expected to return Opt which will be returned. Useful for including steps which may fail or return no value.
some(1).flatMap(x => x === 1 ? none : some(x + 1)) // Nonenone.flatMap(x => some(1)) // None
flatMap
Similar to Opt.map, but function is expected to return Opt which will be returned. Useful for including steps which may fail or return no value.