gribouille / elm-prelude / Prelude.Result

Extra Result functions.

result : (a -> c) -> (b -> c) -> Result a b -> c

Case analysis for the Result type. If the value is Err a, apply the first function to a; if it is Ok b, apply the second function to b.

isOk : Result a b -> Basics.Bool

True if the Result is an Ok value.

isErr : Result a b -> Basics.Bool

True if the Result is an Err value.

resultFlip : Result a b -> Result b a

Flip the Err and Ok values.

resultValues : List (Result a b) -> List b

Extracts from a list of Result all the Err elements.

resultErrors : List (Result a b) -> List a

Extracts from a list of Result all the Ok elements.