fp-ts-rxjs
Advanced tools
Comparing version 0.6.6 to 0.6.7
@@ -16,2 +16,8 @@ # Changelog | ||
# 0.6.7 | ||
- **New Feature** | ||
- `ReaderObservable` | ||
- add `Alternative` and `Filterable` instances (@mlegenhausen) | ||
# 0.6.6 | ||
@@ -18,0 +24,0 @@ |
@@ -105,8 +105,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
partitionMap: function (fa, f) { return ({ | ||
left: observable.filterMap(fa, function (a) { | ||
return pipe(f(a), E.fold(O.some, function () { return O.none; })); | ||
}), | ||
right: observable.filterMap(fa, function (a) { | ||
return pipe(f(a), E.fold(function () { return O.none; }, O.some)); | ||
}) | ||
left: observable.filterMap(fa, function (a) { return O.fromEither(E.swap(f(a))); }), | ||
right: observable.filterMap(fa, function (a) { return O.fromEither(f(a)); }) | ||
}); }, | ||
@@ -113,0 +109,0 @@ partition: function (fa, p) { return observable.partitionMap(fa, E.fromPredicate(p, identity)); }, |
@@ -11,4 +11,8 @@ /** | ||
import { MonadObservable2 } from './MonadObservable'; | ||
import { Option } from 'fp-ts/es6/Option'; | ||
import { ReaderTask } from 'fp-ts/es6/ReaderTask'; | ||
import { Alternative2 } from 'fp-ts/es6/Alternative'; | ||
import { Filterable2 } from 'fp-ts/es6/Filterable'; | ||
import { Predicate } from 'fp-ts/es6/function'; | ||
import * as E from 'fp-ts/es6/Either'; | ||
import * as O from 'fp-ts/es6/Option'; | ||
declare module 'fp-ts/es6/HKT' { | ||
@@ -48,3 +52,3 @@ interface URItoKind2<E, A> { | ||
*/ | ||
export declare function fromOption<R, A>(o: Option<A>): ReaderObservable<R, A>; | ||
export declare function fromOption<R, A>(o: O.Option<A>): ReaderObservable<R, A>; | ||
/** | ||
@@ -83,15 +87,15 @@ * @since 0.6.6 | ||
/** | ||
* @since 2.4.0 | ||
* @since 0.6.6 | ||
*/ | ||
export declare function fromIOK<A extends Array<unknown>, B>(f: (...a: A) => IO<B>): <R>(...a: A) => ReaderObservable<R, B>; | ||
/** | ||
* @since 2.4.0 | ||
* @since 0.6.6 | ||
*/ | ||
export declare function chainIOK<A, B>(f: (a: A) => IO<B>): <R>(ma: ReaderObservable<R, A>) => ReaderObservable<R, B>; | ||
/** | ||
* @since 2.4.0 | ||
* @since 0.6.6 | ||
*/ | ||
export declare function fromObservableK<A extends Array<unknown>, B>(f: (...a: A) => Observable<B>): <R>(...a: A) => ReaderObservable<R, B>; | ||
/** | ||
* @since 2.4.0 | ||
* @since 0.6.6 | ||
*/ | ||
@@ -102,4 +106,10 @@ export declare function chainTaskK<A, B>(f: (a: A) => Observable<B>): <R>(ma: ReaderObservable<R, A>) => ReaderObservable<R, B>; | ||
*/ | ||
export declare const readerObservable: Monad2<URI> & MonadObservable2<URI>; | ||
declare const ap: <E, A>(fa: ReaderObservable<E, A>) => <B>(fab: ReaderObservable<E, (a: A) => B>) => ReaderObservable<E, B>, apFirst: <E, B>(fb: ReaderObservable<E, B>) => <A>(fa: ReaderObservable<E, A>) => ReaderObservable<E, A>, apSecond: <E, B>(fb: ReaderObservable<E, B>) => <A>(fa: ReaderObservable<E, A>) => ReaderObservable<E, B>, chain: <E, A, B>(f: (a: A) => ReaderObservable<E, B>) => (ma: ReaderObservable<E, A>) => ReaderObservable<E, B>, chainFirst: <E, A, B>(f: (a: A) => ReaderObservable<E, B>) => (ma: ReaderObservable<E, A>) => ReaderObservable<E, A>, flatten: <E, A>(mma: ReaderObservable<E, ReaderObservable<E, A>>) => ReaderObservable<E, A>, map: <A, B>(f: (a: A) => B) => <E>(fa: ReaderObservable<E, A>) => ReaderObservable<E, B>; | ||
export declare const readerObservable: Monad2<URI> & Alternative2<URI> & Filterable2<URI> & MonadObservable2<URI>; | ||
declare const ap: <E, A>(fa: ReaderObservable<E, A>) => <B>(fab: ReaderObservable<E, (a: A) => B>) => ReaderObservable<E, B>, apFirst: <E, B>(fb: ReaderObservable<E, B>) => <A>(fa: ReaderObservable<E, A>) => ReaderObservable<E, A>, apSecond: <E, B>(fb: ReaderObservable<E, B>) => <A>(fa: ReaderObservable<E, A>) => ReaderObservable<E, B>, chain: <E, A, B>(f: (a: A) => ReaderObservable<E, B>) => (ma: ReaderObservable<E, A>) => ReaderObservable<E, B>, chainFirst: <E, A, B>(f: (a: A) => ReaderObservable<E, B>) => (ma: ReaderObservable<E, A>) => ReaderObservable<E, A>, flatten: <E, A>(mma: ReaderObservable<E, ReaderObservable<E, A>>) => ReaderObservable<E, A>, map: <A, B>(f: (a: A) => B) => <E>(fa: ReaderObservable<E, A>) => ReaderObservable<E, B>, alt: <E, A>(that: () => ReaderObservable<E, A>) => (fa: ReaderObservable<E, A>) => ReaderObservable<E, A>, compact: <E, A>(fa: ReaderObservable<E, O.Option<A>>) => ReaderObservable<E, A>, filter: { | ||
<A, B extends A>(refinement: import("fp-ts/lib/function").Refinement<A, B>): <E>(fa: ReaderObservable<E, A>) => ReaderObservable<E, B>; | ||
<A>(predicate: Predicate<A>): <E>(fa: ReaderObservable<E, A>) => ReaderObservable<E, A>; | ||
}, filterMap: <A, B>(f: (a: A) => O.Option<B>) => <E>(fa: ReaderObservable<E, A>) => ReaderObservable<E, B>, partition: { | ||
<A, B extends A>(refinement: import("fp-ts/lib/function").Refinement<A, B>): <E>(fa: ReaderObservable<E, A>) => import("fp-ts/lib/Compactable").Separated<ReaderObservable<E, A>, ReaderObservable<E, B>>; | ||
<A>(predicate: Predicate<A>): <E>(fa: ReaderObservable<E, A>) => import("fp-ts/lib/Compactable").Separated<ReaderObservable<E, A>, ReaderObservable<E, A>>; | ||
}, partitionMap: <A, B, C>(f: (a: A) => E.Either<B, C>) => <E>(fa: ReaderObservable<E, A>) => import("fp-ts/lib/Compactable").Separated<ReaderObservable<E, B>, ReaderObservable<E, C>>, separate: <E, A, B>(fa: ReaderObservable<E, E.Either<A, B>>) => import("fp-ts/lib/Compactable").Separated<ReaderObservable<E, A>, ReaderObservable<E, B>>; | ||
export { | ||
@@ -133,2 +143,30 @@ /** | ||
*/ | ||
map }; | ||
map, | ||
/** | ||
* @since 0.6.7 | ||
*/ | ||
alt, | ||
/** | ||
* @since 0.6.7 | ||
*/ | ||
compact, | ||
/** | ||
* @since 0.6.7 | ||
*/ | ||
filter, | ||
/** | ||
* @since 0.6.7 | ||
*/ | ||
filterMap, | ||
/** | ||
* @since 0.6.7 | ||
*/ | ||
partition, | ||
/** | ||
* @since 0.6.7 | ||
*/ | ||
partitionMap, | ||
/** | ||
* @since 0.6.7 | ||
*/ | ||
separate }; |
@@ -5,2 +5,5 @@ import { getReaderM } from 'fp-ts/es6/ReaderT'; | ||
import { getMonoid as getReaderMonoid } from 'fp-ts/es6/Reader'; | ||
import { identity } from 'fp-ts/es6/function'; | ||
import * as E from 'fp-ts/es6/Either'; | ||
import * as O from 'fp-ts/es6/Option'; | ||
var T = getReaderM(R.observable); | ||
@@ -74,3 +77,3 @@ /** | ||
/** | ||
* @since 2.4.0 | ||
* @since 0.6.6 | ||
*/ | ||
@@ -87,3 +90,3 @@ export function fromIOK(f) { | ||
/** | ||
* @since 2.4.0 | ||
* @since 0.6.6 | ||
*/ | ||
@@ -94,3 +97,3 @@ export function chainIOK(f) { | ||
/** | ||
* @since 2.4.0 | ||
* @since 0.6.6 | ||
*/ | ||
@@ -107,3 +110,3 @@ export function fromObservableK(f) { | ||
/** | ||
* @since 2.4.0 | ||
* @since 0.6.6 | ||
*/ | ||
@@ -122,2 +125,15 @@ export function chainTaskK(f) { | ||
chain: T.chain, | ||
zero: function () { return R.observable.zero; }, | ||
alt: function (fx, f) { return function (r) { return R.observable.alt(fx(r), function () { return f()(r); }); }; }, | ||
compact: function (fa) { return readerObservable.filterMap(fa, identity); }, | ||
separate: function (fa) { return readerObservable.partitionMap(fa, identity); }, | ||
partitionMap: function (fa, f) { return ({ | ||
left: readerObservable.filterMap(fa, function (a) { return O.fromEither(E.swap(f(a))); }), | ||
right: readerObservable.filterMap(fa, function (a) { return O.fromEither(f(a)); }) | ||
}); }, | ||
partition: function (fa, p) { | ||
return readerObservable.partitionMap(fa, E.fromPredicate(p, identity)); | ||
}, | ||
filterMap: function (fa, f) { return function (r) { return R.observable.filterMap(fa(r), f); }; }, | ||
filter: function (fa, p) { return readerObservable.filterMap(fa, O.fromPredicate(p)); }, | ||
fromIO: fromIO, | ||
@@ -127,3 +143,3 @@ fromTask: fromTask, | ||
}; | ||
var _a = pipeable(readerObservable), ap = _a.ap, apFirst = _a.apFirst, apSecond = _a.apSecond, chain = _a.chain, chainFirst = _a.chainFirst, flatten = _a.flatten, map = _a.map; | ||
var _a = pipeable(readerObservable), ap = _a.ap, apFirst = _a.apFirst, apSecond = _a.apSecond, chain = _a.chain, chainFirst = _a.chainFirst, flatten = _a.flatten, map = _a.map, alt = _a.alt, compact = _a.compact, filter = _a.filter, filterMap = _a.filterMap, partition = _a.partition, partitionMap = _a.partitionMap, separate = _a.separate; | ||
export { | ||
@@ -157,2 +173,30 @@ /** | ||
*/ | ||
map }; | ||
map, | ||
/** | ||
* @since 0.6.7 | ||
*/ | ||
alt, | ||
/** | ||
* @since 0.6.7 | ||
*/ | ||
compact, | ||
/** | ||
* @since 0.6.7 | ||
*/ | ||
filter, | ||
/** | ||
* @since 0.6.7 | ||
*/ | ||
filterMap, | ||
/** | ||
* @since 0.6.7 | ||
*/ | ||
partition, | ||
/** | ||
* @since 0.6.7 | ||
*/ | ||
partitionMap, | ||
/** | ||
* @since 0.6.7 | ||
*/ | ||
separate }; |
@@ -113,8 +113,4 @@ "use strict"; | ||
partitionMap: function (fa, f) { return ({ | ||
left: exports.observable.filterMap(fa, function (a) { | ||
return pipeable_1.pipe(f(a), E.fold(O.some, function () { return O.none; })); | ||
}), | ||
right: exports.observable.filterMap(fa, function (a) { | ||
return pipeable_1.pipe(f(a), E.fold(function () { return O.none; }, O.some)); | ||
}) | ||
left: exports.observable.filterMap(fa, function (a) { return O.fromEither(E.swap(f(a))); }), | ||
right: exports.observable.filterMap(fa, function (a) { return O.fromEither(f(a)); }) | ||
}); }, | ||
@@ -121,0 +117,0 @@ partition: function (fa, p) { return exports.observable.partitionMap(fa, E.fromPredicate(p, function_1.identity)); }, |
@@ -11,4 +11,8 @@ /** | ||
import { MonadObservable2 } from './MonadObservable'; | ||
import { Option } from 'fp-ts/lib/Option'; | ||
import { ReaderTask } from 'fp-ts/lib/ReaderTask'; | ||
import { Alternative2 } from 'fp-ts/lib/Alternative'; | ||
import { Filterable2 } from 'fp-ts/lib/Filterable'; | ||
import { Predicate } from 'fp-ts/lib/function'; | ||
import * as E from 'fp-ts/lib/Either'; | ||
import * as O from 'fp-ts/lib/Option'; | ||
declare module 'fp-ts/lib/HKT' { | ||
@@ -48,3 +52,3 @@ interface URItoKind2<E, A> { | ||
*/ | ||
export declare function fromOption<R, A>(o: Option<A>): ReaderObservable<R, A>; | ||
export declare function fromOption<R, A>(o: O.Option<A>): ReaderObservable<R, A>; | ||
/** | ||
@@ -83,15 +87,15 @@ * @since 0.6.6 | ||
/** | ||
* @since 2.4.0 | ||
* @since 0.6.6 | ||
*/ | ||
export declare function fromIOK<A extends Array<unknown>, B>(f: (...a: A) => IO<B>): <R>(...a: A) => ReaderObservable<R, B>; | ||
/** | ||
* @since 2.4.0 | ||
* @since 0.6.6 | ||
*/ | ||
export declare function chainIOK<A, B>(f: (a: A) => IO<B>): <R>(ma: ReaderObservable<R, A>) => ReaderObservable<R, B>; | ||
/** | ||
* @since 2.4.0 | ||
* @since 0.6.6 | ||
*/ | ||
export declare function fromObservableK<A extends Array<unknown>, B>(f: (...a: A) => Observable<B>): <R>(...a: A) => ReaderObservable<R, B>; | ||
/** | ||
* @since 2.4.0 | ||
* @since 0.6.6 | ||
*/ | ||
@@ -102,4 +106,10 @@ export declare function chainTaskK<A, B>(f: (a: A) => Observable<B>): <R>(ma: ReaderObservable<R, A>) => ReaderObservable<R, B>; | ||
*/ | ||
export declare const readerObservable: Monad2<URI> & MonadObservable2<URI>; | ||
declare const ap: <E, A>(fa: ReaderObservable<E, A>) => <B>(fab: ReaderObservable<E, (a: A) => B>) => ReaderObservable<E, B>, apFirst: <E, B>(fb: ReaderObservable<E, B>) => <A>(fa: ReaderObservable<E, A>) => ReaderObservable<E, A>, apSecond: <E, B>(fb: ReaderObservable<E, B>) => <A>(fa: ReaderObservable<E, A>) => ReaderObservable<E, B>, chain: <E, A, B>(f: (a: A) => ReaderObservable<E, B>) => (ma: ReaderObservable<E, A>) => ReaderObservable<E, B>, chainFirst: <E, A, B>(f: (a: A) => ReaderObservable<E, B>) => (ma: ReaderObservable<E, A>) => ReaderObservable<E, A>, flatten: <E, A>(mma: ReaderObservable<E, ReaderObservable<E, A>>) => ReaderObservable<E, A>, map: <A, B>(f: (a: A) => B) => <E>(fa: ReaderObservable<E, A>) => ReaderObservable<E, B>; | ||
export declare const readerObservable: Monad2<URI> & Alternative2<URI> & Filterable2<URI> & MonadObservable2<URI>; | ||
declare const ap: <E, A>(fa: ReaderObservable<E, A>) => <B>(fab: ReaderObservable<E, (a: A) => B>) => ReaderObservable<E, B>, apFirst: <E, B>(fb: ReaderObservable<E, B>) => <A>(fa: ReaderObservable<E, A>) => ReaderObservable<E, A>, apSecond: <E, B>(fb: ReaderObservable<E, B>) => <A>(fa: ReaderObservable<E, A>) => ReaderObservable<E, B>, chain: <E, A, B>(f: (a: A) => ReaderObservable<E, B>) => (ma: ReaderObservable<E, A>) => ReaderObservable<E, B>, chainFirst: <E, A, B>(f: (a: A) => ReaderObservable<E, B>) => (ma: ReaderObservable<E, A>) => ReaderObservable<E, A>, flatten: <E, A>(mma: ReaderObservable<E, ReaderObservable<E, A>>) => ReaderObservable<E, A>, map: <A, B>(f: (a: A) => B) => <E>(fa: ReaderObservable<E, A>) => ReaderObservable<E, B>, alt: <E, A>(that: () => ReaderObservable<E, A>) => (fa: ReaderObservable<E, A>) => ReaderObservable<E, A>, compact: <E, A>(fa: ReaderObservable<E, O.Option<A>>) => ReaderObservable<E, A>, filter: { | ||
<A, B extends A>(refinement: import("fp-ts/lib/function").Refinement<A, B>): <E>(fa: ReaderObservable<E, A>) => ReaderObservable<E, B>; | ||
<A>(predicate: Predicate<A>): <E>(fa: ReaderObservable<E, A>) => ReaderObservable<E, A>; | ||
}, filterMap: <A, B>(f: (a: A) => O.Option<B>) => <E>(fa: ReaderObservable<E, A>) => ReaderObservable<E, B>, partition: { | ||
<A, B extends A>(refinement: import("fp-ts/lib/function").Refinement<A, B>): <E>(fa: ReaderObservable<E, A>) => import("fp-ts/lib/Compactable").Separated<ReaderObservable<E, A>, ReaderObservable<E, B>>; | ||
<A>(predicate: Predicate<A>): <E>(fa: ReaderObservable<E, A>) => import("fp-ts/lib/Compactable").Separated<ReaderObservable<E, A>, ReaderObservable<E, A>>; | ||
}, partitionMap: <A, B, C>(f: (a: A) => E.Either<B, C>) => <E>(fa: ReaderObservable<E, A>) => import("fp-ts/lib/Compactable").Separated<ReaderObservable<E, B>, ReaderObservable<E, C>>, separate: <E, A, B>(fa: ReaderObservable<E, E.Either<A, B>>) => import("fp-ts/lib/Compactable").Separated<ReaderObservable<E, A>, ReaderObservable<E, B>>; | ||
export { | ||
@@ -133,2 +143,30 @@ /** | ||
*/ | ||
map }; | ||
map, | ||
/** | ||
* @since 0.6.7 | ||
*/ | ||
alt, | ||
/** | ||
* @since 0.6.7 | ||
*/ | ||
compact, | ||
/** | ||
* @since 0.6.7 | ||
*/ | ||
filter, | ||
/** | ||
* @since 0.6.7 | ||
*/ | ||
filterMap, | ||
/** | ||
* @since 0.6.7 | ||
*/ | ||
partition, | ||
/** | ||
* @since 0.6.7 | ||
*/ | ||
partitionMap, | ||
/** | ||
* @since 0.6.7 | ||
*/ | ||
separate }; |
@@ -7,2 +7,5 @@ "use strict"; | ||
var Reader_1 = require("fp-ts/lib/Reader"); | ||
var function_1 = require("fp-ts/lib/function"); | ||
var E = require("fp-ts/lib/Either"); | ||
var O = require("fp-ts/lib/Option"); | ||
var T = ReaderT_1.getReaderM(R.observable); | ||
@@ -83,3 +86,3 @@ /** | ||
/** | ||
* @since 2.4.0 | ||
* @since 0.6.6 | ||
*/ | ||
@@ -97,3 +100,3 @@ function fromIOK(f) { | ||
/** | ||
* @since 2.4.0 | ||
* @since 0.6.6 | ||
*/ | ||
@@ -105,3 +108,3 @@ function chainIOK(f) { | ||
/** | ||
* @since 2.4.0 | ||
* @since 0.6.6 | ||
*/ | ||
@@ -119,3 +122,3 @@ function fromObservableK(f) { | ||
/** | ||
* @since 2.4.0 | ||
* @since 0.6.6 | ||
*/ | ||
@@ -135,2 +138,15 @@ function chainTaskK(f) { | ||
chain: T.chain, | ||
zero: function () { return R.observable.zero; }, | ||
alt: function (fx, f) { return function (r) { return R.observable.alt(fx(r), function () { return f()(r); }); }; }, | ||
compact: function (fa) { return exports.readerObservable.filterMap(fa, function_1.identity); }, | ||
separate: function (fa) { return exports.readerObservable.partitionMap(fa, function_1.identity); }, | ||
partitionMap: function (fa, f) { return ({ | ||
left: exports.readerObservable.filterMap(fa, function (a) { return O.fromEither(E.swap(f(a))); }), | ||
right: exports.readerObservable.filterMap(fa, function (a) { return O.fromEither(f(a)); }) | ||
}); }, | ||
partition: function (fa, p) { | ||
return exports.readerObservable.partitionMap(fa, E.fromPredicate(p, function_1.identity)); | ||
}, | ||
filterMap: function (fa, f) { return function (r) { return R.observable.filterMap(fa(r), f); }; }, | ||
filter: function (fa, p) { return exports.readerObservable.filterMap(fa, O.fromPredicate(p)); }, | ||
fromIO: fromIO, | ||
@@ -140,3 +156,3 @@ fromTask: fromTask, | ||
}; | ||
var _a = pipeable_1.pipeable(exports.readerObservable), ap = _a.ap, apFirst = _a.apFirst, apSecond = _a.apSecond, chain = _a.chain, chainFirst = _a.chainFirst, flatten = _a.flatten, map = _a.map; | ||
var _a = pipeable_1.pipeable(exports.readerObservable), ap = _a.ap, apFirst = _a.apFirst, apSecond = _a.apSecond, chain = _a.chain, chainFirst = _a.chainFirst, flatten = _a.flatten, map = _a.map, alt = _a.alt, compact = _a.compact, filter = _a.filter, filterMap = _a.filterMap, partition = _a.partition, partitionMap = _a.partitionMap, separate = _a.separate; | ||
exports.ap = ap; | ||
@@ -149,1 +165,8 @@ exports.apFirst = apFirst; | ||
exports.map = map; | ||
exports.alt = alt; | ||
exports.compact = compact; | ||
exports.filter = filter; | ||
exports.filterMap = filterMap; | ||
exports.partition = partition; | ||
exports.partitionMap = partitionMap; | ||
exports.separate = separate; |
{ | ||
"name": "fp-ts-rxjs", | ||
"version": "0.6.6", | ||
"version": "0.6.7", | ||
"description": "fp-ts bindings for RxJS", | ||
@@ -5,0 +5,0 @@ "files": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46975
1406