Skip to content

Commit

Permalink
version 1.17.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti committed Apr 29, 2019
1 parent 6c9c4fd commit db3f825
Show file tree
Hide file tree
Showing 22 changed files with 130 additions and 129 deletions.
16 changes: 13 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,21 @@
**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.

# 1.17.1
# 1.17.2

- **Polish**
- add `Bifunctor2C` interface (@gcanti)
- add `Profunctor2C` interface (@gcanti)
- replace `Array<any>` with `Array<unknown>` in `FunctionN` definition (@ta2gch)
- add refinement overloads to `filter` / `partition` (`Filterable` type class) (@gcanti)
- add refinement overloads to `filterWithIndex` / `partitionWithIndex` (`FilterableWithIndex` type class) (@gcanti)
- **Deprecation**
- deprecate `Array.filter`, `Array.partition` in favour of `Array.array.filter` and `Array.array.partition` (@gcanti)

**Polish**
# 1.17.1

- make `Type<URI1, A>` not assignable to `Type<URI2, A>`, closes #536 (@gcanti)
- **Polish**
- make `Type<URI1, A>` not assignable to `Type<URI2, A>`, closes #536 (@gcanti)

# 1.17.0

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/Array.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ assert.deepStrictEqual(scanLeft([1, 2, 3], 10, (b, a) => b - a), [10, 9, 7, 4])
**Signature**

```ts
export const scanLeft = <A, B>(as: Array<A>, b: B, f: ((b: B, a: A) => B)): Array<B> => ...
export const scanLeft = <A, B>(as: Array<A>, b: B, f: (b: B, a: A) => B): Array<B> => ...
```

Added in v1.1.0
Expand Down
8 changes: 4 additions & 4 deletions docs/modules/Free.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,14 @@ Use a natural transformation to change the generating type constructor of a free
```ts
export function hoistFree<F extends URIS3 = never, G extends URIS3 = never>(
nt: <U, L, A>(fa: Type3<F, U, L, A>) => Type3<G, U, L, A>
): (<A>(fa: Free<F, A>) => Free<G, A>)
): <A>(fa: Free<F, A>) => Free<G, A>
export function hoistFree<F extends URIS2 = never, G extends URIS2 = never>(
nt: <L, A>(fa: Type2<F, L, A>) => Type2<G, L, A>
): (<A>(fa: Free<F, A>) => Free<G, A>)
): <A>(fa: Free<F, A>) => Free<G, A>
export function hoistFree<F extends URIS = never, G extends URIS = never>(
nt: <A>(fa: Type<F, A>) => Type<G, A>
): (<A>(fa: Free<F, A>) => Free<G, A>)
export function hoistFree<F, G>(nt: <A>(fa: HKT<F, A>) => HKT<G, A>): (<A>(fa: Free<F, A>) => Free<G, A>) { ... }
): <A>(fa: Free<F, A>) => Free<G, A>
export function hoistFree<F, G>(nt: <A>(fa: HKT<F, A>) => HKT<G, A>): <A>(fa: Free<F, A>) => Free<G, A> { ... }
```

Added in v1.0.0
Expand Down
4 changes: 2 additions & 2 deletions docs/modules/ReaderTaskEither.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,11 @@ Added in v1.6.0
export function fromPredicate<E, L, A, B extends A>(
predicate: Refinement<A, B>,
onFalse: (a: A) => L
): ((a: A) => ReaderTaskEither<E, L, B>)
): (a: A) => ReaderTaskEither<E, L, B>
export function fromPredicate<E, L, A>(
predicate: Predicate<A>,
onFalse: (a: A) => L
): ((a: A) => ReaderTaskEither<E, L, A>) { ... }
): (a: A) => ReaderTaskEither<E, L, A> { ... }
```

Added in v1.6.0
Expand Down
36 changes: 18 additions & 18 deletions docs/modules/Record.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -738,40 +738,40 @@ Added in v1.10.0
```ts
export function wilt<F extends URIS3>(
F: Applicative3<F>
): (<U, L, RL, RR, A>(
): <U, L, RL, RR, A>(
wa: Record<string, A>,
f: (a: A) => Type3<F, U, L, Either<RL, RR>>
) => Type3<F, U, L, Separated<Record<string, RL>, Record<string, RR>>>)
) => Type3<F, U, L, Separated<Record<string, RL>, Record<string, RR>>>
export function wilt<F extends URIS3, U, L>(
F: Applicative3C<F, U, L>
): (<RL, RR, A>(
): <RL, RR, A>(
wa: Record<string, A>,
f: (a: A) => Type3<F, U, L, Either<RL, RR>>
) => Type3<F, U, L, Separated<Record<string, RL>, Record<string, RR>>>)
) => Type3<F, U, L, Separated<Record<string, RL>, Record<string, RR>>>
export function wilt<F extends URIS2>(
F: Applicative2<F>
): (<L, RL, RR, A>(
): <L, RL, RR, A>(
wa: Record<string, A>,
f: (a: A) => Type2<F, L, Either<RL, RR>>
) => Type2<F, L, Separated<Record<string, RL>, Record<string, RR>>>)
) => Type2<F, L, Separated<Record<string, RL>, Record<string, RR>>>
export function wilt<F extends URIS2, L>(
F: Applicative2C<F, L>
): (<RL, RR, A>(
): <RL, RR, A>(
wa: Record<string, A>,
f: (a: A) => Type2<F, L, Either<RL, RR>>
) => Type2<F, L, Separated<Record<string, RL>, Record<string, RR>>>)
) => Type2<F, L, Separated<Record<string, RL>, Record<string, RR>>>
export function wilt<F extends URIS>(
F: Applicative1<F>
): (<RL, RR, A>(
): <RL, RR, A>(
wa: Record<string, A>,
f: (a: A) => Type<F, Either<RL, RR>>
) => Type<F, Separated<Record<string, RL>, Record<string, RR>>>)
) => Type<F, Separated<Record<string, RL>, Record<string, RR>>>
export function wilt<F>(
F: Applicative<F>
): (<RL, RR, A>(
): <RL, RR, A>(
wa: Record<string, A>,
f: (a: A) => HKT<F, Either<RL, RR>>
) => HKT<F, Separated<Record<string, RL>, Record<string, RR>>>) { ... }
) => HKT<F, Separated<Record<string, RL>, Record<string, RR>>> { ... }
```

Added in v1.10.0
Expand All @@ -783,22 +783,22 @@ Added in v1.10.0
```ts
export function wither<F extends URIS3>(
F: Applicative3<F>
): (<U, L, A, B>(wa: Record<string, A>, f: (a: A) => Type3<F, U, L, Option<B>>) => Type3<F, U, L, Record<string, B>>)
): <U, L, A, B>(wa: Record<string, A>, f: (a: A) => Type3<F, U, L, Option<B>>) => Type3<F, U, L, Record<string, B>>
export function wither<F extends URIS3, U, L>(
F: Applicative3C<F, U, L>
): (<A, B>(wa: Record<string, A>, f: (a: A) => Type3<F, U, L, Option<B>>) => Type3<F, U, L, Record<string, B>>)
): <A, B>(wa: Record<string, A>, f: (a: A) => Type3<F, U, L, Option<B>>) => Type3<F, U, L, Record<string, B>>
export function wither<F extends URIS2>(
F: Applicative2<F>
): (<L, A, B>(wa: Record<string, A>, f: (a: A) => Type2<F, L, Option<B>>) => Type2<F, L, Record<string, B>>)
): <L, A, B>(wa: Record<string, A>, f: (a: A) => Type2<F, L, Option<B>>) => Type2<F, L, Record<string, B>>
export function wither<F extends URIS2, L>(
F: Applicative2C<F, L>
): (<A, B>(wa: Record<string, A>, f: (a: A) => Type2<F, L, Option<B>>) => Type2<F, L, Record<string, B>>)
): <A, B>(wa: Record<string, A>, f: (a: A) => Type2<F, L, Option<B>>) => Type2<F, L, Record<string, B>>
export function wither<F extends URIS>(
F: Applicative1<F>
): (<A, B>(wa: Record<string, A>, f: (a: A) => Type<F, Option<B>>) => Type<F, Record<string, B>>)
): <A, B>(wa: Record<string, A>, f: (a: A) => Type<F, Option<B>>) => Type<F, Record<string, B>>
export function wither<F>(
F: Applicative<F>
): (<A, B>(wa: Record<string, A>, f: (a: A) => HKT<F, Option<B>>) => HKT<F, Record<string, B>>) { ... }
): <A, B>(wa: Record<string, A>, f: (a: A) => HKT<F, Option<B>>) => HKT<F, Record<string, B>> { ... }
```

Added in v1.10.0
4 changes: 2 additions & 2 deletions docs/modules/StrMap.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,8 @@ Unfolds a dictionary into a list of key/value pairs
**Signature**

```ts
export function toUnfoldable<F extends URIS>(U: Unfoldable1<F>): (<A>(d: StrMap<A>) => Type<F, [string, A]>)
export function toUnfoldable<F>(U: Unfoldable<F>): (<A>(d: StrMap<A>) => HKT<F, [string, A]>) { ... }
export function toUnfoldable<F extends URIS>(U: Unfoldable1<F>): <A>(d: StrMap<A>) => Type<F, [string, A]>
export function toUnfoldable<F>(U: Unfoldable<F>): <A>(d: StrMap<A>) => HKT<F, [string, A]> { ... }
```

Added in v1.0.0
Expand Down
4 changes: 2 additions & 2 deletions docs/modules/TaskEither.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,8 @@ Added in v1.3.0
export function fromPredicate<L, A, B extends A>(
predicate: Refinement<A, B>,
onFalse: (a: A) => L
): ((a: A) => TaskEither<L, B>)
export function fromPredicate<L, A>(predicate: Predicate<A>, onFalse: (a: A) => L): ((a: A) => TaskEither<L, A>) { ... }
): (a: A) => TaskEither<L, B>
export function fromPredicate<L, A>(predicate: Predicate<A>, onFalse: (a: A) => L): (a: A) => TaskEither<L, A> { ... }
```

Added in v1.6.0
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fp-ts",
"version": "1.17.1",
"version": "1.17.2",
"description": "Functional programming in TypeScript",
"files": [
"lib",
Expand Down Expand Up @@ -52,7 +52,7 @@
"glob": "^7.1.3",
"jest": "^23.6.0",
"mocha": "^5.2.0",
"prettier": "1.14.3",
"prettier": "^1.17.0",
"rimraf": "2.6.2",
"ts-jest": "^24.0.0",
"ts-node": "^8.0.2",
Expand Down
2 changes: 1 addition & 1 deletion src/Array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ export const foldrL = <A, B>(as: Array<A>, nil: () => B, cons: (init: Array<A>,
*
* @since 1.1.0
*/
export const scanLeft = <A, B>(as: Array<A>, b: B, f: ((b: B, a: A) => B)): Array<B> => {
export const scanLeft = <A, B>(as: Array<A>, b: B, f: (b: B, a: A) => B): Array<B> => {
const l = as.length
const r: Array<B> = new Array(l + 1)
r[0] = b
Expand Down
4 changes: 2 additions & 2 deletions src/Either.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ export const getShow = <L, A>(SL: Show<L>, SA: Show<A>): Show<Either<L, A>> => {
* @since 1.0.0
*/
export const getSetoid = <L, A>(SL: Setoid<L>, SA: Setoid<A>): Setoid<Either<L, A>> => {
return fromEquals(
(x, y) => (x.isLeft() ? y.isLeft() && SL.equals(x.value, y.value) : y.isRight() && SA.equals(x.value, y.value))
return fromEquals((x, y) =>
x.isLeft() ? y.isLeft() && SL.equals(x.value, y.value) : y.isRight() && SA.equals(x.value, y.value)
)
}

Expand Down
10 changes: 5 additions & 5 deletions src/Free.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ const substFree = <F, G>(f: <A>(fa: HKT<F, A>) => Free<G, A>): (<A>(fa: Free<F,
*/
export function hoistFree<F extends URIS3 = never, G extends URIS3 = never>(
nt: <U, L, A>(fa: Type3<F, U, L, A>) => Type3<G, U, L, A>
): (<A>(fa: Free<F, A>) => Free<G, A>)
): <A>(fa: Free<F, A>) => Free<G, A>
export function hoistFree<F extends URIS2 = never, G extends URIS2 = never>(
nt: <L, A>(fa: Type2<F, L, A>) => Type2<G, L, A>
): (<A>(fa: Free<F, A>) => Free<G, A>)
): <A>(fa: Free<F, A>) => Free<G, A>
export function hoistFree<F extends URIS = never, G extends URIS = never>(
nt: <A>(fa: Type<F, A>) => Type<G, A>
): (<A>(fa: Free<F, A>) => Free<G, A>)
export function hoistFree<F, G>(nt: <A>(fa: HKT<F, A>) => HKT<G, A>): (<A>(fa: Free<F, A>) => Free<G, A>)
export function hoistFree<F, G>(nt: <A>(fa: HKT<F, A>) => HKT<G, A>): (<A>(fa: Free<F, A>) => Free<G, A>) {
): <A>(fa: Free<F, A>) => Free<G, A>
export function hoistFree<F, G>(nt: <A>(fa: HKT<F, A>) => HKT<G, A>): <A>(fa: Free<F, A>) => Free<G, A>
export function hoistFree<F, G>(nt: <A>(fa: HKT<F, A>) => HKT<G, A>): <A>(fa: Free<F, A>) => Free<G, A> {
return substFree(fa => liftF(nt(fa)))
}

Expand Down
6 changes: 3 additions & 3 deletions src/ReaderTaskEither.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,15 @@ export const fromIOEither = <E, L, A>(fa: IOEither<L, A>): ReaderTaskEither<E, L
export function fromPredicate<E, L, A, B extends A>(
predicate: Refinement<A, B>,
onFalse: (a: A) => L
): ((a: A) => ReaderTaskEither<E, L, B>)
): (a: A) => ReaderTaskEither<E, L, B>
export function fromPredicate<E, L, A>(
predicate: Predicate<A>,
onFalse: (a: A) => L
): ((a: A) => ReaderTaskEither<E, L, A>)
): (a: A) => ReaderTaskEither<E, L, A>
export function fromPredicate<E, L, A>(
predicate: Predicate<A>,
onFalse: (a: A) => L
): ((a: A) => ReaderTaskEither<E, L, A>) {
): (a: A) => ReaderTaskEither<E, L, A> {
const f = taskEither.fromPredicate(predicate, onFalse)
return a => fromTaskEither(f(a))
}
Expand Down
42 changes: 21 additions & 21 deletions src/Record.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,25 +453,25 @@ export const separate = <RL, RR>(
*/
export function wither<F extends URIS3>(
F: Applicative3<F>
): (<U, L, A, B>(wa: Record<string, A>, f: (a: A) => Type3<F, U, L, Option<B>>) => Type3<F, U, L, Record<string, B>>)
): <U, L, A, B>(wa: Record<string, A>, f: (a: A) => Type3<F, U, L, Option<B>>) => Type3<F, U, L, Record<string, B>>
export function wither<F extends URIS3, U, L>(
F: Applicative3C<F, U, L>
): (<A, B>(wa: Record<string, A>, f: (a: A) => Type3<F, U, L, Option<B>>) => Type3<F, U, L, Record<string, B>>)
): <A, B>(wa: Record<string, A>, f: (a: A) => Type3<F, U, L, Option<B>>) => Type3<F, U, L, Record<string, B>>
export function wither<F extends URIS2>(
F: Applicative2<F>
): (<L, A, B>(wa: Record<string, A>, f: (a: A) => Type2<F, L, Option<B>>) => Type2<F, L, Record<string, B>>)
): <L, A, B>(wa: Record<string, A>, f: (a: A) => Type2<F, L, Option<B>>) => Type2<F, L, Record<string, B>>
export function wither<F extends URIS2, L>(
F: Applicative2C<F, L>
): (<A, B>(wa: Record<string, A>, f: (a: A) => Type2<F, L, Option<B>>) => Type2<F, L, Record<string, B>>)
): <A, B>(wa: Record<string, A>, f: (a: A) => Type2<F, L, Option<B>>) => Type2<F, L, Record<string, B>>
export function wither<F extends URIS>(
F: Applicative1<F>
): (<A, B>(wa: Record<string, A>, f: (a: A) => Type<F, Option<B>>) => Type<F, Record<string, B>>)
): <A, B>(wa: Record<string, A>, f: (a: A) => Type<F, Option<B>>) => Type<F, Record<string, B>>
export function wither<F>(
F: Applicative<F>
): (<A, B>(wa: Record<string, A>, f: (a: A) => HKT<F, Option<B>>) => HKT<F, Record<string, B>>)
): <A, B>(wa: Record<string, A>, f: (a: A) => HKT<F, Option<B>>) => HKT<F, Record<string, B>>
export function wither<F>(
F: Applicative<F>
): (<A, B>(wa: Record<string, A>, f: (a: A) => HKT<F, Option<B>>) => HKT<F, Record<string, B>>) {
): <A, B>(wa: Record<string, A>, f: (a: A) => HKT<F, Option<B>>) => HKT<F, Record<string, B>> {
const traverseF = traverse(F)
return (wa, f) => F.map(traverseF(wa, f), compact)
}
Expand All @@ -481,46 +481,46 @@ export function wither<F>(
*/
export function wilt<F extends URIS3>(
F: Applicative3<F>
): (<U, L, RL, RR, A>(
): <U, L, RL, RR, A>(
wa: Record<string, A>,
f: (a: A) => Type3<F, U, L, Either<RL, RR>>
) => Type3<F, U, L, Separated<Record<string, RL>, Record<string, RR>>>)
) => Type3<F, U, L, Separated<Record<string, RL>, Record<string, RR>>>
export function wilt<F extends URIS3, U, L>(
F: Applicative3C<F, U, L>
): (<RL, RR, A>(
): <RL, RR, A>(
wa: Record<string, A>,
f: (a: A) => Type3<F, U, L, Either<RL, RR>>
) => Type3<F, U, L, Separated<Record<string, RL>, Record<string, RR>>>)
) => Type3<F, U, L, Separated<Record<string, RL>, Record<string, RR>>>
export function wilt<F extends URIS2>(
F: Applicative2<F>
): (<L, RL, RR, A>(
): <L, RL, RR, A>(
wa: Record<string, A>,
f: (a: A) => Type2<F, L, Either<RL, RR>>
) => Type2<F, L, Separated<Record<string, RL>, Record<string, RR>>>)
) => Type2<F, L, Separated<Record<string, RL>, Record<string, RR>>>
export function wilt<F extends URIS2, L>(
F: Applicative2C<F, L>
): (<RL, RR, A>(
): <RL, RR, A>(
wa: Record<string, A>,
f: (a: A) => Type2<F, L, Either<RL, RR>>
) => Type2<F, L, Separated<Record<string, RL>, Record<string, RR>>>)
) => Type2<F, L, Separated<Record<string, RL>, Record<string, RR>>>
export function wilt<F extends URIS>(
F: Applicative1<F>
): (<RL, RR, A>(
): <RL, RR, A>(
wa: Record<string, A>,
f: (a: A) => Type<F, Either<RL, RR>>
) => Type<F, Separated<Record<string, RL>, Record<string, RR>>>)
) => Type<F, Separated<Record<string, RL>, Record<string, RR>>>
export function wilt<F>(
F: Applicative<F>
): (<RL, RR, A>(
): <RL, RR, A>(
wa: Record<string, A>,
f: (a: A) => HKT<F, Either<RL, RR>>
) => HKT<F, Separated<Record<string, RL>, Record<string, RR>>>)
) => HKT<F, Separated<Record<string, RL>, Record<string, RR>>>
export function wilt<F>(
F: Applicative<F>
): (<RL, RR, A>(
): <RL, RR, A>(
wa: Record<string, A>,
f: (a: A) => HKT<F, Either<RL, RR>>
) => HKT<F, Separated<Record<string, RL>, Record<string, RR>>>) {
) => HKT<F, Separated<Record<string, RL>, Record<string, RR>>> {
const traverseF = traverse(F)
return (wa, f) => F.map(traverseF(wa, f), separate)
}
Expand Down
6 changes: 3 additions & 3 deletions src/StrMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,9 @@ export const toArray = <A>(d: StrMap<A>): Array<[string, A]> => {
*
* @since 1.0.0
*/
export function toUnfoldable<F extends URIS>(U: Unfoldable1<F>): (<A>(d: StrMap<A>) => Type<F, [string, A]>)
export function toUnfoldable<F>(U: Unfoldable<F>): (<A>(d: StrMap<A>) => HKT<F, [string, A]>)
export function toUnfoldable<F>(U: Unfoldable<F>): (<A>(d: StrMap<A>) => HKT<F, [string, A]>) {
export function toUnfoldable<F extends URIS>(U: Unfoldable1<F>): <A>(d: StrMap<A>) => Type<F, [string, A]>
export function toUnfoldable<F>(U: Unfoldable<F>): <A>(d: StrMap<A>) => HKT<F, [string, A]>
export function toUnfoldable<F>(U: Unfoldable<F>): <A>(d: StrMap<A>) => HKT<F, [string, A]> {
const toUnfoldableU = R.toUnfoldable(U)
return <A>(d: StrMap<A>) => toUnfoldableU<string, A>(d.value)
}
Expand Down
6 changes: 3 additions & 3 deletions src/TaskEither.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ export const fromIOEither = <L, A>(fa: IOEither<L, A>): TaskEither<L, A> => {
export function fromPredicate<L, A, B extends A>(
predicate: Refinement<A, B>,
onFalse: (a: A) => L
): ((a: A) => TaskEither<L, B>)
export function fromPredicate<L, A>(predicate: Predicate<A>, onFalse: (a: A) => L): ((a: A) => TaskEither<L, A>)
export function fromPredicate<L, A>(predicate: Predicate<A>, onFalse: (a: A) => L): ((a: A) => TaskEither<L, A>) {
): (a: A) => TaskEither<L, B>
export function fromPredicate<L, A>(predicate: Predicate<A>, onFalse: (a: A) => L): (a: A) => TaskEither<L, A>
export function fromPredicate<L, A>(predicate: Predicate<A>, onFalse: (a: A) => L): (a: A) => TaskEither<L, A> {
const f = eitherFromPredicate(predicate, onFalse)
return a => fromEither(f(a))
}
Expand Down
Loading

0 comments on commit db3f825

Please sign in to comment.