Files
managed-git/Git.Test/Result.fs
2023-09-02 21:48:31 +01:00

15 lines
402 B
Forth

namespace Git.Test
[<RequireQualifiedAccess>]
module Result =
let get<'res, 'err> (r : Result<'res, 'err>) : 'res =
match r with
| Ok x -> x
| Error e -> failwithf "Expected Ok, but got Error: %+A" e
let getError<'res, 'err> (r : Result<'res, 'err>) : 'err =
match r with
| Error e -> e
| Ok x -> failwithf "Expected Error, but got Ok: %+A" x