You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type Result<T, E>
func Result.isSuccess() -> Bool
ok := myResult.isSuccess()
// Without (idiomatic and consistent):
ok := when myResult {
Error -> false
_ -> true
}
func Result.else<U>(errValue: U) -> T | U
value := myResult.else('default value') // Could also be called 'Result.or()'
// Without (also idiomadic and consistent):
value := when myResult {
Error -> 'default value'
_ -> myResult
}
func Result.mapSuccess<U>(to successValue: U) -> Result<U, E>
func Result.mapSuccess<U>(with mapper: func(successValue: T) -> U) -> Result<U, E>
func Result.mapError<U>(to errValue: U) -> Result<T, U> // Could also be called 'Result.and()'
func Result.mapError<U>(with mapper: func(errValue: E) -> U) -> Result<T, U>
func Result.swap() -> Result<E, T> // Could also be called 'Result.invert()'
func Result.takeSuccess() -> T?
func Result.takeError() -> E?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Should these methods be added to the
Resulttype?All reactions