Skip to content

Commit

Permalink
Merge branch 'gcanti:master' into evolve
Browse files Browse the repository at this point in the history
  • Loading branch information
imcotton committed Aug 6, 2022
2 parents 8c41dca + bb9c6dd commit 29c5073
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 44 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,27 @@ name: Node.js CI

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]
node-version: [16.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run build --if-present
- run: npm test
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run build --if-present
- run: npm test
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
**Note**: A feature tagged as Experimental is in a
high state of flux, you're at risk of it changing without notice.

# 2.12.2

- **Polish**
- `ReadonlyRecord` / `Record`
- add `Applicative4` overloadings to `traverse` / `traverseWithIndex`, #1733 (@mlegenhausen)

# 2.12.1

- **Bug Fix**
Expand Down
10 changes: 10 additions & 0 deletions docs/modules/ReadonlyRecord.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -1888,6 +1888,11 @@ Added in v2.5.0
**Signature**

```ts
export declare function traverse<F extends URIS4>(
F: Applicative4<F>
): <S, R, E, A, B>(
f: (a: A) => Kind4<F, S, R, E, B>
) => <K extends string>(ta: ReadonlyRecord<K, A>) => Kind4<F, S, R, E, ReadonlyRecord<K, B>>
export declare function traverse<F extends URIS3>(
F: Applicative3<F>
): <R, E, A, B>(
Expand Down Expand Up @@ -1923,6 +1928,11 @@ Added in v2.5.0
**Signature**

```ts
export declare function traverseWithIndex<F extends URIS4>(
F: Applicative4<F>
): <K extends string, S, R, E, A, B>(
f: (k: K, a: A) => Kind4<F, S, R, E, B>
) => (ta: ReadonlyRecord<K, A>) => Kind4<F, S, R, E, ReadonlyRecord<K, B>>
export declare function traverseWithIndex<F extends URIS3>(
F: Applicative3<F>
): <K extends string, R, E, A, B>(
Expand Down
10 changes: 10 additions & 0 deletions docs/modules/Record.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -1783,6 +1783,11 @@ Added in v2.0.0
**Signature**

```ts
export declare function traverse<F extends URIS4>(
F: Applicative4<F>
): <S, R, E, A, B>(
f: (a: A) => Kind4<F, S, R, E, B>
) => <K extends string>(ta: Record<K, A>) => Kind4<F, S, R, E, Record<K, B>>
export declare function traverse<F extends URIS3>(
F: Applicative3<F>
): <R, E, A, B>(f: (a: A) => Kind3<F, R, E, B>) => <K extends string>(ta: Record<K, A>) => Kind3<F, R, E, Record<K, B>>
Expand Down Expand Up @@ -1810,6 +1815,11 @@ Added in v2.0.0
**Signature**

```ts
export declare function traverseWithIndex<F extends URIS4>(
F: Applicative4<F>
): <K extends string, S, R, E, A, B>(
f: (k: K, a: A) => Kind4<F, S, R, E, B>
) => (ta: Record<K, A>) => Kind4<F, S, R, E, Record<K, B>>
export declare function traverseWithIndex<F extends URIS3>(
F: Applicative3<F>
): <K extends string, R, E, A, B>(
Expand Down
25 changes: 1 addition & 24 deletions package-lock.json

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

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fp-ts",
"version": "2.12.1",
"version": "2.12.2",
"description": "Functional programming in TypeScript",
"main": "lib/index.js",
"module": "es6/index.js",
Expand Down Expand Up @@ -54,7 +54,6 @@
"ts-node": "^8.0.2",
"tslint": "5.11.0",
"tslint-config-standard": "8.0.1",
"tslint-immutable": "^6.0.1",
"typescript": "^4.2.3"
},
"tags": [
Expand Down
22 changes: 20 additions & 2 deletions src/ReadonlyRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@
*
* @since 2.5.0
*/
import { Applicative, Applicative1, Applicative2, Applicative2C, Applicative3, Applicative3C } from './Applicative'
import {
Applicative,
Applicative1,
Applicative2,
Applicative2C,
Applicative3,
Applicative3C,
Applicative4
} from './Applicative'
import { Compactable1 } from './Compactable'
import { Either } from './Either'
import { Eq, fromEquals } from './Eq'
Expand All @@ -17,7 +25,7 @@ import { FoldableWithIndex1 } from './FoldableWithIndex'
import { flow, identity, pipe, SK } from './function'
import { flap as flap_, Functor1 } from './Functor'
import { FunctorWithIndex1 } from './FunctorWithIndex'
import { HKT, Kind, Kind2, Kind3, URIS, URIS2, URIS3 } from './HKT'
import { HKT, Kind, Kind2, Kind3, Kind4, URIS, URIS2, URIS3, URIS4 } from './HKT'
import * as _ from './internal'
import { Magma } from './Magma'
import { Monoid } from './Monoid'
Expand Down Expand Up @@ -663,6 +671,11 @@ export const singleton = <A>(k: string, a: A): ReadonlyRecord<string, A> => ({ [
/**
* @since 2.5.0
*/
export function traverseWithIndex<F extends URIS4>(
F: Applicative4<F>
): <K extends string, S, R, E, A, B>(
f: (k: K, a: A) => Kind4<F, S, R, E, B>
) => (ta: ReadonlyRecord<K, A>) => Kind4<F, S, R, E, ReadonlyRecord<K, B>>
export function traverseWithIndex<F extends URIS3>(
F: Applicative3<F>
): <K extends string, R, E, A, B>(
Expand Down Expand Up @@ -701,6 +714,11 @@ export function traverseWithIndex<F>(
/**
* @since 2.5.0
*/
export function traverse<F extends URIS4>(
F: Applicative4<F>
): <S, R, E, A, B>(
f: (a: A) => Kind4<F, S, R, E, B>
) => <K extends string>(ta: ReadonlyRecord<K, A>) => Kind4<F, S, R, E, ReadonlyRecord<K, B>>
export function traverse<F extends URIS3>(
F: Applicative3<F>
): <R, E, A, B>(
Expand Down
22 changes: 20 additions & 2 deletions src/Record.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
*
* @since 2.0.0
*/
import { Applicative, Applicative1, Applicative2, Applicative2C, Applicative3, Applicative3C } from './Applicative'
import {
Applicative,
Applicative1,
Applicative2,
Applicative2C,
Applicative3,
Applicative3C,
Applicative4
} from './Applicative'
import * as A from './Array'
import { Compactable1 } from './Compactable'
import { Either } from './Either'
Expand All @@ -16,7 +24,7 @@ import { FoldableWithIndex1 } from './FoldableWithIndex'
import { pipe } from './function'
import { flap as flap_, Functor1 } from './Functor'
import { FunctorWithIndex1 } from './FunctorWithIndex'
import { HKT, Kind, Kind2, Kind3, URIS, URIS2, URIS3 } from './HKT'
import { HKT, Kind, Kind2, Kind3, Kind4, URIS, URIS2, URIS3, URIS4 } from './HKT'
import * as _ from './internal'
import { Magma } from './Magma'
import { Monoid } from './Monoid'
Expand Down Expand Up @@ -500,6 +508,11 @@ export const singleton: <A>(k: string, a: A) => Record<string, A> = RR.singleton
/**
* @since 2.0.0
*/
export function traverseWithIndex<F extends URIS4>(
F: Applicative4<F>
): <K extends string, S, R, E, A, B>(
f: (k: K, a: A) => Kind4<F, S, R, E, B>
) => (ta: Record<K, A>) => Kind4<F, S, R, E, Record<K, B>>
export function traverseWithIndex<F extends URIS3>(
F: Applicative3<F>
): <K extends string, R, E, A, B>(
Expand Down Expand Up @@ -531,6 +544,11 @@ export function traverseWithIndex<F>(
/**
* @since 2.0.0
*/
export function traverse<F extends URIS4>(
F: Applicative4<F>
): <S, R, E, A, B>(
f: (a: A) => Kind4<F, S, R, E, B>
) => <K extends string>(ta: Record<K, A>) => Kind4<F, S, R, E, Record<K, B>>
export function traverse<F extends URIS3>(
F: Applicative3<F>
): <R, E, A, B>(f: (a: A) => Kind3<F, R, E, B>) => <K extends string>(ta: Record<K, A>) => Kind3<F, R, E, Record<K, B>>
Expand Down
3 changes: 1 addition & 2 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["tslint-config-standard", "tslint-immutable"],
"extends": "tslint-config-standard",
"rules": {
"space-before-function-paren": false,
"no-use-before-declare": false,
Expand All @@ -10,7 +10,6 @@
"forin": true,
"no-console": true,
"array-type": [true, "generic"],
"readonly-keyword": true,
"strict-type-predicates": false
}
}

0 comments on commit 29c5073

Please sign in to comment.