We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4609d99 + c3b1eb1 commit 0e5dd2aCopy full SHA for 0e5dd2a
1 file changed
src/FSharpx.Extras/ComputationExpressions/Monad.fs
@@ -226,6 +226,18 @@ module Option =
226
| Some x -> x
227
| None -> v()
228
229
+ /// Gets the value associated with the option or fails with the supplied message.
230
+ let inline getOrFail m =
231
+ function
232
+ | Some x -> x
233
+ | None -> failwith m
234
+
235
+ /// Gets the value associated with the option or raises the supplied exception.
236
+ let inline getOrRaise e =
237
238
239
+ | None -> raise e
240
241
/// Gets the value associated with the option or the default value for the type.
242
let getOrDefault =
243
function
0 commit comments