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
Copy file name to clipboardExpand all lines: src/FSharpPlus/Data/Error.fs
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,12 @@ type ResultT<'``monad<Result<'t,'e>>``> with
71
71
72
72
static member inline(<*>)(f:ResultT<'``Monad<Result<('T -> 'U),'E>>``>,x:ResultT<'``Monad<Result<'T,'E>>``>)= ResultT.apply f x : ResultT<'``Monad<Result<'U,'E>>``>
73
73
static member inline(>>=)(x: ResultT<'``Monad<Result<'T,'E>>``>, f: 'T->ResultT<'``Monad<Result<'U,'E>>``>)= ResultT.bind f x
74
+
75
+
/// <summary>
76
+
/// Composes left-to-right two Result functions (Kleisli composition).
77
+
/// </summary>
78
+
/// <category index="2">Monad</category>
79
+
static member inline(>=>)(f: 'T -> ResultT<'``Monad<Result<'U, 'E>``>, g: 'U -> ResultT<'``Monad<Result<'V, 'E>``>): 'T -> ResultT<'``Monad<Result<'V, 'E>``>=fun x -> ResultT.bind g (f x)
74
80
75
81
static member inlineget_Zero():ResultT<'``MonadPlus<Result<'U,'E>>``>= ResultT <| result (Error zero)
76
82
static member inline(+)(ResultT x,ResultT y):ResultT<'``MonadPlus<Result<'U,'E>>``>=
@@ -154,6 +160,12 @@ type ChoiceT<'``monad<Choice<'t,'e>>``> with
154
160
155
161
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>>``>
156
162
static member inline(>>=)(x: ChoiceT<'``Monad<Choice<'T,'E>>``>, f: 'T->ChoiceT<'``Monad<Choice<'U,'E>>``>)= ChoiceT.bind f x
163
+
164
+
/// <summary>
165
+
/// Composes left-to-right two Choice functions (Kleisli composition).
166
+
/// </summary>
167
+
/// <category index="2">Monad</category>
168
+
static member inline(>=>)(f: 'T -> ChoiceT<'``Monad<Choice<'U, 'E>``>, g: 'U -> ChoiceT<'``Monad<Choice<'V, 'E>``>): 'T -> ChoiceT<'``Monad<Choice<'V, 'E>``>=fun x -> ChoiceT.bind g (f x)
157
169
158
170
static member inlineget_Zero():ChoiceT<'``MonadPlus<Choice<'U,'E>>``>= ChoiceT <| result (Choice2Of2 zero)
159
171
static member inline(+)(ChoiceT x,ChoiceT y):ChoiceT<'``MonadPlus<Choice<'U,'E>>``>=
Copy file name to clipboardExpand all lines: src/FSharpPlus/Data/Option.fs
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,12 @@ type OptionT<'``monad<option<'t>>``> with
52
52
static member inline(<*>)(f:OptionT<'``Monad<option<('T -> 'U)>``>,x:OptionT<'``Monad<option<'T>``>)= OptionT.apply f x : OptionT<'``Monad<option<'U>``>
53
53
static member inline(>>=)(x: OptionT<'``Monad<option<'T>``>, f: 'T -> OptionT<'``Monad<option<'U>``>)= OptionT.bind f x
54
54
55
+
/// <summary>
56
+
/// Composes left-to-right two Option functions (Kleisli composition).
57
+
/// </summary>
58
+
/// <category index="2">Monad</category>
59
+
static member inline(>=>)(f: 'T -> OptionT<'``Monad<option<'U>``>, g: 'U -> OptionT<'``Monad<option<'V>``>): 'T -> OptionT<'``Monad<option<'V>``>=fun x -> OptionT.bind g (f x)
60
+
55
61
static member inlineget_Zero():OptionT<'``MonadPlus<option<'T>``>= OptionT <| result None
56
62
static member inline(+)(OptionT x,OptionT y):OptionT<'``MonadPlus<option<'T>``>=
Copy file name to clipboardExpand all lines: src/FSharpPlus/Data/ValueOption.fs
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,13 @@ type ValueOptionT<'``monad<voption<'t>>``> with
52
52
static member inline(<*>)(f:ValueOptionT<'``Monad<voption<('T -> 'U)>``>,x:ValueOptionT<'``Monad<voption<'T>``>)= ValueOptionT.apply f x : ValueOptionT<'``Monad<voption<'U>``>
53
53
static member inline(>>=)(x: ValueOptionT<'``Monad<voption<'T>``>, f: 'T -> ValueOptionT<'``Monad<voption<'U>``>)= ValueOptionT.bind f x
54
54
55
+
/// <summary>
56
+
/// Composes left-to-right two option functions (Kleisli composition).
57
+
/// </summary>
58
+
/// <category index="2">Monad</category>
59
+
static member inline(>=>)(f: 'T -> ValueOptionT<'``Monad<voption<'U>``>, g: 'U -> ValueOptionT<'``Monad<voption<'V>``>): 'T -> ValueOptionT<'``Monad<voption<'V>``>=fun x -> ValueOptionT.bind g (f x)
60
+
61
+
55
62
static member inlineget_Zero():ValueOptionT<'``MonadPlus<voption<'T>``>= ValueOptionT <| result ValueNone
56
63
static member inline(+)(ValueOptionT x,ValueOptionT y):ValueOptionT<'``MonadPlus<voption<'T>``>=
0 commit comments