We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f0525cc commit cc27d40Copy full SHA for cc27d40
src/AsyncExtras.fs
src/ExceptionsHandler.fs
@@ -1,8 +1,14 @@
1
-module ExceptionsHandler
+namespace SqlStreamStore.Fsharp
2
3
-let simpleExceptionHandler (op: Async<'res>): Async<Result<'res, string>> =
4
- op
5
- |> Async.Catch
6
- |> Async.map (function
7
- | Choice1Of2 response -> Ok response
8
- | Choice2Of2 exn -> Error exn.Message)
+module Async =
+ let bind f m = async.Bind(m, f)
+ let map f m = m |> bind (f >> async.Return)
+
+module ExceptionsHandler =
9
+ let simpleExceptionHandler (op: Async<'res>): Async<Result<'res, string>> =
10
+ op
11
+ |> Async.Catch
12
+ |> Async.map (function
13
+ | Choice1Of2 response -> Ok response
14
+ | Choice2Of2 exn -> Error exn.Message)
0 commit comments