Skip to content

Commit

Permalink
version 1.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti committed Mar 19, 2019
1 parent aa2e76f commit 67c06a5
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 290 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@
**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.15.0

**Note**. This version requires `typescript@3.0.1+` (mapped tuples)

- **New Feature**
- add `Apply.sequenceS`, closes #688 (@gcanti)
- make `function.tuple` variadic (@gcanti)
- make `Semigroup.getTupleSemigroup` variadic (@gcanti)
- make `Monoid.getTupleMonoid` variadic (@gcanti)
- make `Ord.getTupleOrd` variadic (@gcanti)
- make `Setoid.getTupleSetoid` variadic (@gcanti)
- make `Ring.getTupleRing` variadic (@gcanti)
- make `Apply.sequenceT` variadic (@gcanti)
- **Experimental**
- add `NonEmptyArray2v` module (type level non empty arrays), closes #735 (@gcanti)

# 1.14.4

- **Polish**
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,14 @@ Make sure to always have a single version of `fp-ts` installed in your project.

## TypeScript compatibility

The stable version is tested against **TypeScript 3.3.3**, but should run with TypeScript 2.8.0+ too.
**Strictness** – This library is conceived, tested and is supposed to be consumed by TypeScript with the `strict` flag turned on.

- **Strictness** – This library is conceived, tested and is supposed to be consumed by TypeScript with the `strict` flag turned on.
- **Compatibility** – If you are running `< typescript@3.0.1` you have to polyfill the `unknown` type. You can use [unknown-ts](https://github.com/gcanti/unknown-ts) as a polyfill.
| `fp-ts` version | required `typescript` version |
| --------------- | ----------------------------- |
| 1.15.x+ | 3.1+ |
| <= 1.14.4 | 2.8+ (\*) |

(\*) If you are running `< typescript@3.0.1` you have to polyfill the `unknown` type. You can use [unknown-ts](https://github.com/gcanti/unknown-ts) as a polyfill.

# Documentation

Expand Down
10 changes: 7 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ Make sure to always have a single version of `fp-ts` installed in your project.

## TypeScript compatibility

The stable version is tested against **TypeScript 3.3.3**, but should run with TypeScript 2.8.0+ too.
**Strictness** – This library is conceived, tested and is supposed to be consumed by TypeScript with the `strict` flag turned on.

- **Strictness** – This library is conceived, tested and is supposed to be consumed by TypeScript with the `strict` flag turned on.
- **Compatibility** – If you are running `< typescript@3.0.1` you have to polyfill the `unknown` type. You can use [unknown-ts](https://github.com/gcanti/unknown-ts) as a polyfill.
| `fp-ts` version | required `typescript` version |
| --------------- | ----------------------------- |
| 1.15.x+ | 3.1+ |
| <= 1.14.4 | 2.8+ (\*) |

(\*) If you are running `< typescript@3.0.1` you have to polyfill the `unknown` type. You can use [unknown-ts](https://github.com/gcanti/unknown-ts) as a polyfill.
312 changes: 30 additions & 282 deletions docs/modules/Apply.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ Formally, `Apply` represents a strong lax semi-monoidal endofunctor.
- [Apply2C (interface)](#apply2c-interface)
- [Apply3 (interface)](#apply3-interface)
- [Apply3C (interface)](#apply3c-interface)
- [SequenceT (interface)](#sequencet-interface)
- [SequenceT1 (interface)](#sequencet1-interface)
- [SequenceT2 (interface)](#sequencet2-interface)
- [SequenceT2C (interface)](#sequencet2c-interface)
- [SequenceT3 (interface)](#sequencet3-interface)
- [SequenceT3C (interface)](#sequencet3c-interface)
- [applyFirst (function)](#applyfirst-function)
- [applySecond (function)](#applysecond-function)
- [getSemigroup (function)](#getsemigroup-function)
Expand Down Expand Up @@ -106,276 +100,6 @@ export interface Apply3C<F extends URIS3, U, L> extends Functor3C<F, U, L> {
}
```

# SequenceT (interface)

**Signature**

```ts
export interface SequenceT<F> {
<A>(a: HKT<F, A>): HKT<F, [A]>
<A, B>(a: HKT<F, A>, b: HKT<F, B>): HKT<F, [A, B]>
<A, B, C>(a: HKT<F, A>, b: HKT<F, B>, c: HKT<F, C>): HKT<F, [A, B, C]>
<A, B, C, D>(a: HKT<F, A>, b: HKT<F, B>, c: HKT<F, C>, d: HKT<F, D>): HKT<F, [A, B, C, D]>
<A, B, C, D, E>(a: HKT<F, A>, b: HKT<F, B>, c: HKT<F, C>, d: HKT<F, D>, e: HKT<F, E>): HKT<F, [A, B, C, D, E]>
<A, B, C, D, E, G>(a: HKT<F, A>, b: HKT<F, B>, c: HKT<F, C>, d: HKT<F, D>, e: HKT<F, E>, g: HKT<F, G>): HKT<
F,
[A, B, C, D, E, G]
>
<A, B, C, D, E, G, H>(
a: HKT<F, A>,
b: HKT<F, B>,
c: HKT<F, C>,
d: HKT<F, D>,
e: HKT<F, E>,
g: HKT<F, G>,
h: HKT<F, H>
): HKT<F, [A, B, C, D, E, G, H]>
<A, B, C, D, E, G, H, I>(
a: HKT<F, A>,
b: HKT<F, B>,
c: HKT<F, C>,
d: HKT<F, D>,
e: HKT<F, E>,
g: HKT<F, G>,
h: HKT<F, H>,
i: HKT<F, I>
): HKT<F, [A, B, C, D, E, G, H, I]>
}
```

# SequenceT1 (interface)

**Signature**

```ts
export interface SequenceT1<F extends URIS> {
<A>(a: Type<F, A>): Type<F, [A]>
<A, B>(a: Type<F, A>, b: Type<F, B>): Type<F, [A, B]>
<A, B, C>(a: Type<F, A>, b: Type<F, B>, c: Type<F, C>): Type<F, [A, B, C]>
<A, B, C, D>(a: Type<F, A>, b: Type<F, B>, c: Type<F, C>, d: Type<F, D>): Type<F, [A, B, C, D]>
<A, B, C, D, E>(a: Type<F, A>, b: Type<F, B>, c: Type<F, C>, d: Type<F, D>, e: Type<F, E>): Type<F, [A, B, C, D, E]>
<A, B, C, D, E, G>(a: Type<F, A>, b: Type<F, B>, c: Type<F, C>, d: Type<F, D>, e: Type<F, E>, g: Type<F, G>): Type<
F,
[A, B, C, D, E, G]
>
<A, B, C, D, E, G, H>(
a: Type<F, A>,
b: Type<F, B>,
c: Type<F, C>,
d: Type<F, D>,
e: Type<F, E>,
g: Type<F, G>,
h: Type<F, H>
): Type<F, [A, B, C, D, E, G, H]>
<A, B, C, D, E, G, H, I>(
a: Type<F, A>,
b: Type<F, B>,
c: Type<F, C>,
d: Type<F, D>,
e: Type<F, E>,
g: Type<F, G>,
h: Type<F, H>,
i: Type<F, I>
): Type<F, [A, B, C, D, E, G, H, I]>
}
```

# SequenceT2 (interface)

**Signature**

```ts
export interface SequenceT2<F extends URIS2> {
<L, A>(a: Type2<F, L, A>): Type2<F, L, [A]>
<L, A, B>(a: Type2<F, L, A>, b: Type2<F, L, B>): Type2<F, L, [A, B]>
<L, A, B, C>(a: Type2<F, L, A>, b: Type2<F, L, B>, c: Type2<F, L, C>): Type2<F, L, [A, B, C]>
<L, A, B, C, D>(a: Type2<F, L, A>, b: Type2<F, L, B>, c: Type2<F, L, C>, d: Type2<F, L, D>): Type2<F, L, [A, B, C, D]>
<L, A, B, C, D, E>(
a: Type2<F, L, A>,
b: Type2<F, L, B>,
c: Type2<F, L, C>,
d: Type2<F, L, D>,
e: Type2<F, L, E>
): Type2<F, L, [A, B, C, D, E]>
<L, A, B, C, D, E, G>(
a: Type2<F, L, A>,
b: Type2<F, L, B>,
c: Type2<F, L, C>,
d: Type2<F, L, D>,
e: Type2<F, L, E>,
g: Type2<F, L, G>
): Type2<F, L, [A, B, C, D, E, G]>
<L, A, B, C, D, E, G, H>(
a: Type2<F, L, A>,
b: Type2<F, L, B>,
c: Type2<F, L, C>,
d: Type2<F, L, D>,
e: Type2<F, L, E>,
g: Type2<F, L, G>,
h: Type2<F, L, H>
): Type2<F, L, [A, B, C, D, E, G, H]>
<L, A, B, C, D, E, G, H, I>(
a: Type2<F, L, A>,
b: Type2<F, L, B>,
c: Type2<F, L, C>,
d: Type2<F, L, D>,
e: Type2<F, L, E>,
g: Type2<F, L, G>,
h: Type2<F, L, H>,
i: Type2<F, L, I>
): Type2<F, L, [A, B, C, D, E, G, H, I]>
}
```

# SequenceT2C (interface)

**Signature**

```ts
export interface SequenceT2C<F extends URIS2, L> {
<A>(a: Type2<F, L, A>): Type2<F, L, [A]>
<A, B>(a: Type2<F, L, A>, b: Type2<F, L, B>): Type2<F, L, [A, B]>
<A, B, C>(a: Type2<F, L, A>, b: Type2<F, L, B>, c: Type2<F, L, C>): Type2<F, L, [A, B, C]>
<A, B, C, D>(a: Type2<F, L, A>, b: Type2<F, L, B>, c: Type2<F, L, C>, d: Type2<F, L, D>): Type2<F, L, [A, B, C, D]>
<A, B, C, D, E>(a: Type2<F, L, A>, b: Type2<F, L, B>, c: Type2<F, L, C>, d: Type2<F, L, D>, e: Type2<F, L, E>): Type2<
F,
L,
[A, B, C, D, E]
>
<A, B, C, D, E, G>(
a: Type2<F, L, A>,
b: Type2<F, L, B>,
c: Type2<F, L, C>,
d: Type2<F, L, D>,
e: Type2<F, L, E>,
g: Type2<F, L, G>
): Type2<F, L, [A, B, C, D, E, G]>
<A, B, C, D, E, G, H>(
a: Type2<F, L, A>,
b: Type2<F, L, B>,
c: Type2<F, L, C>,
d: Type2<F, L, D>,
e: Type2<F, L, E>,
g: Type2<F, L, G>,
h: Type2<F, L, H>
): Type2<F, L, [A, B, C, D, E, G, H]>
<A, B, C, D, E, G, H, I>(
a: Type2<F, L, A>,
b: Type2<F, L, B>,
c: Type2<F, L, C>,
d: Type2<F, L, D>,
e: Type2<F, L, E>,
g: Type2<F, L, G>,
h: Type2<F, L, H>,
i: Type2<F, L, I>
): Type2<F, L, [A, B, C, D, E, G, H, I]>
}
```

# SequenceT3 (interface)

**Signature**

```ts
export interface SequenceT3<F extends URIS3> {
<U, L, A>(a: Type3<F, U, L, A>): Type3<F, U, L, [A]>
<U, L, A, B>(a: Type3<F, U, L, A>, b: Type3<F, U, L, B>): Type3<F, U, L, [A, B]>
<U, L, A, B, C>(a: Type3<F, U, L, A>, b: Type3<F, U, L, B>, c: Type3<F, U, L, C>): Type3<F, U, L, [A, B, C]>
<U, L, A, B, C, D>(a: Type3<F, U, L, A>, b: Type3<F, U, L, B>, c: Type3<F, U, L, C>, d: Type3<F, U, L, D>): Type3<
F,
U,
L,
[A, B, C, D]
>
<U, L, A, B, C, D, E>(
a: Type3<F, U, L, A>,
b: Type3<F, U, L, B>,
c: Type3<F, U, L, C>,
d: Type3<F, U, L, D>,
e: Type3<F, U, L, E>
): Type3<F, U, L, [A, B, C, D, E]>
<U, L, A, B, C, D, E, G>(
a: Type3<F, U, L, A>,
b: Type3<F, U, L, B>,
c: Type3<F, U, L, C>,
d: Type3<F, U, L, D>,
e: Type3<F, U, L, E>,
g: Type3<F, U, L, G>
): Type3<F, U, L, [A, B, C, D, E, G]>
<U, L, A, B, C, D, E, G, H>(
a: Type3<F, U, L, A>,
b: Type3<F, U, L, B>,
c: Type3<F, U, L, C>,
d: Type3<F, U, L, D>,
e: Type3<F, U, L, E>,
g: Type3<F, U, L, G>,
h: Type3<F, U, L, H>
): Type3<F, U, L, [A, B, C, D, E, G, H]>
<U, L, A, B, C, D, E, G, H, I>(
a: Type3<F, U, L, A>,
b: Type3<F, U, L, B>,
c: Type3<F, U, L, C>,
d: Type3<F, U, L, D>,
e: Type3<F, U, L, E>,
g: Type3<F, U, L, G>,
h: Type3<F, U, L, H>,
i: Type3<F, U, L, I>
): Type3<F, U, L, [A, B, C, D, E, G, H, I]>
}
```

# SequenceT3C (interface)

**Signature**

```ts
export interface SequenceT3C<F extends URIS3, U, L> {
<A>(a: Type3<F, U, L, A>): Type3<F, U, L, [A]>
<A, B>(a: Type3<F, U, L, A>, b: Type3<F, U, L, B>): Type3<F, U, L, [A, B]>
<A, B, C>(a: Type3<F, U, L, A>, b: Type3<F, U, L, B>, c: Type3<F, U, L, C>): Type3<F, U, L, [A, B, C]>
<A, B, C, D>(a: Type3<F, U, L, A>, b: Type3<F, U, L, B>, c: Type3<F, U, L, C>, d: Type3<F, U, L, D>): Type3<
F,
U,
L,
[A, B, C, D]
>
<A, B, C, D, E>(
a: Type3<F, U, L, A>,
b: Type3<F, U, L, B>,
c: Type3<F, U, L, C>,
d: Type3<F, U, L, D>,
e: Type3<F, U, L, E>
): Type3<F, U, L, [A, B, C, D, E]>
<A, B, C, D, E, G>(
a: Type3<F, U, L, A>,
b: Type3<F, U, L, B>,
c: Type3<F, U, L, C>,
d: Type3<F, U, L, D>,
e: Type3<F, U, L, E>,
g: Type3<F, U, L, G>
): Type3<F, U, L, [A, B, C, D, E, G]>
<A, B, C, D, E, G, H>(
a: Type3<F, U, L, A>,
b: Type3<F, U, L, B>,
c: Type3<F, U, L, C>,
d: Type3<F, U, L, D>,
e: Type3<F, U, L, E>,
g: Type3<F, U, L, G>,
h: Type3<F, U, L, H>
): Type3<F, U, L, [A, B, C, D, E, G, H]>
<A, B, C, D, E, G, H, I>(
a: Type3<F, U, L, A>,
b: Type3<F, U, L, B>,
c: Type3<F, U, L, C>,
d: Type3<F, U, L, D>,
e: Type3<F, U, L, E>,
g: Type3<F, U, L, G>,
h: Type3<F, U, L, H>,
i: Type3<F, U, L, I>
): Type3<F, U, L, [A, B, C, D, E, G, H, I]>
}
```

# applyFirst (function)

Combine two effectful actions, keeping only the result of the first
Expand Down Expand Up @@ -641,12 +365,36 @@ Tuple sequencing, i.e., take a tuple of monadic actions and do them from left-to
**Signature**

```ts
export function sequenceT<F extends URIS3, U, L>(F: Apply3<F>): SequenceT3<F>
export function sequenceT<F extends URIS3, U, L>(F: Apply3C<F, U, L>): SequenceT3C<F, U, L>
export function sequenceT<F extends URIS2>(F: Apply2<F>): SequenceT2<F>
export function sequenceT<F extends URIS2, L>(F: Apply2C<F, L>): SequenceT2C<F, L>
export function sequenceT<F extends URIS>(F: Apply1<F>): SequenceT1<F>
export function sequenceT<F>(F: Apply<F>): SequenceT<F> { ... }
export function sequenceT<F extends URIS3>(
F: Apply3<F>
): <U, L, T extends Array<Type3<F, U, L, any>>>(
...t: T & { 0: Type3<F, U, L, any> }
) => Type3<F, U, L, { [K in keyof T]: T[K] extends Type3<F, U, L, infer A> ? A : never }>
export function sequenceT<F extends URIS3, U, L>(
F: Apply3C<F, U, L>
): <T extends Array<Type3<F, U, L, any>>>(
...t: T & { 0: Type3<F, U, L, any> }
) => Type3<F, U, L, { [K in keyof T]: T[K] extends Type3<F, U, L, infer A> ? A : never }>
export function sequenceT<F extends URIS2>(
F: Apply2<F>
): <L, T extends Array<Type2<F, L, any>>>(
...t: T & { 0: Type2<F, L, any> }
) => Type2<F, L, { [K in keyof T]: T[K] extends Type2<F, L, infer A> ? A : never }>
export function sequenceT<F extends URIS2, L>(
F: Apply2C<F, L>
): <T extends Array<Type2<F, L, any>>>(
...t: T & { 0: Type2<F, L, any> }
) => Type2<F, L, { [K in keyof T]: T[K] extends Type2<F, L, infer A> ? A : never }>
export function sequenceT<F extends URIS>(
F: Apply1<F>
): <T extends Array<Type<F, any>>>(
...t: T & { 0: Type<F, any> }
) => Type<F, { [K in keyof T]: T[K] extends Type<F, infer A> ? A : never }>
export function sequenceT<F>(
F: Apply<F>
): <T extends Array<HKT<F, any>>>(
...t: T & { 0: HKT<F, any> }
) => HKT<F, { [K in keyof T]: T[K] extends HKT<F, infer A> ? A : never }> { ... }
```

**Example**
Expand Down
Loading

0 comments on commit 67c06a5

Please sign in to comment.