Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add tapError #1858

Merged
merged 5 commits into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 44 additions & 26 deletions docs/modules/IOEither.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ Added in v2.0.0
- [getOrElseW](#getorelsew)
- [mapLeft](#mapleft)
- [orElse](#orelse)
- [orElseFirst](#orelsefirst)
- [orElseFirstIOK](#orelsefirstiok)
- [orElseFirstW](#orelsefirstw)
- [orElseW](#orelsew)
- [orLeft](#orleft)
- [tapError](#taperror)
- [filtering](#filtering)
- [filterOrElse](#filterorelse)
- [filterOrElseW](#filterorelsew)
Expand Down Expand Up @@ -80,6 +79,8 @@ Added in v2.0.0
- [chainFirst](#chainfirst)
- [chainFirstW](#chainfirstw)
- [chainW](#chainw)
- [orElseFirst](#orelsefirst)
- [orElseFirstW](#orelsefirstw)
- [lifting](#lifting)
- [fromEitherK](#fromeitherk)
- [fromIOK](#fromiok)
Expand Down Expand Up @@ -458,16 +459,6 @@ export declare const orElse: <E1, A, E2>(onLeft: (e: E1) => IOEither<E2, A>) =>

Added in v2.0.0

## orElseFirst

**Signature**

```ts
export declare const orElseFirst: <E, B>(onLeft: (e: E) => IOEither<E, B>) => <A>(ma: IOEither<E, A>) => IOEither<E, A>
```

Added in v2.11.0

## orElseFirstIOK

**Signature**
Expand All @@ -478,20 +469,6 @@ export declare const orElseFirstIOK: <E, B>(onLeft: (e: E) => I.IO<B>) => <A>(ma

Added in v2.12.0

## orElseFirstW

The `W` suffix (short for **W**idening) means that the error types will be merged.

**Signature**

```ts
export declare const orElseFirstW: <E1, E2, B>(
onLeft: (e: E1) => IOEither<E2, B>
) => <A>(ma: IOEither<E1, A>) => IOEither<E1 | E2, A>
```

Added in v2.11.0

## orElseW

Less strict version of [`orElse`](#orelse).
Expand All @@ -518,6 +495,21 @@ export declare const orLeft: <E1, E2>(onLeft: (e: E1) => I.IO<E2>) => <A>(fa: IO

Added in v2.11.0

## tapError

Returns an effect that effectfully "peeks" at the failure of this effect.

**Signature**

```ts
export declare const tapError: {
<E1, E2, _>(onLeft: (e: E1) => IOEither<E2, _>): <A>(self: IOEither<E1, A>) => IOEither<E1 | E2, A>
<E1, A, E2, _>(self: IOEither<E1, A>, onLeft: (e: E1) => IOEither<E2, _>): IOEither<E1 | E2, A>
}
```

Added in v2.15.0

# filtering

## filterOrElse
Expand Down Expand Up @@ -799,6 +791,32 @@ export declare const chainW: <E2, A, B>(

Added in v2.6.0

## orElseFirst

Alias of `tapError`.

**Signature**

```ts
export declare const orElseFirst: <E, B>(onLeft: (e: E) => IOEither<E, B>) => <A>(ma: IOEither<E, A>) => IOEither<E, A>
```

Added in v2.11.0

## orElseFirstW

Alias of `tapError`.

**Signature**

```ts
export declare const orElseFirstW: <E1, E2, B>(
onLeft: (e: E1) => IOEither<E2, B>
) => <A>(ma: IOEither<E1, A>) => IOEither<E1 | E2, A>
```

Added in v2.11.0

# lifting

## fromEitherK
Expand Down
80 changes: 52 additions & 28 deletions docs/modules/ReaderEither.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@ Added in v2.0.0
- [getOrElseW](#getorelsew)
- [mapLeft](#mapleft)
- [orElse](#orelse)
- [orElseFirst](#orelsefirst)
- [orElseFirstW](#orelsefirstw)
- [orElseW](#orelsew)
- [orLeft](#orleft)
- [tapError](#taperror)
- [filtering](#filtering)
- [filterOrElse](#filterorelse)
- [filterOrElseW](#filterorelsew)
Expand All @@ -72,6 +71,8 @@ Added in v2.0.0
- [chainFirst](#chainfirst)
- [chainFirstW](#chainfirstw)
- [chainW](#chainw)
- [orElseFirst](#orelsefirst)
- [orElseFirstW](#orelsefirstw)
- [lifting](#lifting)
- [fromEitherK](#fromeitherk)
- [fromOptionK](#fromoptionk)
Expand Down Expand Up @@ -519,32 +520,6 @@ export declare const orElse: <E1, R, E2, A>(

Added in v2.0.0

## orElseFirst

**Signature**

```ts
export declare const orElseFirst: <E, R, B>(
onLeft: (e: E) => ReaderEither<R, E, B>
) => <A>(ma: ReaderEither<R, E, A>) => ReaderEither<R, E, A>
```

Added in v2.11.0

## orElseFirstW

The `W` suffix (short for **W**idening) means that the environment types and the return types will be merged.

**Signature**

```ts
export declare const orElseFirstW: <E1, R2, E2, B>(
onLeft: (e: E1) => ReaderEither<R2, E2, B>
) => <R1, A>(ma: ReaderEither<R1, E1, A>) => ReaderEither<R1 & R2, E1 | E2, A>
```

Added in v2.11.0

## orElseW

Less strict version of [`orElse`](#orelse).
Expand Down Expand Up @@ -573,6 +548,27 @@ export declare const orLeft: <E1, R, E2>(

Added in v2.11.0

## tapError

Returns an effect that effectfully "peeks" at the failure of this effect.

**Signature**

```ts
export declare const tapError: {
<E1, R2, E2, _>(onLeft: (e: E1) => ReaderEither<R2, E2, _>): <R1, A>(
self: ReaderEither<R1, E1, A>
) => ReaderEither<R1 & R2, E1 | E2, A>
<R1, E1, A, R2, E2, _>(self: ReaderEither<R1, E1, A>, onLeft: (e: E1) => ReaderEither<R2, E2, _>): ReaderEither<
R1 & R2,
E1 | E2,
A
>
}
```

Added in v2.15.0

# filtering

## filterOrElse
Expand Down Expand Up @@ -807,6 +803,34 @@ export declare const chainW: <R2, E2, A, B>(

Added in v2.6.0

## orElseFirst

Alias of `tapError`.

**Signature**

```ts
export declare const orElseFirst: <E, R, B>(
onLeft: (e: E) => ReaderEither<R, E, B>
) => <A>(ma: ReaderEither<R, E, A>) => ReaderEither<R, E, A>
```

Added in v2.11.0

## orElseFirstW

Alias of `tapError`.

**Signature**

```ts
export declare const orElseFirstW: <E1, R2, E2, B>(
onLeft: (e: E1) => ReaderEither<R2, E2, B>
) => <R1, A>(ma: ReaderEither<R1, E1, A>) => ReaderEither<R1 & R2, E1 | E2, A>
```

Added in v2.11.0

# lifting

## fromEitherK
Expand Down
79 changes: 51 additions & 28 deletions docs/modules/ReaderTaskEither.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ Added in v2.0.0
- [getOrElseW](#getorelsew)
- [mapLeft](#mapleft)
- [orElse](#orelse)
- [orElseFirst](#orelsefirst)
- [orElseFirstW](#orelsefirstw)
- [orElseW](#orelsew)
- [orLeft](#orleft)
- [tapError](#taperror)
- [filtering](#filtering)
- [filterOrElse](#filterorelse)
- [filterOrElseW](#filterorelsew)
Expand Down Expand Up @@ -93,6 +92,8 @@ Added in v2.0.0
- [chainFirst](#chainfirst)
- [chainFirstW](#chainfirstw)
- [chainW](#chainw)
- [orElseFirst](#orelsefirst)
- [orElseFirstW](#orelsefirstw)
- [lifting](#lifting)
- [fromEitherK](#fromeitherk)
- [fromIOEitherK](#fromioeitherk)
Expand Down Expand Up @@ -727,32 +728,6 @@ export declare const orElse: <R, E1, A, E2>(

Added in v2.0.0

## orElseFirst

**Signature**

```ts
export declare const orElseFirst: <E, R, B>(
onLeft: (e: E) => ReaderTaskEither<R, E, B>
) => <A>(ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, A>
```

Added in v2.11.0

## orElseFirstW

The `W` suffix (short for **W**idening) means that the environment types and the return types will be merged.

**Signature**

```ts
export declare const orElseFirstW: <E1, R2, E2, B>(
onLeft: (e: E1) => ReaderTaskEither<R2, E2, B>
) => <R1, A>(ma: ReaderTaskEither<R1, E1, A>) => ReaderTaskEither<R1 & R2, E1 | E2, A>
```

Added in v2.11.0

## orElseW

Less strict version of [`orElse`](#orelse).
Expand Down Expand Up @@ -781,6 +756,26 @@ export declare const orLeft: <E1, R, E2>(

Added in v2.11.0

## tapError

Returns an effect that effectfully "peeks" at the failure of this effect.

**Signature**

```ts
export declare const tapError: {
<E1, R2, E2, _>(onLeft: (e: E1) => ReaderTaskEither<R2, E2, _>): <R1, A>(
self: ReaderTaskEither<R1, E1, A>
) => ReaderTaskEither<R1 & R2, E1 | E2, A>
<R1, E1, A, R2, E2, _>(
self: ReaderTaskEither<R1, E1, A>,
onLeft: (e: E1) => ReaderTaskEither<R2, E2, _>
): ReaderTaskEither<R1 & R2, E1 | E2, A>
}
```

Added in v2.15.0

# filtering

## filterOrElse
Expand Down Expand Up @@ -1097,6 +1092,34 @@ export declare const chainW: <R2, E2, A, B>(

Added in v2.6.0

## orElseFirst

Alias of `tapError`.

**Signature**

```ts
export declare const orElseFirst: <E, R, B>(
onLeft: (e: E) => ReaderTaskEither<R, E, B>
) => <A>(ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, A>
```

Added in v2.11.0

## orElseFirstW

Alias of `tapError`.

**Signature**

```ts
export declare const orElseFirstW: <E1, R2, E2, B>(
onLeft: (e: E1) => ReaderTaskEither<R2, E2, B>
) => <R1, A>(ma: ReaderTaskEither<R1, E1, A>) => ReaderTaskEither<R1 & R2, E1 | E2, A>
```

Added in v2.11.0

# lifting

## fromEitherK
Expand Down
Loading