Repository: karen-irc/option-t
Pull request #1177 (2021-12-16 05:14:46)

Rename `tap()` in `PlainOption` & `PlainResult` to `inspect()`
- Fix https://github.com/karen-irc/option-t/issues/1171
- __Deprecation__: This change mark `tap()` as _deprecated_. This change does not remove them but we would remove them in the future release, so we enforce user project to replace them with `inspect()`  


Patch:
diff --git a/src/Maybe/index.ts b/src/Maybe/index.ts
index 39f4f72e..2a96e5d9 100644
--- a/src/Maybe/index.ts
+++ b/src/Maybe/index.ts
@@ -4,6 +4,7 @@ export { NotNullAndUndefined, Maybe, isNotNullAndUndefined, isNullOrUndefined }
 export { andThenForMaybe as andThen } from './andThen';
 export { andThenAsyncForMaybe as andThenAsync } from './andThenAsync';
 export { expectNotNullAndUndefined as expect } from './expect';
+export { inspectMaybe as inspect } from './inspect';
 export { mapForMaybe as map } from './map';
 export { mapAsyncForMaybe as mapAsync } from './mapAsync';
 export { mapOrForMaybe as mapOr } from './mapOr';
diff --git a/src/Maybe/inspect.ts b/src/Maybe/inspect.ts
new file mode 100644
index 00000000..ec548f8c
--- /dev/null
+++ b/src/Maybe/inspect.ts
@@ -0,0 +1,18 @@
+import { EffectFn } from '../internal/Function';
+import { Maybe } from './Maybe';
+
+/**
+ *  * Return _input_ directly.
+ *      * This value is passed as the input. But it maybe mutated by calling _effector_.
+ *  * Call _effector_ with _input_ if _input_ is not `null` and `undefined`.
+ *
+ *  * This was added to sort with others or future enhancement to accept chaining functions.
+ *    We recommend to use simple `if` statement or similar way and they would be more efficient.
+ */
+export function inspectMaybe<T>(input: Maybe<T>, effector: EffectFn<T>): Maybe<T> {
+    if (input !== undefined && input !== null) {
+        effector(input);
+    }
+
+    return input;
+}
diff --git a/src/Maybe/tap.ts b/src/Maybe/tap.ts
index 3dc26712..29524e20 100644
--- a/src/Maybe/tap.ts
+++ b/src/Maybe/tap.ts
@@ -1,18 +1,8 @@
-import { EffectFn } from '../internal/Function';
-import { Maybe } from './Maybe';
+import { inspectMaybe } from './inspect';
 
 /**
- *  * Return _input_ directly.
- *      * This value is passed as the input. But it maybe mutated by calling _effector_.
- *  * Call _effector_ with _input_ if _input_ is not `null` and `undefined`.
- *
- *  * This was added to sort with others or future enhancement to accept chaining functions.
- *    We recommend to use simple `if` statement or similar way and they would be more efficient.
+ *  @deprecated
+ *  This will be removed in a future release.
+ *  Use {@link inspectMaybe}
  */
-export function tapMaybe<T>(input: Maybe<T>, effector: EffectFn<T>): Maybe<T> {
-    if (input !== undefined && input !== null) {
-        effector(input);
-    }
-
-    return input;
-}
+export const tapMaybe: typeof inspectMaybe = inspectMaybe;
diff --git a/src/Nullable/index.ts b/src/Nullable/index.ts
index d5641e03..4c1840b5 100644
--- a/src/Nullable/index.ts
+++ b/src/Nullable/index.ts
@@ -4,6 +4,7 @@ export { NotNull, Nullable, isNotNull, isNull } from './Nullable';
 export { andThenForNullable as andThen } from './andThen';
 export { andThenAsyncForNullable as andThenAsync } from './andThenAsync';
 export { expectNotNull as expect } from './expect';
+export { inspectNullable as inspect } from './inspect';
 export { mapForNullable as map } from './map';
 export { mapAsyncForNullable as mapAsync } from './mapAsync';
 export { mapOrForNullable as mapOr } from './mapOr';
diff --git a/src/Nullable/inspect.ts b/src/Nullable/inspect.ts
new file mode 100644
index 00000000..0a7be0da
--- /dev/null
+++ b/src/Nullable/inspect.ts
@@ -0,0 +1,18 @@
+import { EffectFn } from '../internal/Function';
+import { Nullable } from './Nullable';
+
+/**
+ *  * Return _input_ directly.
+ *      * This value is passed as the input. But it maybe mutated by calling _effector_.
+ *  * Call _effector_ with _input_ if _input_ is not `null`.
+ *
+ *  * This was added to sort with others or future enhancement to accept chaining functions.
+ *    We recommend to use simple `if` statement or similar way and they would be more efficient.
+ */
+export function inspectNullable<T>(input: Nullable<T>, effector: EffectFn<T>): Nullable<T> {
+    if (input !== null) {
+        effector(input);
+    }
+
+    return input;
+}
diff --git a/src/Nullable/tap.ts b/src/Nullable/tap.ts
index a3819bed..1912cd2b 100644
--- a/src/Nullable/tap.ts
+++ b/src/Nullable/tap.ts
@@ -1,18 +1,8 @@
-import { EffectFn } from '../internal/Function';
-import { Nullable } from './Nullable';
+import { inspectNullable } from './inspect';
 
 /**
- *  * Return _input_ directly.
- *      * This value is passed as the input. But it maybe mutated by calling _effector_.
- *  * Call _effector_ with _input_ if _input_ is not `null`.
- *
- *  * This was added to sort with others or future enhancement to accept chaining functions.
- *    We recommend to use simple `if` statement or similar way and they would be more efficient.
+ *  @deprecated
+ *  This will be removed in a future release.
+ *  Use {@link inspectNullable}
  */
-export function tapNullable<T>(input: Nullable<T>, effector: EffectFn<T>): Nullable<T> {
-    if (input !== null) {
-        effector(input);
-    }
-
-    return input;
-}
+export const tapNullable: typeof inspectNullable = inspectNullable;
diff --git a/src/PlainOption/index.ts b/src/PlainOption/index.ts
index 1311283e..2a1b2a94 100644
--- a/src/PlainOption/index.ts
+++ b/src/PlainOption/index.ts
@@ -33,6 +33,7 @@ export { equalForOption as equal } from './equal';
 export { expectIsSome as expect } from './expect';
 export { filterForOption as filter } from './filter';
 export { flattenForOption as flatten } from './flatten';
+export { inspectOption as inspect } from './inspect';
 export { mapForOption as map } from './map';
 export { mapAsyncForOption as mapAsync } from './mapAsync';
 export { mapOrForOption as mapOr } from './mapOr';
diff --git a/src/PlainOption/inspect.ts b/src/PlainOption/inspect.ts
new file mode 100644
index 00000000..db354e39
--- /dev/null
+++ b/src/PlainOption/inspect.ts
@@ -0,0 +1,17 @@
+import { EffectFn } from '../internal/Function';
+import { Option } from './Option';
+
+/**
+ *  * Return _input_ directly.
+ *      * This value is passed as the input. But it maybe mutated by calling _effector_.
+ *  * Call _effector_ with the inner value of _input_ if _input_ is `Some(T)`.
+ *  * This main purpose is to inspect an inner value in a chained function calling.
+ *    If you don't have to do it, you should not mutate the inner value.
+ *    if-else statement might be sufficient to mutate the inner value instead of calling this function.
+ */
+export function inspectOption<T>(input: Option<T>, effector: EffectFn<T>): Option<T> {
+    if (input.ok) {
+        effector(input.val);
+    }
+    return input;
+}
diff --git a/src/PlainOption/tap.ts b/src/PlainOption/tap.ts
index 1786f34e..d9d72c04 100644
--- a/src/PlainOption/tap.ts
+++ b/src/PlainOption/tap.ts
@@ -1,17 +1,8 @@
-import { EffectFn } from '../internal/Function';
-import { Option } from './Option';
+import { inspectOption } from './inspect';
 
 /**
- *  * Return _input_ directly.
- *      * This value is passed as the input. But it maybe mutated by calling _effector_.
- *  * Call _effector_ with the inner value of _input_ if _input_ is `Some(T)`.
- *  * This main purpose is to inspect an inner value in a chained function calling.
- *    If you don't have to do it, you should not mutate the inner value.
- *    if-else statement might be sufficient to mutate the inner value instead of calling this function.
+ *  @deprecated
+ *  This will be removed in a future release.
+ *  Use {@link inspectOption}
  */
-export function tapOption<T>(input: Option<T>, effector: EffectFn<T>): Option<T> {
-    if (input.ok) {
-        effector(input.val);
-    }
-    return input;
-}
+export const tapOption: typeof inspectOption = inspectOption;
diff --git a/src/PlainResult/index.ts b/src/PlainResult/index.ts
index 10d29579..3272a4d8 100644
--- a/src/PlainResult/index.ts
+++ b/src/PlainResult/index.ts
@@ -31,6 +31,7 @@ export { andThenAsyncForResult as andThenAsync } from './andThenAsync';
 export { equalForResult as equal } from './equal';
 export { expectIsOk as expect, expectIsErr as expectErr } from './expect';
 export { flattenForResult as flatten } from './flatten';
+export { inspectOk, inspectErr, inspectBoth } from './inspect';
 export { mapForResult as map } from './map';
 export { mapAsyncForResult as mapAsync } from './mapAsync';
 export { mapOrForResult as mapOr } from './mapOr';
diff --git a/src/PlainResult/inspect.ts b/src/PlainResult/inspect.ts
new file mode 100644
index 00000000..5ff89882
--- /dev/null
+++ b/src/PlainResult/inspect.ts
@@ -0,0 +1,50 @@
+import { EffectFn } from '../internal/Function';
+import { Result } from './Result';
+
+function noop<T>(_v: T) {}
+
+/**
+ *  * Return _input_ directly.
+ *      * This value is passed as the input. But it maybe mutated by calling _effector_.
+ *  * Call _effector_ with the inner value of _input_ if _input_ is `Ok(T)`.
+ *  * This main purpose is to inspect an inner value in a chained function calling.
+ *    If you don't have to do it, you should not mutate the inner value.
+ *    if-else statement might be sufficient to mutate the inner value instead of calling this function.
+ */
+export function inspectOk<T, E>(input: Result<T, E>, effector: EffectFn<T>): Result<T, E> {
+    return inspectBoth(input, effector, noop);
+}
+
+/**
+ *  * Return _input_ directly.
+ *      * This value is passed as the input. But it maybe mutated by calling _effector_.
+ *  * Call _effector_ with the inner value of _input_ if _input_ is `Err(E)`.
+ *  * This main purpose is to inspect an inner value in a chained function calling.
+ *    If you don't have to do it, you should not mutate the inner value.
+ *    if-else statement might be sufficient to mutate the inner value instead of calling this function.
+ */
+export function inspectErr<T, E>(input: Result<T, E>, effector: EffectFn<E>): Result<T, E> {
+    return inspectBoth(input, noop, effector);
+}
+
+/**
+ *  * Return _input_ directly.
+ *      * This value is passed as the input. But it maybe mutated by calling _effector_.
+ *  * Call _okEffector_ with the inner value of _input_ if _input_ is `Ok(T)`.
+ *    Otherwise, call _errEffector_ with the inner value if _input_ is `Err(E)`
+ *  * This main purpose is to inspect an inner value in a chained function calling.
+ *    If you don't have to do it, you should not mutate the inner value.
+ *    if-else statement might be sufficient to mutate the inner value instead of calling this function.
+ */
+export function inspectBoth<T, E>(
+    input: Result<T, E>,
+    okEffector: EffectFn<T>,
+    errEffector: EffectFn<E>
+): Result<T, E> {
+    if (input.ok) {
+        okEffector(input.val);
+    } else {
+        errEffector(input.err);
+    }
+    return input;
+}
diff --git a/src/PlainResult/tap.ts b/src/PlainResult/tap.ts
index 4acf7e7b..7bf2e587 100644
--- a/src/PlainResult/tap.ts
+++ b/src/PlainResult/tap.ts
@@ -1,50 +1,22 @@
-import { EffectFn } from '../internal/Function';
-import { Result } from './Result';
-
-function noop<T>(_v: T) {}
+import { inspectBoth, inspectErr, inspectOk } from './inspect';
 
 /**
- *  * Return _input_ directly.
- *      * This value is passed as the input. But it maybe mutated by calling _effector_.
- *  * Call _effector_ with the inner value of _input_ if _input_ is `Ok(T)`.
- *  * This main purpose is to inspect an inner value in a chained function calling.
- *    If you don't have to do it, you should not mutate the inner value.
- *    if-else statement might be sufficient to mutate the inner value instead of calling this function.
+ *  @deprecated
+ *  This will be removed in a future release.
+ *  Use {@link inspectOk}
  */
-export function tapOk<T, E>(input: Result<T, E>, effector: EffectFn<T>): Result<T, E> {
-    return tapBoth(input, effector, noop);
-}
+export const tapOk: typeof inspectOk = inspectOk;
 
 /**
- *  * Return _input_ directly.
- *      * This value is passed as the input. But it maybe mutated by calling _effector_.
- *  * Call _effector_ with the inner value of _input_ if _input_ is `Err(E)`.
- *  * This main purpose is to inspect an inner value in a chained function calling.
- *    If you don't have to do it, you should not mutate the inner value.
- *    if-else statement might be sufficient to mutate the inner value instead of calling this function.
+ *  @deprecated
+ *  This will be removed in a future release.
+ *  Use {@link inspectErr}
  */
-export function tapErr<T, E>(input: Result<T, E>, effector: EffectFn<E>): Result<T, E> {
-    return tapBoth(input, noop, effector);
-}
+export const tapErr: typeof inspectErr = inspectErr;
 
 /**
- *  * Return _input_ directly.
- *      * This value is passed as the input. But it maybe mutated by calling _effector_.
- *  * Call _okEffector_ with the inner value of _input_ if _input_ is `Ok(T)`.
- *    Otherwise, call _errEffector_ with the inner value if _input_ is `Err(E)`
- *  * This main purpose is to inspect an inner value in a chained function calling.
- *    If you don't have to do it, you should not mutate the inner value.
- *    if-else statement might be sufficient to mutate the inner value instead of calling this function.
+ *  @deprecated
+ *  This will be removed in a future release.
+ *  Use {@link inspectBoth}
  */
-export function tapBoth<T, E>(
-    input: Result<T, E>,
-    okEffector: EffectFn<T>,
-    errEffector: EffectFn<E>
-): Result<T, E> {
-    if (input.ok) {
-        okEffector(input.val);
-    } else {
-        errEffector(input.err);
-    }
-    return input;
-}
+export const tapBoth: typeof inspectBoth = inspectBoth;
diff --git a/src/Undefinable/index.ts b/src/Undefinable/index.ts
index 33e1f587..c1dc65ae 100644
--- a/src/Undefinable/index.ts
+++ b/src/Undefinable/index.ts
@@ -4,6 +4,7 @@ export { NotUndefined, Undefinable, isNotUndefined, isUndefined } from './Undefi
 export { andThenForUndefinable as andThen } from './andThen';
 export { andThenAsyncForUndefinable as andThenAsync } from './andThenAsync';
 export { expectNotUndefined as expect } from './expect';
+export { inspectUndefinable as inspect } from './inspect';
 export { mapForUndefinable as map } from './map';
 export { mapAsyncForUndefinable as mapAsync } from './mapAsync';
 export { mapOrForUndefinable as mapOr } from './mapOr';
diff --git a/src/Undefinable/inspect.ts b/src/Undefinable/inspect.ts
new file mode 100644
index 00000000..d3075c59
--- /dev/null
+++ b/src/Undefinable/inspect.ts
@@ -0,0 +1,20 @@
+import { EffectFn } from '../internal/Function';
+import { Undefinable } from './Undefinable';
+
+/**
+ *  * Return _input_ directly.
+ *      * This value is passed as the input. But it maybe mutated by calling _effector_.
+ *  * Call _effector_ with _input_ if _input_ is not `undefined`.
+ *
+ *  * This was added to sort with others or future enhancement to accept chaining functions.
+ *    We recommend to use simple `if` statement or similar way and they would be more efficient.
+ */
+export function inspectUndefinable<T>(
+    input: Undefinable<T>,
+    effector: EffectFn<T>
+): Undefinable<T> {
+    if (input !== undefined) {
+        effector(input);
+    }
+    return input;
+}
diff --git a/src/Undefinable/tap.ts b/src/Undefinable/tap.ts
index 9504a203..48b59b9f 100644
--- a/src/Undefinable/tap.ts
+++ b/src/Undefinable/tap.ts
@@ -1,17 +1,8 @@
-import { EffectFn } from '../internal/Function';
-import { Undefinable } from './Undefinable';
+import { inspectUndefinable } from './inspect';
 
 /**
- *  * Return _input_ directly.
- *      * This value is passed as the input. But it maybe mutated by calling _effector_.
- *  * Call _effector_ with _input_ if _input_ is not `undefined`.
- *
- *  * This was added to sort with others or future enhancement to accept chaining functions.
- *    We recommend to use simple `if` statement or similar way and they would be more efficient.
+ *  @deprecated
+ *  This will be removed in a future release.
+ *  Use {@link inspectUndefinable}
  */
-export function tapUndefinable<T>(input: Undefinable<T>, effector: EffectFn<T>): Undefinable<T> {
-    if (input !== undefined) {
-        effector(input);
-    }
-    return input;
-}
+export const tapUndefinable: typeof inspectUndefinable = inspectUndefinable;
diff --git a/tools/pkg_files.json b/tools/pkg_files.json
index d98368ec..c349be76 100644
--- a/tools/pkg_files.json
+++ b/tools/pkg_files.json
@@ -33,6 +33,8 @@
     "cjs/Maybe/expect.js": null,
     "cjs/Maybe/index.d.ts": null,
     "cjs/Maybe/index.js": null,
+    "cjs/Maybe/inspect.d.ts": null,
+    "cjs/Maybe/inspect.js": null,
     "cjs/Maybe/map.d.ts": null,
     "cjs/Maybe/map.js": null,
     "cjs/Maybe/mapAsync.d.ts": null,
@@ -77,6 +79,8 @@
     "cjs/Nullable/expect.js": null,
     "cjs/Nullable/index.d.ts": null,
     "cjs/Nullable/index.js": null,
+    "cjs/Nullable/inspect.d.ts": null,
+    "cjs/Nullable/inspect.js": null,
     "cjs/Nullable/map.d.ts": null,
     "cjs/Nullable/map.js": null,
     "cjs/Nullable/mapAsync.d.ts": null,
@@ -131,6 +135,8 @@
     "cjs/PlainOption/flatten.js": null,
     "cjs/PlainOption/index.d.ts": null,
     "cjs/PlainOption/index.js": null,
+    "cjs/PlainOption/inspect.d.ts": null,
+    "cjs/PlainOption/inspect.js": null,
     "cjs/PlainOption/map.d.ts": null,
     "cjs/PlainOption/map.js": null,
     "cjs/PlainOption/mapAsync.d.ts": null,
@@ -187,6 +193,8 @@
     "cjs/PlainResult/flatten.js": null,
     "cjs/PlainResult/index.d.ts": null,
     "cjs/PlainResult/index.js": null,
+    "cjs/PlainResult/inspect.d.ts": null,
+    "cjs/PlainResult/inspect.js": null,
     "cjs/PlainResult/map.d.ts": null,
     "cjs/PlainResult/map.js": null,
     "cjs/PlainResult/mapAsync.d.ts": null,
@@ -239,6 +247,8 @@
     "cjs/Undefinable/expect.js": null,
     "cjs/Undefinable/index.d.ts": null,
     "cjs/Undefinable/index.js": null,
+    "cjs/Undefinable/inspect.d.ts": null,
+    "cjs/Undefinable/inspect.js": null,
     "cjs/Undefinable/map.d.ts": null,
     "cjs/Undefinable/map.js": null,
     "cjs/Undefinable/mapAsync.d.ts": null,
@@ -309,6 +319,8 @@
     "esm/Maybe/expect.mjs": null,
     "esm/Maybe/index.d.ts": null,
     "esm/Maybe/index.mjs": null,
+    "esm/Maybe/inspect.d.ts": null,
+    "esm/Maybe/inspect.mjs": null,
     "esm/Maybe/map.d.ts": null,
     "esm/Maybe/map.mjs": null,
     "esm/Maybe/mapAsync.d.ts": null,
@@ -353,6 +365,8 @@
     "esm/Nullable/expect.mjs": null,
     "esm/Nullable/index.d.ts": null,
     "esm/Nullable/index.mjs": null,
+    "esm/Nullable/inspect.d.ts": null,
+    "esm/Nullable/inspect.mjs": null,
     "esm/Nullable/map.d.ts": null,
     "esm/Nullable/map.mjs": null,
     "esm/Nullable/mapAsync.d.ts": null,
@@ -407,6 +421,8 @@
     "esm/PlainOption/flatten.mjs": null,
     "esm/PlainOption/index.d.ts": null,
     "esm/PlainOption/index.mjs": null,
+    "esm/PlainOption/inspect.d.ts": null,
+    "esm/PlainOption/inspect.mjs": null,
     "esm/PlainOption/map.d.ts": null,
     "esm/PlainOption/map.mjs": null,
     "esm/PlainOption/mapAsync.d.ts": null,
@@ -463,6 +479,8 @@
     "esm/PlainResult/flatten.mjs": null,
     "esm/PlainResult/index.d.ts": null,
     "esm/PlainResult/index.mjs": null,
+    "esm/PlainResult/inspect.d.ts": null,
+    "esm/PlainResult/inspect.mjs": null,
     "esm/PlainResult/map.d.ts": null,
     "esm/PlainResult/map.mjs": null,
     "esm/PlainResult/mapAsync.d.ts": null,
@@ -515,6 +533,8 @@
     "esm/Undefinable/expect.mjs": null,
     "esm/Undefinable/index.d.ts": null,
     "esm/Undefinable/index.mjs": null,
+    "esm/Undefinable/inspect.d.ts": null,
+    "esm/Undefinable/inspect.mjs": null,
     "esm/Undefinable/map.d.ts": null,
     "esm/Undefinable/map.mjs": null,
     "esm/Undefinable/mapAsync.d.ts": null,
@@ -596,6 +616,9 @@
     "lib/Maybe/index.d.ts": null,
     "lib/Maybe/index.js": null,
     "lib/Maybe/index.mjs": null,
+    "lib/Maybe/inspect.d.ts": null,
+    "lib/Maybe/inspect.js": null,
+    "lib/Maybe/inspect.mjs": null,
     "lib/Maybe/map.d.ts": null,
     "lib/Maybe/map.js": null,
     "lib/Maybe/map.mjs": null,
@@ -662,6 +685,9 @@
     "lib/Nullable/index.d.ts": null,
     "lib/Nullable/index.js": null,
     "lib/Nullable/index.mjs": null,
+    "lib/Nullable/inspect.d.ts": null,
+    "lib/Nullable/inspect.js": null,
+    "lib/Nullable/inspect.mjs": null,
     "lib/Nullable/map.d.ts": null,
     "lib/Nullable/map.js": null,
     "lib/Nullable/map.mjs": null,
@@ -743,6 +769,9 @@
     "lib/PlainOption/index.d.ts": null,
     "lib/PlainOption/index.js": null,
     "lib/PlainOption/index.mjs": null,
+    "lib/PlainOption/inspect.d.ts": null,
+    "lib/PlainOption/inspect.js": null,
+    "lib/PlainOption/inspect.mjs": null,
     "lib/PlainOption/map.d.ts": null,
     "lib/PlainOption/map.js": null,
     "lib/PlainOption/map.mjs": null,
@@ -827,6 +856,9 @@
     "lib/PlainResult/index.d.ts": null,
     "lib/PlainResult/index.js": null,
     "lib/PlainResult/index.mjs": null,
+    "lib/PlainResult/inspect.d.ts": null,
+    "lib/PlainResult/inspect.js": null,
+    "lib/PlainResult/inspect.mjs": null,
     "lib/PlainResult/map.d.ts": null,
     "lib/PlainResult/map.js": null,
     "lib/PlainResult/map.mjs": null,
@@ -905,6 +937,9 @@
     "lib/Undefinable/index.d.ts": null,
     "lib/Undefinable/index.js": null,
     "lib/Undefinable/index.mjs": null,
+    "lib/Undefinable/inspect.d.ts": null,
+    "lib/Undefinable/inspect.js": null,
+    "lib/Undefinable/inspect.mjs": null,
     "lib/Undefinable/map.d.ts": null,
     "lib/Undefinable/map.js": null,
     "lib/Undefinable/map.mjs": null,
diff --git a/tools/public_api/table.mjs b/tools/public_api/table.mjs
index f8294d8f..0248b046 100644
--- a/tools/public_api/table.mjs
+++ b/tools/public_api/table.mjs
@@ -12,6 +12,7 @@ export const apiTable = Object.freeze({
             'andThen',
             'andThenAsync',
             'expect',
+            'inspect',
             'map',
             'mapAsync',
             'mapOr',
@@ -47,6 +48,11 @@ export const apiTable = Object.freeze({
             'expectNotNullAndUndefined'
         ]
     },
+    'Maybe/inspect': {
+        'exports': [
+            'inspectMaybe'
+        ]
+    },
     'Maybe/map': {
         'exports': [
             'mapForMaybe'
@@ -137,6 +143,7 @@ export const apiTable = Object.freeze({
             'andThen',
             'andThenAsync',
             'expect',
+            'inspect',
             'map',
             'mapAsync',
             'mapOr',
@@ -172,6 +179,11 @@ export const apiTable = Object.freeze({
             'expectNotNull',
         ]
     },
+    'Nullable/inspect': {
+        'exports': [
+            'inspectNullable'
+        ]
+    },
     'Nullable/map': {
         'exports': [
             'mapForNullable'
@@ -266,6 +278,7 @@ export const apiTable = Object.freeze({
             'andThenAsync',
             'equal',
             'expect',
+            'inspect',
             'filter',
             'flatten',
             'map',
@@ -331,6 +344,11 @@ export const apiTable = Object.freeze({
             'flattenForOption'
         ]
     },
+    'PlainOption/inspect': {
+        'exports': [
+            'inspectOption'
+        ]
+    },
     'PlainOption/map': {
         'exports': [
             'mapForOption'
@@ -443,6 +461,9 @@ export const apiTable = Object.freeze({
             'equal',
             'expect',
             'expectErr',
+            'inspectOk',
+            'inspectErr',
+            'inspectBoth',
             'flatten',
             'map',
             'mapAsync',
@@ -513,6 +534,13 @@ export const apiTable = Object.freeze({
             'flattenForResult'
         ]
     },
+    'PlainResult/inspect': {
+        'exports': [
+            'inspectOk',
+            'inspectErr',
+            'inspectBoth',
+        ]
+    },
     'PlainResult/map': {
         'exports': [
             'mapForResult'
@@ -624,6 +652,7 @@ export const apiTable = Object.freeze({
             'andThen',
             'andThenAsync',
             'expect',
+            'inspect',
             'map',
             'mapAsync',
             'mapOr',
@@ -660,6 +689,11 @@ export const apiTable = Object.freeze({
             'expectNotUndefined'
         ]
     },
+    'Undefinable/inspect': {
+        'exports': [
+            'inspectUndefinable'
+        ]
+    },
     'Undefinable/map': {
         'exports': [
             'mapForUndefinable'
@@ -769,6 +803,7 @@ export const legacyApiTable = Object.freeze({
     'cjs/Maybe/andThenAsync': COMPAT_DESCRIPTOR,
     'cjs/Maybe/expect': COMPAT_DESCRIPTOR,
     'cjs/Maybe/index': COMPAT_DESCRIPTOR,
+    'cjs/Maybe/inspect': COMPAT_DESCRIPTOR,
     'cjs/Maybe': COMPAT_DESCRIPTOR,
     'cjs/Maybe/map': COMPAT_DESCRIPTOR,
     'cjs/Maybe/mapAsync': COMPAT_DESCRIPTOR,
@@ -792,6 +827,7 @@ export const legacyApiTable = Object.freeze({
     'cjs/Nullable/andThenAsync': COMPAT_DESCRIPTOR,
     'cjs/Nullable/expect': COMPAT_DESCRIPTOR,
     'cjs/Nullable/index': COMPAT_DESCRIPTOR,
+    'cjs/Nullable/inspect': COMPAT_DESCRIPTOR,
     'cjs/Nullable': COMPAT_DESCRIPTOR,
     'cjs/Nullable/map': COMPAT_DESCRIPTOR,
     'cjs/Nullable/mapAsync': COMPAT_DESCRIPTOR,
@@ -820,6 +856,7 @@ export const legacyApiTable = Object.freeze({
     'cjs/PlainOption/filter': COMPAT_DESCRIPTOR,
     'cjs/PlainOption/flatten': COMPAT_DESCRIPTOR,
     'cjs/PlainOption/index': COMPAT_DESCRIPTOR,
+    'cjs/PlainOption/inspect': COMPAT_DESCRIPTOR,
     'cjs/PlainOption': COMPAT_DESCRIPTOR,
     'cjs/PlainOption/map': COMPAT_DESCRIPTOR,
     'cjs/PlainOption/mapAsync': COMPAT_DESCRIPTOR,
@@ -849,6 +886,7 @@ export const legacyApiTable = Object.freeze({
     'cjs/PlainResult/expect': COMPAT_DESCRIPTOR,
     'cjs/PlainResult/flatten': COMPAT_DESCRIPTOR,
     'cjs/PlainResult/index': COMPAT_DESCRIPTOR,
+    'cjs/PlainResult/inspect': COMPAT_DESCRIPTOR,
     'cjs/PlainResult': COMPAT_DESCRIPTOR,
     'cjs/PlainResult/map': COMPAT_DESCRIPTOR,
     'cjs/PlainResult/mapAsync': COMPAT_DESCRIPTOR,
@@ -876,6 +914,7 @@ export const legacyApiTable = Object.freeze({
     'cjs/Undefinable/andThenAsync': COMPAT_DESCRIPTOR,
     'cjs/Undefinable/expect': COMPAT_DESCRIPTOR,
     'cjs/Undefinable/index': COMPAT_DESCRIPTOR,
+    'cjs/Undefinable/inspect': COMPAT_DESCRIPTOR,
     'cjs/Undefinable': COMPAT_DESCRIPTOR,
     'cjs/Undefinable/map': COMPAT_DESCRIPTOR,
     'cjs/Undefinable/mapAsync': COMPAT_DESCRIPTOR,
@@ -902,6 +941,7 @@ export const legacyApiTable = Object.freeze({
     'esm/Maybe/andThenAsync': COMPAT_DESCRIPTOR,
     'esm/Maybe/expect': COMPAT_DESCRIPTOR,
     'esm/Maybe/index': COMPAT_DESCRIPTOR,
+    'esm/Maybe/inspect': COMPAT_DESCRIPTOR,
     'esm/Maybe': COMPAT_DESCRIPTOR,
     'esm/Maybe/map': COMPAT_DESCRIPTOR,
     'esm/Maybe/mapAsync': COMPAT_DESCRIPTOR,
@@ -925,6 +965,7 @@ export const legacyApiTable = Object.freeze({
     'esm/Nullable/andThenAsync': COMPAT_DESCRIPTOR,
     'esm/Nullable/expect': COMPAT_DESCRIPTOR,
     'esm/Nullable/index': COMPAT_DESCRIPTOR,
+    'esm/Nullable/inspect': COMPAT_DESCRIPTOR,
     'esm/Nullable': COMPAT_DESCRIPTOR,
     'esm/Nullable/map': COMPAT_DESCRIPTOR,
     'esm/Nullable/mapAsync': COMPAT_DESCRIPTOR,
@@ -953,6 +994,7 @@ export const legacyApiTable = Object.freeze({
     'esm/PlainOption/filter': COMPAT_DESCRIPTOR,
     'esm/PlainOption/flatten': COMPAT_DESCRIPTOR,
     'esm/PlainOption/index': COMPAT_DESCRIPTOR,
+    'esm/PlainOption/inspect': COMPAT_DESCRIPTOR,
     'esm/PlainOption': COMPAT_DESCRIPTOR,
     'esm/PlainOption/map': COMPAT_DESCRIPTOR,
     'esm/PlainOption/mapAsync': COMPAT_DESCRIPTOR,
@@ -982,6 +1024,7 @@ export const legacyApiTable = Object.freeze({
     'esm/PlainResult/expect': COMPAT_DESCRIPTOR,
     'esm/PlainResult/flatten': COMPAT_DESCRIPTOR,
     'esm/PlainResult/index': COMPAT_DESCRIPTOR,
+    'esm/PlainResult/inspect': COMPAT_DESCRIPTOR,
     'esm/PlainResult': COMPAT_DESCRIPTOR,
     'esm/PlainResult/map': COMPAT_DESCRIPTOR,
     'esm/PlainResult/mapAsync': COMPAT_DESCRIPTOR,
@@ -1009,6 +1052,7 @@ export const legacyApiTable = Object.freeze({
     'esm/Undefinable/andThenAsync': COMPAT_DESCRIPTOR,
     'esm/Undefinable/expect': COMPAT_DESCRIPTOR,
     'esm/Undefinable/index': COMPAT_DESCRIPTOR,
+    'esm/Undefinable/inspect': COMPAT_DESCRIPTOR,
     'esm/Undefinable': COMPAT_DESCRIPTOR,
     'esm/Undefinable/map': COMPAT_DESCRIPTOR,
     'esm/Undefinable/mapAsync': COMPAT_DESCRIPTOR,
@@ -1035,6 +1079,7 @@ export const legacyApiTable = Object.freeze({
     'lib/Maybe/andThenAsync': COMPAT_DESCRIPTOR,
     'lib/Maybe/expect': COMPAT_DESCRIPTOR,
     'lib/Maybe/index': COMPAT_DESCRIPTOR,
+    'lib/Maybe/inspect': COMPAT_DESCRIPTOR,
     'lib/Maybe': COMPAT_DESCRIPTOR,
     'lib/Maybe/map': COMPAT_DESCRIPTOR,
     'lib/Maybe/mapAsync': COMPAT_DESCRIPTOR,
@@ -1058,6 +1103,7 @@ export const legacyApiTable = Object.freeze({
     'lib/Nullable/andThenAsync': COMPAT_DESCRIPTOR,
     'lib/Nullable/expect': COMPAT_DESCRIPTOR,
     'lib/Nullable/index': COMPAT_DESCRIPTOR,
+    'lib/Nullable/inspect': COMPAT_DESCRIPTOR,
     'lib/Nullable': COMPAT_DESCRIPTOR,
     'lib/Nullable/map': COMPAT_DESCRIPTOR,
     'lib/Nullable/mapAsync': COMPAT_DESCRIPTOR,
@@ -1086,6 +1132,7 @@ export const legacyApiTable = Object.freeze({
     'lib/PlainOption/flatten': COMPAT_DESCRIPTOR,
     'lib/PlainOption/filter': COMPAT_DESCRIPTOR,
     'lib/PlainOption/index': COMPAT_DESCRIPTOR,
+    'lib/PlainOption/inspect': COMPAT_DESCRIPTOR,
     'lib/PlainOption': COMPAT_DESCRIPTOR,
     'lib/PlainOption/map': COMPAT_DESCRIPTOR,
     'lib/PlainOption/mapAsync': COMPAT_DESCRIPTOR,
@@ -1115,6 +1162,7 @@ export const legacyApiTable = Object.freeze({
     'lib/PlainResult/expect': COMPAT_DESCRIPTOR,
     'lib/PlainResult/flatten': COMPAT_DESCRIPTOR,
     'lib/PlainResult/index': COMPAT_DESCRIPTOR,
+    'lib/PlainResult/inspect': COMPAT_DESCRIPTOR,
     'lib/PlainResult': COMPAT_DESCRIPTOR,
     'lib/PlainResult/map': COMPAT_DESCRIPTOR,
     'lib/PlainResult/mapAsync': COMPAT_DESCRIPTOR,
@@ -1142,6 +1190,7 @@ export const legacyApiTable = Object.freeze({
     'lib/Undefinable/andThenAsync': COMPAT_DESCRIPTOR,
     'lib/Undefinable/expect': COMPAT_DESCRIPTOR,
     'lib/Undefinable/index': COMPAT_DESCRIPTOR,
+    'lib/Undefinable/inspect': COMPAT_DESCRIPTOR,
     'lib/Undefinable': COMPAT_DESCRIPTOR,
     'lib/Undefinable/map': COMPAT_DESCRIPTOR,
     'lib/Undefinable/mapAsync': COMPAT_DESCRIPTOR,


Test patch:
diff --git a/__tests__/Maybe/tap.test.mjs b/__tests__/Maybe/inspect.test.mjs
similarity index 77%
rename from __tests__/Maybe/tap.test.mjs
rename to __tests__/Maybe/inspect.test.mjs
index 2e18f701..6ce55f4b 100644
--- a/__tests__/Maybe/tap.test.mjs
+++ b/__tests__/Maybe/inspect.test.mjs
@@ -1,13 +1,13 @@
 import test from 'ava';
 
-import { tapMaybe } from '../../__dist/esm/Maybe/tap.mjs';
+import { inspectMaybe } from '../../__dist/esm/Maybe/inspect.mjs';
 import { nonNullableValueCaseListForSync } from '../utils.mjs';
 
 for (const [INPUT, PASSED_VALUE, EXPECTED] of nonNullableValueCaseListForSync) {
     test('pass the value: ' + String(INPUT), (t) => {
         t.plan(3);
 
-        const actual = tapMaybe(INPUT, (v) => {
+        const actual = inspectMaybe(INPUT, (v) => {
             t.pass('should call the selector');
             t.is(v, PASSED_VALUE, 'the arg is the input');
         });
@@ -18,7 +18,7 @@ for (const [INPUT, PASSED_VALUE, EXPECTED] of nonNullableValueCaseListForSync) {
 
 for (const NULL_VALUE of [undefined, null]) {
     test(`pass ${NULL_VALUE}`, (t) => {
-        const result = tapMaybe(NULL_VALUE, (_v) => {
+        const result = inspectMaybe(NULL_VALUE, (_v) => {
             t.fail('should not call selector fn');
         });
 
diff --git a/__tests__/Nullable/tap.test.mjs b/__tests__/Nullable/inspect.test.mjs
similarity index 77%
rename from __tests__/Nullable/tap.test.mjs
rename to __tests__/Nullable/inspect.test.mjs
index c0eec0d5..e3face0e 100644
--- a/__tests__/Nullable/tap.test.mjs
+++ b/__tests__/Nullable/inspect.test.mjs
@@ -1,6 +1,6 @@
 import test from 'ava';
 
-import { tapNullable } from '../../__dist/esm/Nullable/tap.mjs';
+import { inspectNullable } from '../../__dist/esm/Nullable/inspect.mjs';
 import { nonNullableValueCaseListForSync } from '../utils.mjs';
 
 const NULL_VALUE_IN_THIS_TEST_CASE = null;
@@ -10,7 +10,7 @@ for (const [INPUT, PASSED_VALUE, EXPECTED] of nonNullableValueCaseListForSync) {
     test('pass the value: ' + String(INPUT), (t) => {
         t.plan(3);
 
-        const actual = tapNullable(INPUT, (v) => {
+        const actual = inspectNullable(INPUT, (v) => {
             t.pass();
             t.is(v, PASSED_VALUE, 'the arg is input');
         });
@@ -22,7 +22,7 @@ for (const [INPUT, PASSED_VALUE, EXPECTED] of nonNullableValueCaseListForSync) {
 test(`pass ${NULL_VALUE_IN_THIS_TEST_CASE}`, (t) => {
     t.plan(1);
 
-    const result = tapNullable(NULL_VALUE_IN_THIS_TEST_CASE, (_v) => {
+    const result = inspectNullable(NULL_VALUE_IN_THIS_TEST_CASE, (_v) => {
         t.fail();
     });
     t.is(result, NULL_VALUE_IN_THIS_TEST_CASE);
@@ -32,7 +32,7 @@ test(`pass ${NULLY_VALUE_BUT_NOT_NULL_VALUE_IN_THIS_TEST_CASE}`, (t) => {
     t.plan(3);
 
     const INPUT = NULLY_VALUE_BUT_NOT_NULL_VALUE_IN_THIS_TEST_CASE;
-    const result = tapNullable(INPUT, (v) => {
+    const result = inspectNullable(INPUT, (v) => {
         t.pass();
         t.is(v, INPUT, 'the arg is INPUT');
     });
diff --git a/__tests__/PlainOption/tap.test.mjs b/__tests__/PlainOption/inspect.test.mjs
similarity index 80%
rename from __tests__/PlainOption/tap.test.mjs
rename to __tests__/PlainOption/inspect.test.mjs
index d6086a12..af353500 100644
--- a/__tests__/PlainOption/tap.test.mjs
+++ b/__tests__/PlainOption/inspect.test.mjs
@@ -1,7 +1,7 @@
 import test from 'ava';
 
 import { createSome, createNone } from '../../__dist/esm/PlainOption/Option.mjs';
-import { tapOption } from '../../__dist/esm/PlainOption/tap.mjs';
+import { inspectOption } from '../../__dist/esm/PlainOption/inspect.mjs';
 
 test('input is Some', (t) => {
     const INPUT_INNER = Symbol('input');
@@ -11,7 +11,7 @@ test('input is Some', (t) => {
     t.plan(3);
 
     const input = createSome(INPUT_INNER);
-    const actual = tapOption(input, (v) => {
+    const actual = inspectOption(input, (v) => {
         t.pass('should call the tap fn');
         arg = v;
     });
@@ -26,7 +26,7 @@ test('input is None', (t) => {
     t.plan(1);
 
     const input = createNone(INPUT_INNER);
-    const actual = tapOption(input, (_v) => {
+    const actual = inspectOption(input, (_v) => {
         t.pass('should not call the tap fn');
     });
 
diff --git a/__tests__/PlainResult/tap/test_tap_both.test.mjs b/__tests__/PlainResult/inspect/test_inspect_both.test.mjs
similarity index 87%
rename from __tests__/PlainResult/tap/test_tap_both.test.mjs
rename to __tests__/PlainResult/inspect/test_inspect_both.test.mjs
index 03df70d3..4e984bdd 100644
--- a/__tests__/PlainResult/tap/test_tap_both.test.mjs
+++ b/__tests__/PlainResult/inspect/test_inspect_both.test.mjs
@@ -1,14 +1,14 @@
 import test from 'ava';
 
 import { createErr, createOk } from '../../../__dist/esm/PlainResult/Result.mjs';
-import { tapBoth } from '../../../__dist/esm/PlainResult/tap.mjs';
+import { inspectBoth } from '../../../__dist/esm/PlainResult/inspect.mjs';
 
 test('input is Ok()', (t) => {
     t.plan(3);
     const INPUT_INNER = Symbol('input');
 
     const input = createOk(INPUT_INNER);
-    const actual = tapBoth(
+    const actual = inspectBoth(
         input,
         (v) => {
             t.pass('should call the tap ok fn');
@@ -27,7 +27,7 @@ test('input is Err()', (t) => {
     const INPUT_INNER = Symbol('input');
 
     const input = createErr(INPUT_INNER);
-    const actual = tapBoth(
+    const actual = inspectBoth(
         input,
         (_v) => {
             t.fail('should not call this path');
diff --git a/__tests__/PlainResult/tap/test_tap_err.test.mjs b/__tests__/PlainResult/inspect/test_inspect_err.test.mjs
similarity index 79%
rename from __tests__/PlainResult/tap/test_tap_err.test.mjs
rename to __tests__/PlainResult/inspect/test_inspect_err.test.mjs
index 1dd33213..6de8aca6 100644
--- a/__tests__/PlainResult/tap/test_tap_err.test.mjs
+++ b/__tests__/PlainResult/inspect/test_inspect_err.test.mjs
@@ -1,14 +1,14 @@
 import test from 'ava';
 
 import { createErr, createOk } from '../../../__dist/esm/PlainResult/Result.mjs';
-import { tapErr } from '../../../__dist/esm/PlainResult/tap.mjs';
+import { inspectErr } from '../../../__dist/esm/PlainResult/inspect.mjs';
 
 test('input is Ok()', (t) => {
     t.plan(1);
     const INPUT_INNER = Symbol('input');
 
     const input = createOk(INPUT_INNER);
-    const actual = tapErr(input, (_v) => {
+    const actual = inspectErr(input, (_v) => {
         t.pass('should not call the tap fn');
     });
     t.is(input, actual, 'should be the expect returned');
@@ -19,7 +19,7 @@ test('input is Err()', (t) => {
     const INPUT_INNER = Symbol('input');
 
     const input = createErr(INPUT_INNER);
-    const actual = tapErr(input, (v) => {
+    const actual = inspectErr(input, (v) => {
         t.pass('should call the tap fn');
         t.is(v, INPUT_INNER, 'should be the expected arg');
     });
diff --git a/__tests__/PlainResult/tap/test_tap_ok.test.mjs b/__tests__/PlainResult/inspect/test_inspect_ok.test.mjs
similarity index 80%
rename from __tests__/PlainResult/tap/test_tap_ok.test.mjs
rename to __tests__/PlainResult/inspect/test_inspect_ok.test.mjs
index 0a1cb6cb..f7bbea50 100644
--- a/__tests__/PlainResult/tap/test_tap_ok.test.mjs
+++ b/__tests__/PlainResult/inspect/test_inspect_ok.test.mjs
@@ -1,14 +1,14 @@
 import test from 'ava';
 
 import { createErr, createOk } from '../../../__dist/esm/PlainResult/Result.mjs';
-import { tapOk } from '../../../__dist/esm/PlainResult/tap.mjs';
+import { inspectOk } from '../../../__dist/esm/PlainResult/inspect.mjs';
 
 test('input is Ok()', (t) => {
     t.plan(3);
     const INPUT_INNER = Symbol('input');
 
     const input = createOk(INPUT_INNER);
-    const actual = tapOk(input, (v) => {
+    const actual = inspectOk(input, (v) => {
         t.pass('should call the tap fn');
         t.is(v, INPUT_INNER, 'should be the expected arg');
     });
@@ -21,7 +21,7 @@ test('input is Err()', (t) => {
     const INPUT_INNER = Symbol('input');
 
     const input = createErr(INPUT_INNER);
-    const actual = tapOk(input, (_v) => {
+    const actual = inspectOk(input, (_v) => {
         t.pass('should not call the tap fn');
     });
 
diff --git a/__tests__/Undefinable/tap.test.mjs b/__tests__/Undefinable/inspect.test.mjs
similarity index 75%
rename from __tests__/Undefinable/tap.test.mjs
rename to __tests__/Undefinable/inspect.test.mjs
index efc6512a..ffced065 100644
--- a/__tests__/Undefinable/tap.test.mjs
+++ b/__tests__/Undefinable/inspect.test.mjs
@@ -1,6 +1,6 @@
 import test from 'ava';
 
-import { tapUndefinable } from '../../__dist/esm/Undefinable/tap.mjs';
+import { inspectUndefinable } from '../../__dist/esm/Undefinable/inspect.mjs';
 import { nonNullableValueCaseListForSync } from '../utils.mjs';
 
 const NULL_VALUE_IN_THIS_TEST_CASE = undefined;
@@ -10,7 +10,7 @@ for (const [INPUT, PASSED_VALUE, EXPECTED] of nonNullableValueCaseListForSync) {
     test('pass the value' + String(INPUT), (t) => {
         t.plan(3);
 
-        const result = tapUndefinable(INPUT, (v) => {
+        const result = inspectUndefinable(INPUT, (v) => {
             t.pass('should call selector fn');
             t.is(v, PASSED_VALUE);
         });
@@ -22,7 +22,7 @@ for (const [INPUT, PASSED_VALUE, EXPECTED] of nonNullableValueCaseListForSync) {
 test(`pass ${NULLY_VALUE_BUT_NOT_NULL_VALUE_IN_THIS_TEST_CASE}`, (t) => {
     t.plan(2);
 
-    const result = tapUndefinable(NULLY_VALUE_BUT_NOT_NULL_VALUE_IN_THIS_TEST_CASE, (_v) => {
+    const result = inspectUndefinable(NULLY_VALUE_BUT_NOT_NULL_VALUE_IN_THIS_TEST_CASE, (_v) => {
         t.pass('should call selector fn');
     });
 
@@ -32,7 +32,7 @@ test(`pass ${NULLY_VALUE_BUT_NOT_NULL_VALUE_IN_THIS_TEST_CASE}`, (t) => {
 test(`pass ${NULL_VALUE_IN_THIS_TEST_CASE}`, (t) => {
     t.plan(1);
 
-    const result = tapUndefinable(NULL_VALUE_IN_THIS_TEST_CASE, (_v) => {
+    const result = inspectUndefinable(NULL_VALUE_IN_THIS_TEST_CASE, (_v) => {
         t.pass('should not call selector fn');
     });