@@ -83,133 +83,6 @@ export class FantasyX<F extends Stream, I, S, A> {
83
83
) , fB . plan )
84
84
) , this . plan ) )
85
85
}
86
- // patch(f: (a: A) => Partial<S> = _ => _): FantasyX<E, I, S, void> {
87
- // return new FantasyX<E, I, S, void>(intent$ => {
88
- // let machine = this.plan(intent$)
89
- // let update$ = streamOps.map<State<S, A>, State<S, void>>(
90
- // state => state.patch(f),
91
- // machine.update$
92
- // )
93
- // return { update$, actions: machine.actions }
94
- // })
95
- // }
96
-
97
- // bimap<B>(
98
- // fa: (b?: Actions<I>) => Actions<I>, fb: (a: A) => B
99
- // ): FantasyX<E, I, S, B> {
100
- // return new FantasyX<E, I, S, B>(intent$ => {
101
- // let machine = this.plan(intent$)
102
- // let update$ = streamOps.map<State<S, A>, State<S, B>>(
103
- // state => state.map(fb),
104
- // machine.update$
105
- // )
106
- // return { update$, actions: fa(machine.actions) }
107
- // })
108
- // }
109
-
110
- // combine3<B, C, D>(
111
- // f: (a: A, b: B, c: C) => D,
112
- // planB: FantasyX<E, I, S, B>,
113
- // planC: FantasyX<E, I, S, C>
114
- // ): FantasyX<E, I, S, D> {
115
- // return new FantasyX<E, I, S, D>(intent$ => {
116
- // let machineB = planB.plan(intent$),
117
- // machineA = this.plan(intent$),
118
- // machineC = planC.plan(intent$);
119
- // let update$ = streamOps.combine<State<S, A>, State<S, B>, State<S, C>, State<S, D>>(
120
- // (S1, S2, S3) =>
121
- // S1.chain(s1 =>
122
- // S2.chain(s2 =>
123
- // S3.chain(s3 =>
124
- // State.pure<S, D>(f(s1, s2, s3)))))
125
- // , machineA.update$, machineB.update$, machineC.update$
126
- // )
127
- // let actions = Object.assign({}, machineA.actions, machineB.actions, machineC.actions)
128
- // return { update$, actions }
129
- // })
130
- // }
131
-
132
- // combine4<B, C, D, F>(
133
- // f: (a: A, b: B, c: C, d: D) => F,
134
- // planB: FantasyX<E, I, S, B>,
135
- // planC: FantasyX<E, I, S, C>,
136
- // planD: FantasyX<E, I, S, D>
137
- // ): FantasyX<E, I, S, F> {
138
- // return new FantasyX<E, I, S, F>(intent$ => {
139
- // let machineB = planB.plan(intent$),
140
- // machineA = this.plan(intent$),
141
- // machineC = planC.plan(intent$),
142
- // machineD = planD.plan(intent$)
143
- // ;
144
- // let update$ = streamOps.combine<State<S, A>, State<S, B>, State<S, C>, State<S, D>, State<S, F>>(
145
- // (S1, S2, S3, S4) =>
146
- // S1.chain(s1 =>
147
- // S2.chain(s2 =>
148
- // S3.chain(s3 =>
149
- // S4.chain(s4 =>
150
- // State.pure<S, F>(f(s1, s2, s3, s4))))))
151
- // , machineA.update$, machineB.update$, machineC.update$, machineD.update$
152
- // )
153
- // let actions = Object.assign({}, machineA.actions, machineB.actions, machineC.actions, machineD.actions)
154
- // return { update$, actions }
155
- // })
156
- // }
157
-
158
- // combine5<B, C, D, F, G>(
159
- // f: (a: A, b: B, c: C, d: D, e: F) => G,
160
- // planB: FantasyX<E, I, S, B>,
161
- // planC: FantasyX<E, I, S, C>,
162
- // planD: FantasyX<E, I, S, D>,
163
- // planE: FantasyX<E, I, S, F>
164
- // ): FantasyX<E, I, S, G> {
165
- // return new FantasyX<E, I, S, G>(intent$ => {
166
- // let machineB = planB.plan(intent$),
167
- // machineA = this.plan(intent$),
168
- // machineC = planC.plan(intent$),
169
- // machineD = planD.plan(intent$),
170
- // machineE = planE.plan(intent$)
171
- // ;
172
- // let update$ = streamOps.combine<State<S, A>, State<S, B>, State<S, C>, State<S, D>, State<S, F>, State<S, G>>(
173
- // (S1, S2, S3, S4, S5) =>
174
- // S1.chain(s1 =>
175
- // S2.chain(s2 =>
176
- // S3.chain(s3 =>
177
- // S4.chain(s4 =>
178
- // S5.chain(s5 =>
179
- // State.pure<S, G>(f(s1, s2, s3, s4, s5)))))))
180
- // , machineA.update$, machineB.update$, machineC.update$, machineD.update$, machineE.update$
181
- // )
182
- // let actions = Object.assign({}, machineA.actions, machineB.actions, machineC.actions, machineD.actions, machineE.actions)
183
- // return { update$, actions }
184
- // })
185
- // }
186
-
187
-
188
- // concat(
189
- // fa: FantasyX<E, I, S, A>
190
- // ): FantasyX<E, I, S, A> {
191
- // return this.combine((a, b) => {
192
- // if (isSemigroup(a) && isSemigroup(b))
193
- // return a.concat(b)
194
- // else
195
- // return b
196
- // }, fa)
197
- // }
198
-
199
- // merge<B>(
200
- // fa: FantasyX<E, I, S, B>
201
- // ): FantasyX<E, I, S, A | B> {
202
- // return new FantasyX<E, I, S, A | B>(intent$ => {
203
- // let machineA = this.plan(intent$)
204
- // let machineB = fa.plan(intent$)
205
- // let update$ = streamOps.merge<State<S, A | B>>(
206
- // machineA.update$,
207
- // machineB.update$
208
- // )
209
- // return { update$, actions: Object.assign({}, machineA.actions, machineB.actions) }
210
- // })
211
- // }
212
-
213
86
}
214
87
215
88
declare module './typeclasses' {
0 commit comments