Skip to content

Commit

Permalink
type parameter renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti committed Jun 17, 2019
1 parent ccb8684 commit a32e09e
Show file tree
Hide file tree
Showing 109 changed files with 2,793 additions and 2,850 deletions.
10 changes: 5 additions & 5 deletions docs/modules/Alt.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Added in v2.0.0

```ts
export interface Alt2<F extends URIS2> extends Functor2<F> {
readonly alt: <L, A>(fx: Kind2<F, L, A>, fy: () => Kind2<F, L, A>) => Kind2<F, L, A>
readonly alt: <E, A>(fx: Kind2<F, E, A>, fy: () => Kind2<F, E, A>) => Kind2<F, E, A>
}
```

Expand All @@ -69,8 +69,8 @@ Added in v2.0.0
**Signature**

```ts
export interface Alt2C<F extends URIS2, L> extends Functor2C<F, L> {
readonly alt: <A>(fx: Kind2<F, L, A>, fy: () => Kind2<F, L, A>) => Kind2<F, L, A>
export interface Alt2C<F extends URIS2, E> extends Functor2C<F, E> {
readonly alt: <A>(fx: Kind2<F, E, A>, fy: () => Kind2<F, E, A>) => Kind2<F, E, A>
}
```

Expand All @@ -82,7 +82,7 @@ Added in v2.0.0

```ts
export interface Alt3<F extends URIS3> extends Functor3<F> {
readonly alt: <U, L, A>(fx: Kind3<F, U, L, A>, fy: () => Kind3<F, U, L, A>) => Kind3<F, U, L, A>
readonly alt: <R, E, A>(fx: Kind3<F, R, E, A>, fy: () => Kind3<F, R, E, A>) => Kind3<F, R, E, A>
}
```

Expand All @@ -94,7 +94,7 @@ Added in v2.0.0

```ts
export interface Alt4<F extends URIS4> extends Functor4<F> {
readonly alt: <X, U, L, A>(fx: Kind4<F, X, U, L, A>, fy: () => Kind4<F, X, U, L, A>) => Kind4<F, X, U, L, A>
readonly alt: <S, R, E, A>(fx: Kind4<F, S, R, E, A>, fy: () => Kind4<F, S, R, E, A>) => Kind4<F, S, R, E, A>
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/Alternative.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Added in v2.0.0
**Signature**

```ts
export interface Alternative2C<F extends URIS2, L> extends Applicative2C<F, L>, Plus2C<F, L> {}
export interface Alternative2C<F extends URIS2, E> extends Applicative2C<F, E>, Plus2C<F, E> {}
```

Added in v2.0.0
Expand Down
110 changes: 49 additions & 61 deletions docs/modules/Applicative.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Added in v2.0.0

```ts
export interface Applicative2<F extends URIS2> extends Apply2<F> {
readonly of: <L, A>(a: A) => Kind2<F, L, A>
readonly of: <E, A>(a: A) => Kind2<F, E, A>
}
```

Expand All @@ -88,8 +88,8 @@ Added in v2.0.0
**Signature**

```ts
export interface Applicative2C<F extends URIS2, L> extends Apply2C<F, L> {
readonly of: <A>(a: A) => Kind2<F, L, A>
export interface Applicative2C<F extends URIS2, E> extends Apply2C<F, E> {
readonly of: <A>(a: A) => Kind2<F, E, A>
}
```

Expand All @@ -101,7 +101,7 @@ Added in v2.0.0

```ts
export interface Applicative3<F extends URIS3> extends Apply3<F> {
readonly of: <U, L, A>(a: A) => Kind3<F, U, L, A>
readonly of: <R, E, A>(a: A) => Kind3<F, R, E, A>
}
```

Expand All @@ -113,7 +113,7 @@ Added in v2.0.0

```ts
export interface Applicative4<F extends URIS4> extends Apply4<F> {
readonly of: <X, U, L, A>(a: A) => Kind4<F, X, U, L, A>
readonly of: <S, R, E, A>(a: A) => Kind4<F, S, R, E, A>
}
```

Expand Down Expand Up @@ -151,11 +151,11 @@ Added in v2.0.0

```ts
export interface ApplicativeComposition12<F extends URIS, G extends URIS2> extends FunctorComposition12<F, G> {
readonly of: <LG, A>(a: A) => Kind<F, Kind2<G, LG, A>>
readonly ap: <LG, A, B>(
fgab: Kind<F, Kind2<G, LG, (a: A) => B>>,
fga: Kind<F, Kind2<G, LG, A>>
) => Kind<F, Kind2<G, LG, B>>
readonly of: <E, A>(a: A) => Kind<F, Kind2<G, E, A>>
readonly ap: <E, A, B>(
fgab: Kind<F, Kind2<G, E, (a: A) => B>>,
fga: Kind<F, Kind2<G, E, A>>
) => Kind<F, Kind2<G, E, B>>
}
```

Expand All @@ -166,13 +166,9 @@ Added in v2.0.0
**Signature**

```ts
export interface ApplicativeComposition12C<F extends URIS, G extends URIS2, LG>
extends FunctorComposition12C<F, G, LG> {
readonly of: <A>(a: A) => Kind<F, Kind2<G, LG, A>>
readonly ap: <A, B>(
fgab: Kind<F, Kind2<G, LG, (a: A) => B>>,
fga: Kind<F, Kind2<G, LG, A>>
) => Kind<F, Kind2<G, LG, B>>
export interface ApplicativeComposition12C<F extends URIS, G extends URIS2, E> extends FunctorComposition12C<F, G, E> {
readonly of: <A>(a: A) => Kind<F, Kind2<G, E, A>>
readonly ap: <A, B>(fgab: Kind<F, Kind2<G, E, (a: A) => B>>, fga: Kind<F, Kind2<G, E, A>>) => Kind<F, Kind2<G, E, B>>
}
```

Expand All @@ -184,11 +180,11 @@ Added in v2.0.0

```ts
export interface ApplicativeComposition21<F extends URIS2, G extends URIS> extends FunctorComposition21<F, G> {
readonly of: <LF, A>(a: A) => Kind2<F, LF, Kind<G, A>>
readonly ap: <LF, A, B>(
fgab: Kind2<F, LF, Kind<G, (a: A) => B>>,
fga: Kind2<F, LF, Kind<G, A>>
) => Kind2<F, LF, Kind<G, B>>
readonly of: <E, A>(a: A) => Kind2<F, E, Kind<G, A>>
readonly ap: <E, A, B>(
fgab: Kind2<F, E, Kind<G, (a: A) => B>>,
fga: Kind2<F, E, Kind<G, A>>
) => Kind2<F, E, Kind<G, B>>
}
```

Expand All @@ -200,11 +196,11 @@ Added in v2.0.0

```ts
export interface ApplicativeComposition22<F extends URIS2, G extends URIS2> extends FunctorComposition22<F, G> {
readonly of: <LF, LG, A>(a: A) => Kind2<F, LF, Kind2<G, LG, A>>
readonly ap: <L, M, A, B>(
fgab: Kind2<F, L, Kind2<G, M, (a: A) => B>>,
fga: Kind2<F, L, Kind2<G, M, A>>
) => Kind2<F, L, Kind2<G, M, B>>
readonly of: <FE, GE, A>(a: A) => Kind2<F, FE, Kind2<G, GE, A>>
readonly ap: <FE, GE, A, B>(
fgab: Kind2<F, FE, Kind2<G, GE, (a: A) => B>>,
fga: Kind2<F, FE, Kind2<G, GE, A>>
) => Kind2<F, FE, Kind2<G, GE, B>>
}
```

Expand All @@ -215,13 +211,12 @@ Added in v2.0.0
**Signature**

```ts
export interface ApplicativeComposition22C<F extends URIS2, G extends URIS2, LG>
extends FunctorComposition22C<F, G, LG> {
readonly of: <LF, A>(a: A) => Kind2<F, LF, Kind2<G, LG, A>>
readonly ap: <LF, A, B>(
fgab: Kind2<F, LF, Kind2<G, LG, (a: A) => B>>,
fga: Kind2<F, LF, Kind2<G, LG, A>>
) => Kind2<F, LF, Kind2<G, LG, B>>
export interface ApplicativeComposition22C<F extends URIS2, G extends URIS2, E> extends FunctorComposition22C<F, G, E> {
readonly of: <FE, A>(a: A) => Kind2<F, FE, Kind2<G, E, A>>
readonly ap: <FE, A, B>(
fgab: Kind2<F, FE, Kind2<G, E, (a: A) => B>>,
fga: Kind2<F, FE, Kind2<G, E, A>>
) => Kind2<F, FE, Kind2<G, E, B>>
}
```

Expand All @@ -232,13 +227,9 @@ Added in v2.0.0
**Signature**

```ts
export interface ApplicativeComposition2C1<F extends URIS2, G extends URIS, LF>
extends FunctorComposition2C1<F, G, LF> {
readonly of: <A>(a: A) => Kind2<F, LF, Kind<G, A>>
readonly ap: <A, B>(
fgab: Kind2<F, LF, Kind<G, (a: A) => B>>,
fga: Kind2<F, LF, Kind<G, A>>
) => Kind2<F, LF, Kind<G, B>>
export interface ApplicativeComposition2C1<F extends URIS2, G extends URIS, E> extends FunctorComposition2C1<F, G, E> {
readonly of: <A>(a: A) => Kind2<F, E, Kind<G, A>>
readonly ap: <A, B>(fgab: Kind2<F, E, Kind<G, (a: A) => B>>, fga: Kind2<F, E, Kind<G, A>>) => Kind2<F, E, Kind<G, B>>
}
```

Expand All @@ -263,11 +254,8 @@ Added in v2.0.0

```ts
export interface ApplicativeCompositionHKT2<F, G extends URIS2> extends FunctorCompositionHKT2<F, G> {
readonly of: <LG, A>(a: A) => HKT<F, Kind2<G, LG, A>>
readonly ap: <LG, A, B>(
fgab: HKT<F, Kind2<G, LG, (a: A) => B>>,
fga: HKT<F, Kind2<G, LG, A>>
) => HKT<F, Kind2<G, LG, B>>
readonly of: <E, A>(a: A) => HKT<F, Kind2<G, E, A>>
readonly ap: <E, A, B>(fgab: HKT<F, Kind2<G, E, (a: A) => B>>, fga: HKT<F, Kind2<G, E, A>>) => HKT<F, Kind2<G, E, B>>
}
```

Expand All @@ -278,9 +266,9 @@ Added in v2.0.0
**Signature**

```ts
export interface ApplicativeCompositionHKT2C<F, G extends URIS2, LG> extends FunctorCompositionHKT2C<F, G, LG> {
readonly of: <A>(a: A) => HKT<F, Kind2<G, LG, A>>
readonly ap: <A, B>(fgab: HKT<F, Kind2<G, LG, (a: A) => B>>, fga: HKT<F, Kind2<G, LG, A>>) => HKT<F, Kind2<G, LG, B>>
export interface ApplicativeCompositionHKT2C<F, G extends URIS2, E> extends FunctorCompositionHKT2C<F, G, E> {
readonly of: <A>(a: A) => HKT<F, Kind2<G, E, A>>
readonly ap: <A, B>(fgab: HKT<F, Kind2<G, E, (a: A) => B>>, fga: HKT<F, Kind2<G, E, A>>) => HKT<F, Kind2<G, E, B>>
}
```

Expand All @@ -293,18 +281,18 @@ Like `Functor`, `Applicative`s compose. If `F` and `G` have `Applicative` instan
**Signature**

```ts
export function getApplicativeComposition<F extends URIS2, G extends URIS2, LG>(
export function getApplicativeComposition<F extends URIS2, G extends URIS2, E>(
F: Applicative2<F>,
G: Applicative2C<G, LG>
): ApplicativeComposition22C<F, G, LG>
G: Applicative2C<G, E>
): ApplicativeComposition22C<F, G, E>
export function getApplicativeComposition<F extends URIS2, G extends URIS2>(
F: Applicative2<F>,
G: Applicative2<G>
): ApplicativeComposition22<F, G>
export function getApplicativeComposition<F extends URIS2, G extends URIS2, LG>(
export function getApplicativeComposition<F extends URIS2, G extends URIS2, E>(
F: Applicative2<F>,
G: Applicative2C<G, LG>
): ApplicativeComposition22C<F, G, LG>
G: Applicative2C<G, E>
): ApplicativeComposition22C<F, G, E>
export function getApplicativeComposition<F extends URIS2, G extends URIS>(
F: Applicative2<F>,
G: Applicative1<G>
Expand All @@ -313,10 +301,10 @@ export function getApplicativeComposition<F extends URIS, G extends URIS2>(
F: Applicative1<F>,
G: Applicative2<G>
): ApplicativeComposition12<F, G>
export function getApplicativeComposition<F extends URIS, G extends URIS2, LG>(
export function getApplicativeComposition<F extends URIS, G extends URIS2, E>(
F: Applicative1<F>,
G: Applicative2C<G, LG>
): ApplicativeComposition12C<F, G, LG>
G: Applicative2C<G, E>
): ApplicativeComposition12C<F, G, E>
export function getApplicativeComposition<F extends URIS, G extends URIS>(
F: Applicative1<F>,
G: Applicative1<G>
Expand All @@ -325,10 +313,10 @@ export function getApplicativeComposition<F, G extends URIS2>(
F: Applicative<F>,
G: Applicative2<G>
): ApplicativeCompositionHKT2<F, G>
export function getApplicativeComposition<F, G extends URIS2, LG>(
export function getApplicativeComposition<F, G extends URIS2, E>(
F: Applicative<F>,
G: Applicative2C<G, LG>
): ApplicativeCompositionHKT2C<F, G, LG>
G: Applicative2C<G, E>
): ApplicativeCompositionHKT2C<F, G, E>
export function getApplicativeComposition<F, G extends URIS>(
F: Applicative<F>,
G: Applicative1<G>
Expand Down
66 changes: 33 additions & 33 deletions docs/modules/Apply.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Added in v2.0.0

```ts
export interface Apply2<F extends URIS2> extends Functor2<F> {
readonly ap: <L, A, B>(fab: Kind2<F, L, (a: A) => B>, fa: Kind2<F, L, A>) => Kind2<F, L, B>
readonly ap: <E, A, B>(fab: Kind2<F, E, (a: A) => B>, fa: Kind2<F, E, A>) => Kind2<F, E, B>
}
```

Expand All @@ -73,8 +73,8 @@ Added in v2.0.0
**Signature**

```ts
export interface Apply2C<F extends URIS2, L> extends Functor2C<F, L> {
readonly ap: <A, B>(fab: Kind2<F, L, (a: A) => B>, fa: Kind2<F, L, A>) => Kind2<F, L, B>
export interface Apply2C<F extends URIS2, E> extends Functor2C<F, E> {
readonly ap: <A, B>(fab: Kind2<F, E, (a: A) => B>, fa: Kind2<F, E, A>) => Kind2<F, E, B>
}
```

Expand All @@ -86,7 +86,7 @@ Added in v2.0.0

```ts
export interface Apply3<F extends URIS3> extends Functor3<F> {
readonly ap: <U, L, A, B>(fab: Kind3<F, U, L, (a: A) => B>, fa: Kind3<F, U, L, A>) => Kind3<F, U, L, B>
readonly ap: <R, E, A, B>(fab: Kind3<F, R, E, (a: A) => B>, fa: Kind3<F, R, E, A>) => Kind3<F, R, E, B>
}
```

Expand All @@ -98,7 +98,7 @@ Added in v2.0.0

```ts
export interface Apply4<F extends URIS4> extends Functor4<F> {
readonly ap: <X, U, L, A, B>(fab: Kind4<F, X, U, L, (a: A) => B>, fa: Kind4<F, X, U, L, A>) => Kind4<F, X, U, L, B>
readonly ap: <S, R, E, A, B>(fab: Kind4<F, S, R, E, (a: A) => B>, fa: Kind4<F, S, R, E, A>) => Kind4<F, S, R, E, B>
}
```

Expand All @@ -113,29 +113,29 @@ Like `Apply.sequenceT` but works with structs instead of tuples.
```ts
export function sequenceS<F extends URIS3>(
F: Apply3<F>
): <U, L, R extends Record<string, Kind3<F, U, L, any>>>(
r: EnforceNonEmptyRecord<R> & Record<string, Kind3<F, U, L, any>>
) => Kind3<F, U, L, { [K in keyof R]: [R[K]] extends [Kind3<F, any, any, infer A>] ? A : never }>
): <R, E, NER extends Record<string, Kind3<F, R, E, any>>>(
r: EnforceNonEmptyRecord<NER> & Record<string, Kind3<F, R, E, any>>
) => Kind3<F, R, E, { [K in keyof NER]: [NER[K]] extends [Kind3<F, any, any, infer A>] ? A : never }>
export function sequenceS<F extends URIS2>(
F: Apply2<F>
): <L, R extends Record<string, Kind2<F, L, any>>>(
r: EnforceNonEmptyRecord<R> & Record<string, Kind2<F, L, any>>
) => Kind2<F, L, { [K in keyof R]: [R[K]] extends [Kind2<F, any, infer A>] ? A : never }>
export function sequenceS<F extends URIS2, L>(
F: Apply2C<F, L>
): <R extends Record<string, Kind2<F, L, any>>>(
r: EnforceNonEmptyRecord<R>
) => Kind2<F, L, { [K in keyof R]: [R[K]] extends [Kind2<F, any, infer A>] ? A : never }>
): <E, NER extends Record<string, Kind2<F, E, any>>>(
r: EnforceNonEmptyRecord<NER> & Record<string, Kind2<F, E, any>>
) => Kind2<F, E, { [K in keyof NER]: [NER[K]] extends [Kind2<F, any, infer A>] ? A : never }>
export function sequenceS<F extends URIS2, E>(
F: Apply2C<F, E>
): <NER extends Record<string, Kind2<F, E, any>>>(
r: EnforceNonEmptyRecord<NER>
) => Kind2<F, E, { [K in keyof NER]: [NER[K]] extends [Kind2<F, any, infer A>] ? A : never }>
export function sequenceS<F extends URIS>(
F: Apply1<F>
): <R extends Record<string, Kind<F, any>>>(
r: EnforceNonEmptyRecord<R>
) => Kind<F, { [K in keyof R]: [R[K]] extends [Kind<F, infer A>] ? A : never }>
): <NER extends Record<string, Kind<F, any>>>(
r: EnforceNonEmptyRecord<NER>
) => Kind<F, { [K in keyof NER]: [NER[K]] extends [Kind<F, infer A>] ? A : never }>
export function sequenceS<F>(
F: Apply<F>
): <R extends Record<string, HKT<F, any>>>(
r: EnforceNonEmptyRecord<R>
) => HKT<F, { [K in keyof R]: [R[K]] extends [HKT<F, infer A>] ? A : never }> { ... }
): <NER extends Record<string, HKT<F, any>>>(
r: EnforceNonEmptyRecord<NER>
) => HKT<F, { [K in keyof NER]: [NER[K]] extends [HKT<F, infer A>] ? A : never }> { ... }
```

**Example**
Expand Down Expand Up @@ -173,19 +173,19 @@ Tuple sequencing, i.e., take a tuple of monadic actions and does them from left-
```ts
export function sequenceT<F extends URIS3>(
F: Apply3<F>
): <U, L, T extends Array<Kind3<F, U, L, any>>>(
...t: T & { 0: Kind3<F, U, L, any> }
) => Kind3<F, U, L, { [K in keyof T]: [T[K]] extends [Kind3<F, U, L, infer A>] ? A : never }>
): <R, E, T extends Array<Kind3<F, R, E, any>>>(
...t: T & { 0: Kind3<F, R, E, any> }
) => Kind3<F, R, E, { [K in keyof T]: [T[K]] extends [Kind3<F, R, E, infer A>] ? A : never }>
export function sequenceT<F extends URIS2>(
F: Apply2<F>
): <L, T extends Array<Kind2<F, L, any>>>(
...t: T & { 0: Kind2<F, L, any> }
) => Kind2<F, L, { [K in keyof T]: [T[K]] extends [Kind2<F, L, infer A>] ? A : never }>
export function sequenceT<F extends URIS2, L>(
F: Apply2C<F, L>
): <T extends Array<Kind2<F, L, any>>>(
...t: T & { 0: Kind2<F, L, any> }
) => Kind2<F, L, { [K in keyof T]: [T[K]] extends [Kind2<F, L, infer A>] ? A : never }>
): <E, T extends Array<Kind2<F, E, any>>>(
...t: T & { 0: Kind2<F, E, any> }
) => Kind2<F, E, { [K in keyof T]: [T[K]] extends [Kind2<F, E, infer A>] ? A : never }>
export function sequenceT<F extends URIS2, E>(
F: Apply2C<F, E>
): <T extends Array<Kind2<F, E, any>>>(
...t: T & { 0: Kind2<F, E, any> }
) => Kind2<F, E, { [K in keyof T]: [T[K]] extends [Kind2<F, E, infer A>] ? A : never }>
export function sequenceT<F extends URIS>(
F: Apply1<F>
): <T extends Array<Kind<F, any>>>(
Expand Down
Loading

0 comments on commit a32e09e

Please sign in to comment.