Skip to content

Commit

Permalink
version 0.6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti committed Feb 19, 2020
1 parent 4570089 commit 491d8c1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 26 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
**Note**: Gaps between patch versions are faulty/broken releases. **Note**: A feature tagged as Experimental is in a
high state of flux, you're at risk of it changing without notice.

# 0.6.7

- **New Feature**
- `ReaderObservable`
- add `Alternative` and `Filterable` instances (@mlegenhausen)

# 0.6.6

- **New Feature**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fp-ts-rxjs",
"version": "0.6.6",
"version": "0.6.7",
"description": "fp-ts bindings for RxJS",
"files": [
"lib",
Expand Down
14 changes: 2 additions & 12 deletions src/Observable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,8 @@ export const observable: Monad1<URI> & Alternative1<URI> & Filterable1<URI> & Mo
compact: fa => observable.filterMap(fa, identity),
separate: fa => observable.partitionMap(fa, identity),
partitionMap: (fa, f) => ({
left: observable.filterMap(fa, a =>
pipe(
f(a),
E.fold(O.some, () => O.none)
)
),
right: observable.filterMap(fa, a =>
pipe(
f(a),
E.fold(() => O.none, O.some)
)
)
left: observable.filterMap(fa, a => O.fromEither(E.swap(f(a)))),
right: observable.filterMap(fa, a => O.fromEither(f(a)))
}),
partition: <A>(fa: Observable<A>, p: Predicate<A>) => observable.partitionMap(fa, E.fromPredicate(p, identity)),
filterMap: <A, B>(fa: Observable<A>, f: (a: A) => O.Option<B>) =>
Expand Down
16 changes: 3 additions & 13 deletions src/ReaderObservable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { Observable } from 'rxjs'
import { getReaderM } from 'fp-ts/lib/ReaderT'
import * as R from './Observable'
import { pipeable, pipe } from 'fp-ts/lib/pipeable'
import { pipeable } from 'fp-ts/lib/pipeable'
import { IO } from 'fp-ts/lib/IO'
import { Monad2 } from 'fp-ts/lib/Monad'
import { Monoid } from 'fp-ts/lib/Monoid'
Expand Down Expand Up @@ -164,18 +164,8 @@ export const readerObservable: Monad2<URI> & Alternative2<URI> & Filterable2<URI
compact: fa => readerObservable.filterMap(fa, identity),
separate: fa => readerObservable.partitionMap(fa, identity),
partitionMap: (fa, f) => ({
left: readerObservable.filterMap(fa, a =>
pipe(
f(a),
E.fold(O.some, () => O.none)
)
),
right: readerObservable.filterMap(fa, a =>
pipe(
f(a),
E.fold(() => O.none, O.some)
)
)
left: readerObservable.filterMap(fa, a => O.fromEither(E.swap(f(a)))),
right: readerObservable.filterMap(fa, a => O.fromEither(f(a)))
}),
partition: <R, A>(fa: ReaderObservable<R, A>, p: Predicate<A>) =>
readerObservable.partitionMap(fa, E.fromPredicate(p, identity)),
Expand Down

0 comments on commit 491d8c1

Please sign in to comment.