Skip to content

Commit 56beb47

Browse files
committed
+ Missing builder methods to ChoiceT
1 parent 50dbb7b commit 56beb47

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/FSharpPlus/Data/Error.fs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ type ChoiceT<'``monad<Choice<'t,'e>>``> with
137137
static member inline (<*>) (f: ChoiceT<'``Monad<Choice<('T -> 'U),'E>>``>, x: ChoiceT<'``Monad<Choice<'T,'E>>``>) = ChoiceT.apply f x : ChoiceT<'``Monad<Choice<'U,'E>>``>
138138
static member inline (>>=) (x: ChoiceT<'``Monad<Choice<'T,'E>>``>, f: 'T->ChoiceT<'``Monad<Choice<'U,'E>>``>) = ChoiceT.bind f x
139139

140+
static member inline TryWith (source: ChoiceT<'``Monad<Choice<'T,'E>>``>, f: exn -> ChoiceT<'``Monad<Choice<'T,'E>>``>) = ChoiceT (TryWith.Invoke (ChoiceT.run source) (ChoiceT.run << f))
141+
static member inline TryFinally (computation: ChoiceT<'``Monad<Choice<'T,'E>>``>, f) = ChoiceT (TryFinally.Invoke (ChoiceT.run computation) f)
142+
static member inline Using (resource, f: _ -> ChoiceT<'``Monad<Choice<'T,'E>>``>) = ChoiceT (Using.Invoke resource (ChoiceT.run << f))
143+
static member inline Delay (body : unit -> ChoiceT<'``Monad<Choice<'T,'E>>``>) = ChoiceT (Delay.Invoke (fun _ -> ChoiceT.run (body ())))
144+
140145
[<EditorBrowsable(EditorBrowsableState.Never)>]
141146
static member inline Lift (x: '``Monad<'T>``) : ChoiceT<'``Monad<Choice<'T,'E>>``> = ChoiceT.lift x
142147

0 commit comments

Comments
 (0)