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 remaining flatMaps #1880

Merged
merged 9 commits into from
May 24, 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
94 changes: 71 additions & 23 deletions docs/modules/IOOption.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,13 @@ Added in v2.12.0
- [Zero](#zero)
- [legacy](#legacy)
- [chain](#chain)
- [chainEitherK](#chaineitherk)
- [chainFirst](#chainfirst)
- [chainFirstEitherK](#chainfirsteitherk)
- [chainFirstIOK](#chainfirstiok)
- [chainIOK](#chainiok)
- [chainNullableK](#chainnullablek)
- [chainOptionK](#chainoptionk)
- [lifting](#lifting)
- [fromEitherK](#fromeitherk)
- [fromIOK](#fromiok)
Expand All @@ -93,11 +96,11 @@ Added in v2.12.0
- [matchEW](#matchew)
- [matchW](#matchw)
- [sequencing](#sequencing)
- [chainEitherK](#chaineitherk)
- [chainNullableK](#chainnullablek)
- [chainOptionK](#chainoptionk)
- [flatMap](#flatmap)
- [flatMapEither](#flatmapeither)
- [flatMapIO](#flatmapio)
- [flatMapNullable](#flatmapnullable)
- [flatMapOption](#flatmapoption)
- [flatten](#flatten)
- [traversing](#traversing)
- [traverseReadonlyArrayWithIndex](#traversereadonlyarraywithindex)
Expand Down Expand Up @@ -663,6 +666,18 @@ export declare const chain: <A, B>(f: (a: A) => IOOption<B>) => (ma: IOOption<A>

Added in v2.12.0

## chainEitherK

Alias of `flatMapEither`.

**Signature**

```ts
export declare const chainEitherK: <E, A, B>(f: (a: A) => Either<E, B>) => (ma: IOOption<A>) => IOOption<B>
```

Added in v2.12.0

## chainFirst

Alias of `tap`.
Expand Down Expand Up @@ -711,6 +726,32 @@ export declare const chainIOK: <A, B>(f: (a: A) => I.IO<B>) => (first: IOOption<

Added in v2.12.0

## chainNullableK

Alias of `flatMapNullable`.

**Signature**

```ts
export declare const chainNullableK: <A, B>(
f: (a: A) => B | null | undefined
) => (ma: IOOption<A>) => IOOption<NonNullable<B>>
```

Added in v2.12.0

## chainOptionK

Alias of `flatMapOption`.

**Signature**

```ts
export declare const chainOptionK: <A, B>(f: (a: A) => O.Option<B>) => (ma: IOOption<A>) => IOOption<B>
```

Added in v2.12.0

# lifting

## fromEitherK
Expand Down Expand Up @@ -906,59 +947,66 @@ Added in v2.12.0

# sequencing

## chainEitherK
## flatMap

**Signature**

```ts
export declare const chainEitherK: <E, A, B>(f: (a: A) => Either<E, B>) => (ma: IOOption<A>) => IOOption<B>
export declare const flatMap: {
<A, B>(f: (a: A) => IOOption<B>): (ma: IOOption<A>) => IOOption<B>
<A, B>(ma: IOOption<A>, f: (a: A) => IOOption<B>): IOOption<B>
}
```

Added in v2.12.0
Added in v2.14.0

## chainNullableK
## flatMapEither

**Signature**

```ts
export declare const chainNullableK: <A, B>(
f: (a: A) => B | null | undefined
) => (ma: IOOption<A>) => IOOption<NonNullable<B>>
export declare const flatMapEither: {
<A, B, _>(f: (a: A) => Either<_, B>): (self: IOOption<A>) => IOOption<B>
<A, B, _>(self: IOOption<A>, f: (a: A) => Either<_, B>): IOOption<B>
}
```

Added in v2.12.0
Added in v2.16.0

## chainOptionK
## flatMapIO

**Signature**

```ts
export declare const chainOptionK: <A, B>(f: (a: A) => O.Option<B>) => (ma: IOOption<A>) => IOOption<B>
export declare const flatMapIO: {
<A, B>(f: (a: A) => I.IO<B>): (self: IOOption<A>) => IOOption<B>
<A, B>(self: IOOption<A>, f: (a: A) => I.IO<B>): IOOption<B>
}
```

Added in v2.12.0
Added in v2.16.0

## flatMap
## flatMapNullable

**Signature**

```ts
export declare const flatMap: {
<A, B>(f: (a: A) => IOOption<B>): (ma: IOOption<A>) => IOOption<B>
<A, B>(ma: IOOption<A>, f: (a: A) => IOOption<B>): IOOption<B>
export declare const flatMapNullable: {
<A, B>(f: (a: A) => B | null | undefined): (self: IOOption<A>) => IOOption<B>
<A, B>(self: IOOption<A>, f: (a: A) => B | null | undefined): IOOption<B>
}
```

Added in v2.14.0
Added in v2.16.0

## flatMapIO
## flatMapOption

**Signature**

```ts
export declare const flatMapIO: {
<A, B>(f: (a: A) => I.IO<B>): (self: IOOption<A>) => IOOption<B>
<A, B>(self: IOOption<A>, f: (a: A) => I.IO<B>): IOOption<B>
export declare const flatMapOption: {
<A, B>(f: (a: A) => O.Option<B>): (self: IOOption<A>) => IOOption<B>
<A, B>(self: IOOption<A>, f: (a: A) => O.Option<B>): IOOption<B>
}
```

Expand Down
162 changes: 102 additions & 60 deletions docs/modules/ReaderTaskEither.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,14 @@ Added in v2.0.0
- [chainFirstTaskEitherKW](#chainfirsttaskeitherkw)
- [chainFirstTaskK](#chainfirsttaskk)
- [chainFirstW](#chainfirstw)
- [chainIOEitherK](#chainioeitherk)
- [chainIOEitherKW](#chainioeitherkw)
- [chainIOK](#chainiok)
- [chainNullableK](#chainnullablek)
- [chainOptionK](#chainoptionk)
- [chainOptionKW](#chainoptionkw)
- [chainReaderEitherK](#chainreadereitherk)
- [chainReaderEitherKW](#chainreadereitherkw)
- [chainReaderIOK](#chainreaderiok)
- [chainReaderIOKW](#chainreaderiokw)
- [chainReaderK](#chainreaderk)
Expand Down Expand Up @@ -164,16 +168,14 @@ Added in v2.0.0
- [matchEW](#matchew)
- [matchW](#matchw)
- [sequencing](#sequencing)
- [chainIOEitherK](#chainioeitherk)
- [chainIOEitherKW](#chainioeitherkw)
- [chainReaderEitherK](#chainreadereitherk)
- [chainReaderEitherKW](#chainreadereitherkw)
- [flatMap](#flatmap)
- [flatMapEither](#flatmapeither)
- [flatMapIO](#flatmapio)
- [flatMapIOEither](#flatmapioeither)
- [flatMapNullable](#flatmapnullable)
- [flatMapOption](#flatmapoption)
- [flatMapReader](#flatmapreader)
- [flatMapReaderEither](#flatmapreadereither)
- [flatMapReaderIO](#flatmapreaderio)
- [flatMapReaderTask](#flatmapreadertask)
- [flatMapTask](#flatmaptask)
Expand Down Expand Up @@ -1619,6 +1621,38 @@ export declare const chainFirstW: <R2, E2, A, B>(

Added in v2.8.0

## chainIOEitherK

Alias of `flatMapIOEither`.

**Signature**

```ts
export declare const chainIOEitherK: <E, A, B>(
f: (a: A) => IOEither<E, B>
) => <R>(ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, B>
```

Added in v2.4.0

## chainIOEitherKW

Alias of `flatMapIOEither`.

Less strict version of [`chainIOEitherK`](#chainioeitherk).

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

**Signature**

```ts
export declare const chainIOEitherKW: <E2, A, B>(
f: (a: A) => IOEither<E2, B>
) => <R, E1>(ma: ReaderTaskEither<R, E1, A>) => ReaderTaskEither<R, E2 | E1, B>
```

Added in v2.6.1

## chainIOK

Alias of `flatMapIO`.
Expand Down Expand Up @@ -1677,6 +1711,38 @@ export declare const chainOptionKW: <E2>(

Added in v2.13.2

## chainReaderEitherK

Alias of `flatMapReaderEither`.

**Signature**

```ts
export declare const chainReaderEitherK: <R, E, A, B>(
f: (a: A) => ReaderEither<R, E, B>
) => (ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, B>
```

Added in v2.11.0

## chainReaderEitherKW

Alias of `flatMapReaderEither`.

Less strict version of [`chainReaderEitherK`](#chainreadereitherk).

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

**Signature**

```ts
export declare const chainReaderEitherKW: <R2, E2, A, B>(
f: (a: A) => ReaderEither<R2, E2, B>
) => <R1, E1>(ma: ReaderTaskEither<R1, E1, A>) => ReaderTaskEither<R1 & R2, E2 | E1, B>
```

Added in v2.11.0

## chainReaderIOK

Alias of `flatMapReaderIO`.
Expand Down Expand Up @@ -2219,62 +2285,6 @@ Added in v2.10.0

# sequencing

## chainIOEitherK

**Signature**

```ts
export declare const chainIOEitherK: <E, A, B>(
f: (a: A) => IOEither<E, B>
) => <R>(ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, B>
```

Added in v2.4.0

## chainIOEitherKW

Less strict version of [`chainIOEitherK`](#chainioeitherk).

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

**Signature**

```ts
export declare const chainIOEitherKW: <E2, A, B>(
f: (a: A) => IOEither<E2, B>
) => <R, E1>(ma: ReaderTaskEither<R, E1, A>) => ReaderTaskEither<R, E2 | E1, B>
```

Added in v2.6.1

## chainReaderEitherK

**Signature**

```ts
export declare const chainReaderEitherK: <R, E, A, B>(
f: (a: A) => ReaderEither<R, E, B>
) => (ma: ReaderTaskEither<R, E, A>) => ReaderTaskEither<R, E, B>
```

Added in v2.11.0

## chainReaderEitherKW

Less strict version of [`chainReaderEitherK`](#chainreadereitherk).

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

**Signature**

```ts
export declare const chainReaderEitherKW: <R2, E2, A, B>(
f: (a: A) => ReaderEither<R2, E2, B>
) => <R1, E1>(ma: ReaderTaskEither<R1, E1, A>) => ReaderTaskEither<R1 & R2, E2 | E1, B>
```

Added in v2.11.0

## flatMap

**Signature**
Expand Down Expand Up @@ -2320,6 +2330,19 @@ export declare const flatMapIO: {

Added in v2.16.0

## flatMapIOEither

**Signature**

```ts
export declare const flatMapIOEither: {
<A, E2, B>(f: (a: A) => IOEither<E2, B>): <R, E1>(self: ReaderTaskEither<R, E1, A>) => ReaderTaskEither<R, E2 | E1, B>
<R, E1, A, E2, B>(self: ReaderTaskEither<R, E1, A>, f: (a: A) => IOEither<E2, B>): ReaderTaskEither<R, E1 | E2, B>
}
```

Added in v2.16.0

## flatMapNullable

**Signature**
Expand Down Expand Up @@ -2371,6 +2394,25 @@ export declare const flatMapReader: {

Added in v2.16.0

## flatMapReaderEither

**Signature**

```ts
export declare const flatMapReaderEither: {
<A, R2, E2, B>(f: (a: A) => ReaderEither<R2, E2, B>): <R1, E1>(
self: ReaderTaskEither<R1, E1, A>
) => ReaderTaskEither<R1 & R2, E2 | E1, B>
<R1, E1, A, R2, E2, B>(self: ReaderTaskEither<R1, E1, A>, f: (a: A) => ReaderEither<R2, E2, B>): ReaderTaskEither<
R1 & R2,
E1 | E2,
B
>
}
```

Added in v2.16.0

## flatMapReaderIO

**Signature**
Expand Down
Loading