Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Try ¶
type Try[R any] interface { IsSuccess() bool // OrElse returns contained value if this is success; otherwise returns given `other` value. OrElse(other R) R // ForEach executes given procedure for success, skips for failure. ForEach(procedure funcs.Procedure[R]) Try[R] // ToErr is nil for success, and error for failure ToErr() error // ToOpt converts success to opt.Some, failure to opt.None. ToOpt() opt.Option[R] // Proc does nothing for left; it turns success to failure on proc error Proc(proc funcs.FallibleFunction[R]) Try[R] ProcFailure(proc funcs.Procedure[error]) Try[R] // Map is category unchanging method, variant of Map function. Map(mapper funcs.Mapper[R, R]) Try[R] MapFailure(lm funcs.Mapper[error, error]) Try[R] // FlatMap is category unchanging method, variant of FlatMap function. FlatMap(fMap FMapper[R, R]) Try[R] }
Try is like Either, with left type simplified to error (Basically, Try[T].ToEither() :: Either[error, T]).
func FlatMap ¶
FlatMap returns success with result of applying f to R, if this is success; otherwise it returns unchanged failure.
Click to show internal directories.
Click to hide internal directories.