|
4 | 4 | import { Alt1 } from './Alt'
|
5 | 5 | import { Applicative as ApplicativeHKT, Applicative1 } from './Applicative'
|
6 | 6 | import { apFirst as apFirst_, Apply1, apS as apS_, apSecond as apSecond_ } from './Apply'
|
7 |
| -import { bind as bind_, Chain1, chainFirst as chainFirst_ } from './Chain' |
| 7 | +import { bind as bind_, Chain1, tap as tap_ } from './Chain' |
8 | 8 | import { ChainRec1, tailRec } from './ChainRec'
|
9 | 9 | import { Comonad1 } from './Comonad'
|
10 | 10 | import { Eq } from './Eq'
|
@@ -275,10 +275,21 @@ export const Monad: Monad1<URI> = {
|
275 | 275 | * Composes computations in sequence, using the return value of one computation to determine the next computation and
|
276 | 276 | * keeping only the result of the first.
|
277 | 277 | *
|
278 |
| - * @category sequencing |
| 278 | + * @category combinators |
| 279 | + * @since 2.16.7 |
| 280 | + */ |
| 281 | +export const tap: { |
| 282 | + <A, _>(self: Identity<A>, f: (a: A) => Identity<_>): Identity<A> |
| 283 | + <A, _>(f: (a: A) => Identity<_>): (self: Identity<A>) => Identity<A> |
| 284 | +} = /*#__PURE__*/ dual(2, tap_(Chain)) |
| 285 | + |
| 286 | +/** |
| 287 | + * Alias of `tap` |
| 288 | + * |
| 289 | + * @category legacy |
279 | 290 | * @since 2.0.0
|
280 | 291 | */
|
281 |
| -export const chainFirst: <A, B>(f: (a: A) => B) => (first: A) => A = /*#__PURE__*/ chainFirst_(Chain) |
| 292 | +export const chainFirst: <A, B>(f: (a: A) => B) => (first: A) => A = tap |
282 | 293 |
|
283 | 294 | /**
|
284 | 295 | * @category instances
|
|
0 commit comments