Skip to content

Commit

Permalink
Fix __PURE__ annotation placement, closes #1926
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti committed Mar 18, 2024
1 parent dbd420c commit 7e70370
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Expand Up @@ -3,7 +3,7 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.validate": ["typescript"],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"files.insertFinalNewline": true
}
6 changes: 6 additions & 0 deletions CHANGELOG.md
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.16.4

**Polish**

Fix `__PURE__` annotation placement, closes #1926

# 2.16.3

**Polish**
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "fp-ts",
"version": "2.16.3",
"version": "2.16.4",
"description": "Functional programming in TypeScript",
"main": "./lib/index.js",
"module": "./es6/index.js",
Expand Down
3 changes: 1 addition & 2 deletions src/IOEither.ts
Expand Up @@ -840,8 +840,7 @@ export const chainOptionK: <E>(
*/
export const chainOptionKW: <E2>(
onNone: LazyArg<E2>
) => <A, B>(f: (a: A) => Option<B>) => <E1>(ma: IOEither<E1, A>) => IOEither<E1 | E2, B> =
/*#__PURE__*/ chainOptionK as any
) => <A, B>(f: (a: A) => Option<B>) => <E1>(ma: IOEither<E1, A>) => IOEither<E1 | E2, B> = chainOptionK as any

/** @internal */
interface IOEitherTypeLambda extends _.TypeLambda {
Expand Down
2 changes: 1 addition & 1 deletion src/ReaderEither.ts
Expand Up @@ -861,7 +861,7 @@ export const chainOptionK: <E>(
export const chainOptionKW: <E2>(
onNone: LazyArg<E2>
) => <A, B>(f: (a: A) => Option<B>) => <R, E1>(ma: ReaderEither<R, E1, A>) => ReaderEither<R, E1 | E2, B> =
/*#__PURE__*/ chainOptionK as any
chainOptionK as any

/** @internal */
interface ReaderEitherTypeLambda extends _.TypeLambda {
Expand Down
2 changes: 1 addition & 1 deletion src/ReaderIO.ts
Expand Up @@ -48,7 +48,7 @@ export const fromReader: <R, A>(fa: Reader<R, A>) => ReaderIO<R, A> = /*#__PURE_
* @category conversions
* @since 2.13.0
*/
export const fromIO: <A, R = unknown>(fa: IO<A>) => ReaderIO<R, A> = /*#__PURE__*/ R.of
export const fromIO: <A, R = unknown>(fa: IO<A>) => ReaderIO<R, A> = R.of

// -------------------------------------------------------------------------------------
// combinators
Expand Down
2 changes: 1 addition & 1 deletion src/ReaderTask.ts
Expand Up @@ -64,7 +64,7 @@ export const fromReader: <R, A>(fa: R.Reader<R, A>) => ReaderTask<R, A> = /*#__P
* @category conversions
* @since 2.3.0
*/
export const fromTask: <A, R = unknown>(fa: Task<A>) => ReaderTask<R, A> = /*#__PURE__*/ R.of
export const fromTask: <A, R = unknown>(fa: Task<A>) => ReaderTask<R, A> = R.of

/**
* @category conversions
Expand Down
12 changes: 5 additions & 7 deletions src/ReaderTaskEither.ts
Expand Up @@ -175,17 +175,15 @@ export const leftIO: <R, E = never, A = never>(me: IO<E>) => ReaderTaskEither<R,
* @category constructors
* @since 2.13.0
*/
export const rightReaderIO: <R, E = never, A = never>(ma: ReaderIO<R, A>) => ReaderTaskEither<R, E, A> = /*#__PURE__*/ (
ma
) => flow(ma, TE.rightIO)
export const rightReaderIO: <R, E = never, A = never>(ma: ReaderIO<R, A>) => ReaderTaskEither<R, E, A> = (ma) =>
flow(ma, TE.rightIO)

/**
* @category constructors
* @since 2.13.0
*/
export const leftReaderIO: <R, E = never, A = never>(me: ReaderIO<R, E>) => ReaderTaskEither<R, E, A> = /*#__PURE__*/ (
me
) => flow(me, TE.leftIO)
export const leftReaderIO: <R, E = never, A = never>(me: ReaderIO<R, E>) => ReaderTaskEither<R, E, A> = (me) =>
flow(me, TE.leftIO)

// -------------------------------------------------------------------------------------
// conversions
Expand Down Expand Up @@ -1381,7 +1379,7 @@ export const chainOptionK: <E>(
export const chainOptionKW: <E2>(
onNone: LazyArg<E2>
) => <A, B>(f: (a: A) => Option<B>) => <R, E1>(ma: ReaderTaskEither<R, E1, A>) => ReaderTaskEither<R, E1 | E2, B> =
/*#__PURE__*/ chainOptionK as any
chainOptionK as any

/** @internal */
interface ReaderTaskEitherTypeLambda extends _.TypeLambda {
Expand Down
3 changes: 1 addition & 2 deletions src/StateReaderTaskEither.ts
Expand Up @@ -1149,8 +1149,7 @@ export const chainOptionKW: <E2>(
onNone: LazyArg<E2>
) => <A, B>(
f: (a: A) => Option<B>
) => <S, R, E1>(ma: StateReaderTaskEither<S, R, E1, A>) => StateReaderTaskEither<S, R, E1 | E2, B> =
/*#__PURE__*/ chainOptionK as any
) => <S, R, E1>(ma: StateReaderTaskEither<S, R, E1, A>) => StateReaderTaskEither<S, R, E1 | E2, B> = chainOptionK as any

/**
* Alias of `flatMapEither`.
Expand Down
3 changes: 1 addition & 2 deletions src/TaskEither.ts
Expand Up @@ -1149,8 +1149,7 @@ export const chainOptionK: <E>(
*/
export const chainOptionKW: <E2>(
onNone: LazyArg<E2>
) => <A, B>(f: (a: A) => Option<B>) => <E1>(ma: TaskEither<E1, A>) => TaskEither<E1 | E2, B> =
/*#__PURE__*/ chainOptionK as any
) => <A, B>(f: (a: A) => Option<B>) => <E1>(ma: TaskEither<E1, A>) => TaskEither<E1 | E2, B> = chainOptionK as any

/** @internal */
interface TaskEitherTypeLambda extends _.TypeLambda {
Expand Down
2 changes: 1 addition & 1 deletion src/TaskThese.ts
Expand Up @@ -114,7 +114,7 @@ export const fromIO: <A, E = never>(fa: IO<A>) => TaskThese<E, A> = rightIO
* @category conversions
* @since 2.4.0
*/
export const fromIOEither: <E, A>(fa: IOEither<E, A>) => TaskThese<E, A> = /*#__PURE__*/ T.fromIO
export const fromIOEither: <E, A>(fa: IOEither<E, A>) => TaskThese<E, A> = T.fromIO

/**
* @category conversions
Expand Down

0 comments on commit 7e70370

Please sign in to comment.