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
let inlinemap([<InlineIfLambda>]f)(ar:ValueTask<_voption>)=
10
-
ValueTask<_ voption>(
11
-
task{
12
-
let!opt= ar
13
-
return ValueOption.map f opt
14
-
}
15
-
)
11
+
valueTask {
12
+
let!opt= ar
13
+
return ValueOption.map f opt
14
+
}
16
15
17
16
let inlinebind([<InlineIfLambda>]f)(ar:ValueTask<_voption>)=
18
-
ValueTask<_ voption>(
19
-
task{
20
-
let!opt= ar
17
+
valueTask {
18
+
let!opt= ar
21
19
22
-
lett=
23
-
match opt with
24
-
| ValueSome x -> f x
25
-
| ValueNone -> ValueTask<_ voption>(ValueNone)
26
-
27
-
return! t
28
-
}
29
-
)
20
+
match opt with
21
+
| ValueSome x ->return! f x
22
+
| ValueNone ->return ValueNone
23
+
}
30
24
31
25
let inlinevalueSome x = ValueTask<_ voption>(ValueSome x)
32
26
33
27
let inlineapply f x =
34
28
bind (fun f' -> bind (fun x' -> valueSome (f' x')) x) f
35
29
36
30
let inlinezip(x1:ValueTask<'avoption>)(x2:ValueTask<'bvoption>)=
37
-
ValueTask<('a * 'b) voption>(
38
-
task{
39
-
let!r1= x1
40
-
let!r2= x2
41
-
return ValueOption.zip r1 r2
42
-
}
43
-
)
31
+
valueTask {
32
+
let!r1= x1
33
+
let!r2= x2
34
+
return ValueOption.zip r1 r2
35
+
}
44
36
45
37
/// <summary>
46
38
/// Returns result of running <paramrefname="onValueSome"/> if it is <c>ValueSome</c>, otherwise returns result of running <paramrefname="onValueNone"/>
0 commit comments