Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Monadic ¶ added in v0.0.39
type Monadic[R any] interface { // 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] // 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] }
type Try ¶
type Try[R any] interface { Is[R] To[R] Monadic[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.