by karmakaze · 5y ago · 0 comments
x, err := computeAThing(1, 1)
y, err := and_then.Int(err, makeComputeAThingFn(x, 1))
z, err := and_then.Int(err, makeComputeAthingFn(x, y))
another, err := and_then.AnotherType(err, makeComputeAnotherTypeFn(z))
where makeComputeAThingFn(...) returns a function with the body `return computeAThing(...)`. `err` will end up with the first non-nil error and the following and_then.X's will be no-ops.