@@ -7,21 +7,21 @@ open System
77module AsyncOptionCE =
88 type AsyncOptionBuilder () =
99
10- member __.Return ( value : 'T ) : Async < Option < _ > > =
10+ member __.Return ( value : 'T ) : Async < _ option > =
1111 async.Return <| option.Return value
1212
1313 member __.ReturnFrom
14- ( asyncResult : Async < Option < _ > >)
15- : Async < Option < _ > > =
14+ ( asyncResult : Async < _ option >)
15+ : Async < _ option > =
1616 asyncResult
1717
18- member __.Zero () : Async < Option < _ > > =
18+ member __.Zero () : Async < _ option > =
1919 async.Return <| option.Zero ()
2020
2121 member inline __.Bind
22- ( asyncResult : Async < Option < _ > >,
23- binder : 'T -> Async < Option < _ > >)
24- : Async < Option < _ > > =
22+ ( asyncResult : Async < _ option >,
23+ binder : 'T -> Async < _ option >)
24+ : Async < _ option > =
2525 async {
2626 let! result = asyncResult
2727 match result with
@@ -30,46 +30,46 @@ module AsyncOptionCE =
3030 }
3131
3232 member __.Delay
33- ( generator : unit -> Async < Option < _ > >)
34- : Async < Option < _ > > =
33+ ( generator : unit -> Async < _ option >)
34+ : Async < _ option > =
3535 async.Delay generator
3636
3737 member this.Combine
38- ( computation1 : Async < Option < _ > >,
39- computation2 : Async < Option < _ > >)
40- : Async < Option < _ > > =
38+ ( computation1 : Async < _ option >,
39+ computation2 : Async < _ option >)
40+ : Async < _ option > =
4141 this.Bind( computation1, fun () -> computation2)
4242
4343 member __.TryWith
44- ( computation : Async < Option < _ > >,
45- handler : System.Exception -> Async < Option < _ > >)
46- : Async < Option < _ > > =
44+ ( computation : Async < _ option >,
45+ handler : System.Exception -> Async < _ option >)
46+ : Async < _ option > =
4747 async.TryWith( computation, handler)
4848
4949 member __.TryFinally
50- ( computation : Async < Option < _ > >,
50+ ( computation : Async < _ option >,
5151 compensation : unit -> unit )
52- : Async < Option < _ > > =
52+ : Async < _ option > =
5353 async.TryFinally( computation, compensation)
5454
5555 member __.Using
5656 ( resource : 'T when 'T :> IDisposable ,
57- binder : 'T -> Async < Option < _ > >)
58- : Async < Option < _ > > =
57+ binder : 'T -> Async < _ option >)
58+ : Async < _ option > =
5959 __. TryFinally (
6060 ( binder resource),
6161 ( fun () -> if not <| obj.ReferenceEquals( resource, null ) then resource.Dispose ())
6262 )
6363
6464 member this.While
65- ( guard : unit -> bool , computation : Async < Option < _ > >)
66- : Async < Option < _ > > =
65+ ( guard : unit -> bool , computation : Async < _ option >)
66+ : Async < _ option > =
6767 if not <| guard () then this.Zero ()
6868 else this.Bind( computation, fun () -> this.While ( guard, computation))
6969
7070 member this.For
71- ( sequence : #seq<'T> , binder : 'T -> Async < Option < _ > >)
72- : Async < Option < _ > > =
71+ ( sequence : #seq<'T> , binder : 'T -> Async < _ option >)
72+ : Async < _ option > =
7373 this.Using( sequence.GetEnumerator (), fun enum ->
7474 this.While( enum .MoveNext,
7575 this.Delay( fun () -> binder enum .Current)))
@@ -79,13 +79,13 @@ module AsyncOptionCE =
7979 ///
8080 /// See https://stackoverflow.com/questions/35286541/why-would-you-use-builder-source-in-a-custom-computation-expression-builder
8181 /// </summary>
82- member inline _.Source ( async : Async < Option < _ >> ) : Async < Option < _ > > = async
82+ member inline _.Source ( async : Async < _ option > ) : Async < _ option > = async
8383
8484#if ! FABLE_ COMPILER
8585 /// <summary>
8686 /// Method lets us transform data types into our internal representation.
8787 /// </summary>
88- member inline _.Source ( task : Task < Option < _ >> ) : Async < Option < _ > > = task |> Async.AwaitTask
88+ member inline _.Source ( task : Task < _ option > ) : Async < _ option > = task |> Async.AwaitTask
8989#endif
9090
9191 let asyncOption = AsyncOptionBuilder()
@@ -105,7 +105,7 @@ module AsyncOptionCEExtensions =
105105 /// <summary>
106106 /// Method lets us transform data types into our internal representation.
107107 /// </summary>
108- member inline __.Source ( r : Option < 't > ) = Async.singleton r
108+ member inline __.Source ( r : 't option ) = Async.singleton r
109109 /// <summary>
110110 /// Method lets us transform data types into our internal representation.
111111 /// </summary>
@@ -116,4 +116,4 @@ module AsyncOptionCEExtensions =
116116 /// Method lets us transform data types into our internal representation.
117117 /// </summary>
118118 member inline __.Source ( a : Task < 't >) = a |> Async.AwaitTask |> Async.map Some
119- #endif
119+ #endif
0 commit comments