@@ -14,6 +14,7 @@ import { MonadThrow3 } from 'fp-ts/lib/MonadThrow'
1414import { Option } from 'fp-ts/lib/Option'
1515import { pipe } from 'fp-ts/lib/pipeable'
1616import * as R from 'fp-ts/lib/Reader'
17+ import { OperatorFunction } from 'rxjs'
1718import { MonadObservable3 } from './MonadObservable'
1819import * as OE from './ObservableEither'
1920
@@ -103,6 +104,19 @@ export const local: <R2, R1>(
103104 f : ( d : R2 ) => R1
104105) => < E , A > ( ma : ReaderObservableEither < R1 , E , A > ) => ReaderObservableEither < R2 , E , A > = R . local
105106
107+ /**
108+ * Lifts an OperatorFunction into a ReaderObservableEither context
109+ * Allows e.g. filter to be used on on ReaderObservableEither
110+ *
111+ * @category combinators
112+ * @since 0.6.12
113+ */
114+ export function liftOperator < R , E , A , B > (
115+ f : OperatorFunction < A , B >
116+ ) : ( obs : ReaderObservableEither < R , E , A > ) => ReaderObservableEither < R , E , B > {
117+ return obs => r => OE . liftOperator < E , A , B > ( f ) ( obs ( r ) )
118+ }
119+
106120// -------------------------------------------------------------------------------------
107121// type class members
108122// -------------------------------------------------------------------------------------
@@ -353,6 +367,15 @@ export const Applicative: Applicative3<URI> = {
353367 of
354368}
355369
370+
371+ /**
372+ * @since 0.6.8
373+ */
374+ export const chainW = < A , R2 , E2 , B > (
375+ f : ( a : A ) => ReaderObservableEither < R2 , E2 , B >
376+ ) => < R1 , E1 > ( ma : ReaderObservableEither < R1 , E2 , A > ) : ReaderObservableEither < R1 & R2 , E1 | E2 , B > =>
377+ chain ( f ) ( ma as any ) as any
378+
356379/**
357380 * @category instances
358381 * @since 0.6.12
0 commit comments