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
A functor with application, providing operations to embed pure expressions (``preturn``), parallel computations andcombine their results (``</>``).
7
+
ZipApplicative
8
+
==============
9
+
A functor with application, providing operations to embed pure expressions (``pur``), run computations pointwise and/or paralell and combine their results (``<.>``).
10
10
___
11
11
Minimal complete definition
12
12
---------------------------
13
-
* ``preturn x`` / ``result x``
14
-
* ``(</>) f x``
13
+
* ``pur x`` . ``result x``
14
+
* ``(<.>) f x``
15
15
*)
16
16
(**
17
-
static member ParReturn (x: 'T) : 'Applicative<'T>
- [Functor](abstraction-functor.html): A parallel applicative is a functor whose ``map`` operation can be splitted in ``preturn`` and ``(</>)`` operations,
60
+
- [Functor](abstraction-functor.html): A zipZipApplicative is a functor whose ``map`` operation can be splitted in ``pur`` and ``(<.>)`` operations,
56
61
57
-
- [Applicative](abstraction-applicative.html) : Parallel Applicatives are applicatives which usually don't form a [Monad](abstraction-monad.html).
62
+
- [ZipApplicative](abstraction-applicative.html) : ZipZipApplicatives are applicatives which usually don't form a [Monad](abstraction-monad.html).
member inline_.Return(x:'T)=ParReturn.Invoke x : '``Applicative<'T>``
217
-
member inline_.Yield(x:'T)=ParReturn.Invoke x : '``Applicative<'T>``
216
+
member inline_.Return(x:'T)=pur x : '``Applicative<'T>``
217
+
member inline_.Yield(x:'T)=pur x : '``Applicative<'T>``
218
218
member inline_.BindReturn(x,[<InlineIfLambda>]f)= map f x : '``Applicative<'U>``
219
-
member inline_.MergeSources(t1:'``Applicative<'T>``, t2: '``Applicative<'U>``):'``Applicative<'T*'U>`` =ParLift2.Invoke tuple2 t1 t2
220
-
member inline_.MergeSources3(t1:'``Applicative<'T>``, t2: '``Applicative<'U>``,t3:'``Applicative<'V>``):'``Applicative<'T*'U*'V>`` =ParLift3.Invoke tuple3 t1 t2 t3
221
-
member_.Run f = f : '``Applicative<'T>``
219
+
member inline_.MergeSources(t1:'``Applicative<'T>``, t2: '``Applicative<'U>``):'``Applicative<'T*'U>`` =map2 tuple2 t1 t2
220
+
member inline_.MergeSources3(t1:'``Applicative<'T>``, t2: '``Applicative<'U>``,t3:'``Applicative<'V>``):'``Applicative<'T*'U*'V>`` =map3 tuple3 t1 t2 t3
221
+
member_.Run f :'``Applicative<'T>``= f
222
222
223
-
/// Generic 2 layers Parallel Applicative CE builder.
member inline_.Return(x:'T):'``Applicative1<Applicative2<'T>>`` =(presult>>presult) x
227
-
member inline_.Yield(x:'T):'``Applicative1<Applicative2<'T>>`` =(presult>>presult) x
226
+
member inline_.Return(x:'T):'``Applicative1<Applicative2<'T>>`` =(pur>>pur) x
227
+
member inline_.Yield(x:'T):'``Applicative1<Applicative2<'T>>`` =(pur>>pur) x
228
228
member inline_.BindReturn(x:'``Applicative1<Applicative2<'T>>``,[<InlineIfLambda>]f:_ ->_):'``Applicative1<Applicative2<'U>>`` =(map >> map) f x
229
-
member inline_.MergeSources(t1,t2):'``Applicative1<Applicative2<'T>>`` =(plift2>>plift2) tuple2 t1 t2
230
-
member inline_.MergeSources3(t1,t2,t3):'``Applicative1<Applicative2<'T>>`` =(plift3>>plift3) tuple3 t1 t2 t3
229
+
member inline_.MergeSources(t1,t2):'``Applicative1<Applicative2<'T>>`` =(map2>>map2) tuple2 t1 t2
230
+
member inline_.MergeSources3(t1,t2,t3):'``Applicative1<Applicative2<'T>>`` =(map3>>map3) tuple3 t1 t2 t3
231
231
member_.Run x :'``Applicative1<Applicative2<'T>>`` = x
232
232
233
233
/// Creates a (lazy) monadic computation expression with side-effects (see http://fsprojects.github.io/FSharpPlus/computation-expressions.html for more information)
Copy file name to clipboardexpand all lines: src/FSharpPlus/Control/Applicative.fs
+6-6
Original file line number
Diff line number
Diff line change
@@ -109,12 +109,12 @@ type Lift2 =
109
109
static member inlineLift2(f,((a:'Monoid,x:'T),(b:'Monoid,y:'U)),_mthd:Lift2)= Plus.Invoke a b, f x y
110
110
static member inlineLift2(f,(struct(a:'Monoid,x:'T),struct(b:'Monoid,y:'U)),_mthd:Lift2)=struct(Plus.Invoke a b, f x y)
111
111
#if!FABLE_COMPILER
112
-
static memberLift2(f,(x:Task<'T>,y:Task<'U>),_mthd:Lift2)= Task.map2 f x y
112
+
static memberLift2(f,(x:Task<'T>,y:Task<'U>),_mthd:Lift2)= Task.lift2 f x y
113
113
#endif
114
114
#if!NET45 &&!NETSTANDARD2_0 &&!FABLE_COMPILER
115
-
static memberLift2(f,(x:ValueTask<'T>,y:ValueTask<'U>),_mthd:Lift2)= ValueTask.map2 f x y
115
+
static memberLift2(f,(x:ValueTask<'T>,y:ValueTask<'U>),_mthd:Lift2)= ValueTask.lift2 f x y
116
116
#endif
117
-
static memberLift2(f,(x ,y ),_mthd:Lift2)= Async.map2 f x y
117
+
static memberLift2(f,(x ,y ),_mthd:Lift2)= Async.lift2 f x y
118
118
static memberLift2(f,(x ,y ),_mthd:Lift2)= Option.map2 f x y
119
119
120
120
#if!FABLE_COMPILER
@@ -158,12 +158,12 @@ type Lift3 =
158
158
static member inlineLift3(f,((a:'Monoid,x:'T),(b:'Monoid,y:'U),(c:'Monoid,z:'U)),_mthd:Lift3)= Plus.Invoke (Plus.Invoke a b) c, f x y z
159
159
static member inlineLift3(f,(struct(a:'Monoid,x:'T),struct(b:'Monoid,y:'U),struct(c:'Monoid,z:'U)),_mthd:Lift3)=struct(Plus.Invoke (Plus.Invoke a b) c, f x y z)
160
160
#if!FABLE_COMPILER
161
-
static memberLift3(f,(x:Task<'T>,y:Task<'U>,z:Task<'V>),_mthd:Lift3)= Task.map3 f x y z
161
+
static memberLift3(f,(x:Task<'T>,y:Task<'U>,z:Task<'V>),_mthd:Lift3)= Task.lift3 f x y z
162
162
#endif
163
163
#if!NET45 &&!NETSTANDARD2_0 &&!FABLE_COMPILER
164
-
static memberLift3(f,(x:ValueTask<'T>,y:ValueTask<'U>,z:ValueTask<'V>),_mthd:Lift3)= ValueTask.map3 f x y z
164
+
static memberLift3(f,(x:ValueTask<'T>,y:ValueTask<'U>,z:ValueTask<'V>),_mthd:Lift3)= ValueTask.lift3 f x y z
165
165
#endif
166
-
static memberLift3(f,(x ,y ,z ),_mthd:Lift3)= Async.map3 f x y z
166
+
static memberLift3(f,(x ,y ,z ),_mthd:Lift3)= Async.lift3 f x y z
167
167
static memberLift3(f,(x ,y ,z ),_mthd:Lift3)= Option.map3 f x y z
0 commit comments