@@ -5,7 +5,7 @@ open System.Threading.Tasks
55[<RequireQualifiedAccess>]
66module AsyncResult =
77
8- let inline singleton ( value : 'ok ) : Async < Result < 'ok , 'error >> =
8+ let inline ok ( value : 'ok ) : Async < Result < 'ok , 'error >> =
99 Ok value
1010 |> Async.singleton
1111
@@ -96,9 +96,9 @@ module AsyncResult =
9696 /// <example>
9797 /// <code>
9898 /// AsyncResult.error "First" |> AsyncResult.orElse (AsyncResult.error "Second") // evaluates to Error ("Second")
99- /// AsyncResult.error "First" |> AsyncResult.orElse (AsyncResult.singleton "Second") // evaluates to Ok ("Second")
100- /// AsyncResult.singleton "First" |> AsyncResult.orElse (AsyncResult.error "Second") // evaluates to Ok ("First")
101- /// AsyncResult.singleton "First" |> AsyncResult.orElse (AsyncResult.singleton "Second") // evaluates to Ok ("First")
99+ /// AsyncResult.error "First" |> AsyncResult.orElse (AsyncResult.ok "Second") // evaluates to Ok ("Second")
100+ /// AsyncResult.ok "First" |> AsyncResult.orElse (AsyncResult.error "Second") // evaluates to Ok ("First")
101+ /// AsyncResult.ok "First" |> AsyncResult.orElse (AsyncResult.ok "Second") // evaluates to Ok ("First")
102102 /// </code>
103103 /// </example>
104104 /// <returns>
@@ -108,7 +108,7 @@ module AsyncResult =
108108 ( ifError : Async < Result < 'ok , 'errorOutput >>)
109109 ( input : Async < Result < 'ok , 'errorInput >>)
110110 : Async < Result < 'ok , 'errorOutput >> =
111- Async.bind ( Result.either singleton ( fun _ -> ifError)) input
111+ Async.bind ( Result.either ok ( fun _ -> ifError)) input
112112
113113 /// <summary>
114114 /// Returns <paramref name="input"/> if it is <c>Ok</c>, otherwise executes <paramref name="ifErrorFunc"/> and returns the result.
@@ -121,9 +121,9 @@ module AsyncResult =
121121 /// <example>
122122 /// <code>
123123 /// AsyncResult.error "First" |> AsyncResult.orElseWith (fun _ -> AsyncResult.error "Second") // evaluates to Error ("Second")
124- /// AsyncResult.error "First" |> AsyncResult.orElseWith (fun _ -> AsyncResult.singleton "Second") // evaluates to Ok ("Second")
125- /// AsyncResult.singleton "First" |> AsyncResult.orElseWith (fun _ -> AsyncResult.error "Second") // evaluates to Ok ("First")
126- /// AsyncResult.singleton "First" |> AsyncResult.orElseWith (fun _ -> AsyncResult.singleton "Second") // evaluates to Ok ("First")
124+ /// AsyncResult.error "First" |> AsyncResult.orElseWith (fun _ -> AsyncResult.ok "Second") // evaluates to Ok ("Second")
125+ /// AsyncResult.ok "First" |> AsyncResult.orElseWith (fun _ -> AsyncResult.error "Second") // evaluates to Ok ("First")
126+ /// AsyncResult.ok "First" |> AsyncResult.orElseWith (fun _ -> AsyncResult.ok "Second") // evaluates to Ok ("First")
127127 /// </code>
128128 /// </example>
129129 /// <returns>
@@ -133,7 +133,7 @@ module AsyncResult =
133133 ( [<InlineIfLambda>] ifErrorFunc : 'errorInput -> Async < Result < 'ok , 'errorOutput >>)
134134 ( input : Async < Result < 'ok , 'errorInput >>)
135135 : Async < Result < 'ok , 'errorOutput >> =
136- Async.bind ( Result.either singleton ifErrorFunc) input
136+ Async.bind ( Result.either ok ifErrorFunc) input
137137
138138 /// Replaces the wrapped value with unit
139139 let inline ignore < 'ok , 'error >
0 commit comments