Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Fsdk/FSharpUtil.fs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,13 @@ module FSharpUtil =
ReRaise ex |> ignore<Exception>
failwith "unreachable"

let UnwrapEither<'T, 'TExn when 'TExn :> Exception>
(eitherValue: Either<'T, 'TExn>)
=
match eitherValue with
| SuccessfulValue result -> result
| FailureResult ex -> raise <| ReRaise ex

type OptionBuilder() =
// see https://github.com/dsyme/fsharp-presentations/blob/master/design-notes/ces-compared.md#overview-of-f-computation-expressions
member x.Bind(v, f) =
Expand Down