Repository: karen-irc/option-t
Pull request #1261 (2022-04-10 06:28:25)

Sort exported API naming style for unwrap/expect/inspect of PlainResult


Patch:
diff --git a/src/ClassResult/compat.ts b/src/ClassResult/compat.ts
index ba44c4fe..58a6805e 100644
--- a/src/ClassResult/compat.ts
+++ b/src/ClassResult/compat.ts
@@ -1,5 +1,5 @@
 import { Result as PlainResult, createOk, createErr, isOk } from '../PlainResult/Result';
-import { unwrapFromResult, unwrapErrFromResult } from '../PlainResult/unwrap';
+import { unwrapOkFromResult, unwrapErrFromResult } from '../PlainResult/unwrap';
 
 import { ClassicResult, createClassicOk, createClassicErr } from './ClassicResult';
 
@@ -17,7 +17,7 @@ export function compatToPlainResult<T, E>(classic: ClassicResult<T, E>): PlainRe
 
 export function compatToClassicResult<T, E>(plain: PlainResult<T, E>): ClassicResult<T, E> {
     if (isOk(plain)) {
-        const val: T = unwrapFromResult(plain);
+        const val: T = unwrapOkFromResult(plain);
         const result = createClassicOk<T, E>(val);
         return result;
     }
diff --git a/src/PlainResult/andThenAsync.ts b/src/PlainResult/andThenAsync.ts
index f7c5824f..884208b1 100644
--- a/src/PlainResult/andThenAsync.ts
+++ b/src/PlainResult/andThenAsync.ts
@@ -2,7 +2,7 @@ import { assertIsPromise } from '../internal/assert';
 import { ERR_MSG_TRANSFORMER_MUST_RETURN_PROMISE } from '../internal/ErrorMessage';
 import type { AsyncTransformFn } from '../internal/Function';
 import { Result, isErr } from './Result';
-import { unwrapFromResult } from './unwrap';
+import { unwrapOkFromResult } from './unwrap';
 
 export type ResultAsyncTryTransformFn<T, U, E> = AsyncTransformFn<T, Result<U, E>>;
 
@@ -23,7 +23,7 @@ export function andThenAsyncForResult<T, U, E>(
         return Promise.resolve(input);
     }
 
-    const source: T = unwrapFromResult(input);
+    const source: T = unwrapOkFromResult(input);
     const result: Promise<Result<U, E>> = transformer(source);
     // If this is async function, this always return Promise, but not.
     // We should check to clarify the error case if user call this function from plain js
diff --git a/src/PlainResult/expect.ts b/src/PlainResult/expect.ts
index 62396d08..da34e185 100644
--- a/src/PlainResult/expect.ts
+++ b/src/PlainResult/expect.ts
@@ -4,7 +4,7 @@ import { Result } from './Result';
  *  Return _input_ as `T` if the passed _input_ is `Ok(T)`.
  *  Otherwise, throw `TypeError` with the passed `msg`.
  */
-export function expectIsOk<T, E>(input: Result<T, E>, msg: string): T | never {
+export function expectOkForResult<T, E>(input: Result<T, E>, msg: string): T | never {
     if (!input.ok) {
         throw new TypeError(msg);
     }
@@ -12,14 +12,26 @@ export function expectIsOk<T, E>(input: Result<T, E>, msg: string): T | never {
     return input.val;
 }
 
+/**
+ *  @deprecated
+ *  Please use {@link expectOkForResult}
+ */
+export const expectIsOk: typeof expectOkForResult = expectOkForResult;
+
 /**
  *  Return _input_ as `E` if the passed _input_ is `Err(E)`.
  *  Otherwise, throw `TypeError` with the passed `msg`.
  */
-export function expectIsErr<T, E>(input: Result<T, E>, msg: string): E | never {
+export function expectErrForResult<T, E>(input: Result<T, E>, msg: string): E | never {
     if (input.ok) {
         throw new TypeError(msg);
     }
 
     return input.err;
 }
+
+/**
+ *  @deprecated
+ *  Please use {@link expectErrForResult}
+ */
+export const expectIsErr: typeof expectErrForResult = expectErrForResult;
diff --git a/src/PlainResult/index.ts b/src/PlainResult/index.ts
index d8a75c86..d526d057 100644
--- a/src/PlainResult/index.ts
+++ b/src/PlainResult/index.ts
@@ -29,9 +29,19 @@ export { andForResult as and } from './and';
 export { andThenForResult as andThen } from './andThen';
 export { andThenAsyncForResult as andThenAsync } from './andThenAsync';
 export { equalForResult as equal } from './equal';
-export { expectIsOk, expectIsErr, expectIsOk as expect, expectIsErr as expectErr } from './expect';
+export {
+    expectOkForResult as expect,
+    expectOkForResult as expectOk,
+    expectErrForResult as expectErr,
+    expectIsOk,
+    expectIsErr,
+} from './expect';
 export { flattenForResult as flatten } from './flatten';
-export { inspectOk, inspectErr, inspectBoth } from './inspect';
+export {
+    inspectOkOfResult as inspectOk,
+    inspectErrOfResult as inspectErr,
+    inspectBothOfResult as inspectBoth,
+} from './inspect';
 export { mapForResult as map } from './map';
 export { mapAsyncForResult as mapAsync } from './mapAsync';
 export { mapOrForResult as mapOr } from './mapOr';
@@ -46,7 +56,11 @@ export { orElseAsyncForResult as orElseAsync } from './orElseAsync';
 export { tapOk, tapErr, tapBoth } from './tap';
 export { transposeForResult as transpose } from './transpose';
 export { toOptionFromOk, toOptionFromErr } from './toOption';
-export { unwrapFromResult as unwrap, unwrapErrFromResult as unwrapErr } from './unwrap';
+export {
+    unwrapOkFromResult as unwrap,
+    unwrapOkFromResult as unwrapOk,
+    unwrapErrFromResult as unwrapErr,
+} from './unwrap';
 export { unwrapOrFromResult as unwrapOr } from './unwrapOr';
 export { unwrapOrElseFromResult as unwrapOrElse } from './unwrapOrElse';
 export { unwrapOrElseAsyncFromResult as unwrapOrElseAsync } from './unwrapOrElseAsync';
diff --git a/src/PlainResult/inspect.ts b/src/PlainResult/inspect.ts
index 5ff89882..80d6f657 100644
--- a/src/PlainResult/inspect.ts
+++ b/src/PlainResult/inspect.ts
@@ -11,8 +11,8 @@ function noop<T>(_v: T) {}
  *    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);
+export function inspectOkOfResult<T, E>(input: Result<T, E>, effector: EffectFn<T>): Result<T, E> {
+    return inspectBothOfResult(input, effector, noop);
 }
 
 /**
@@ -23,8 +23,8 @@ export function inspectOk<T, E>(input: Result<T, E>, effector: EffectFn<T>): Res
  *    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);
+export function inspectErrOfResult<T, E>(input: Result<T, E>, effector: EffectFn<E>): Result<T, E> {
+    return inspectBothOfResult(input, noop, effector);
 }
 
 /**
@@ -36,7 +36,7 @@ export function inspectErr<T, E>(input: Result<T, E>, effector: EffectFn<E>): Re
  *    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>(
+export function inspectBothOfResult<T, E>(
     input: Result<T, E>,
     okEffector: EffectFn<T>,
     errEffector: EffectFn<E>
@@ -48,3 +48,21 @@ export function inspectBoth<T, E>(
     }
     return input;
 }
+
+/**
+ *  @deprecated
+ *  Use {@link inspectOkOfResult}
+ */
+export const inspectOk: typeof inspectOkOfResult = inspectOkOfResult;
+
+/**
+ *  @deprecated
+ *  Use {@link inspectErrOfResult}
+ */
+export const inspectErr: typeof inspectErrOfResult = inspectErrOfResult;
+
+/**
+ *  @deprecated
+ *  Use {@link inspectBothOfResult}
+ */
+export const inspectBoth: typeof inspectBothOfResult = inspectBothOfResult;
diff --git a/src/PlainResult/mapAsync.ts b/src/PlainResult/mapAsync.ts
index e31d4fe0..3254f6c6 100644
--- a/src/PlainResult/mapAsync.ts
+++ b/src/PlainResult/mapAsync.ts
@@ -2,7 +2,7 @@ import { assertIsPromise } from '../internal/assert';
 import { ERR_MSG_TRANSFORMER_MUST_RETURN_PROMISE } from '../internal/ErrorMessage';
 import type { AsyncTransformFn } from '../internal/Function';
 import { Result, Err, createOk, isErr } from './Result';
-import { unwrapFromResult } from './unwrap';
+import { unwrapOkFromResult } from './unwrap';
 
 /**
  *  Maps a `Result<T, E>` to `Result<U, E>` by applying a _transformer_ function
@@ -19,7 +19,7 @@ export function mapAsyncForResult<T, U, E>(
         return Promise.resolve(s);
     }
 
-    const inner: T = unwrapFromResult(input);
+    const inner: T = unwrapOkFromResult(input);
     const result: Promise<U> = transformer(inner);
     // If this is async function, this always return Promise, but not.
     // We should check to clarify the error case if user call this function from plain js
diff --git a/src/PlainResult/mapOrAsync.ts b/src/PlainResult/mapOrAsync.ts
index 905efa45..fa7b98b3 100644
--- a/src/PlainResult/mapOrAsync.ts
+++ b/src/PlainResult/mapOrAsync.ts
@@ -2,7 +2,7 @@ import { assertIsPromise } from '../internal/assert';
 import { ERR_MSG_TRANSFORMER_MUST_RETURN_PROMISE } from '../internal/ErrorMessage';
 import type { AsyncTransformFn } from '../internal/Function';
 import { isErr, Result } from './Result';
-import { unwrapFromResult } from './unwrap';
+import { unwrapOkFromResult } from './unwrap';
 
 /**
  *  Return the result of _transformer_ with using _input_ as an argument for it if _input_ is `Ok(T)`.
@@ -20,7 +20,7 @@ export function mapOrAsyncForResult<T, E, U>(
         return result;
     }
 
-    const source: T = unwrapFromResult(input);
+    const source: T = unwrapOkFromResult(input);
     const result: Promise<U> = transformer(source);
     // If this is async function, this always return Promise, but not.
     // We should check to clarify the error case if user call this function from plain js
diff --git a/src/PlainResult/mapOrElseAsync.ts b/src/PlainResult/mapOrElseAsync.ts
index 4704b716..0d192d59 100644
--- a/src/PlainResult/mapOrElseAsync.ts
+++ b/src/PlainResult/mapOrElseAsync.ts
@@ -5,7 +5,7 @@ import {
 } from '../internal/ErrorMessage';
 import type { AsyncTransformFn, AsyncRecoveryFromErrorFn } from '../internal/Function';
 import { Result, isOk } from './Result';
-import { unwrapFromResult, unwrapErrFromResult } from './unwrap';
+import { unwrapOkFromResult, unwrapErrFromResult } from './unwrap';
 
 /**
  *  Maps a `Result<T, E>` to `U` by applying _transformer_ to a contained `Ok(T)` value in _input_,
@@ -18,7 +18,7 @@ export function mapOrElseAsyncForResult<T, E, U>(
     transformer: AsyncTransformFn<T, U>
 ): Promise<U> {
     if (isOk(input)) {
-        const inner: T = unwrapFromResult(input);
+        const inner: T = unwrapOkFromResult(input);
         const result: Promise<U> = transformer(inner);
         // If this is async function, this always return Promise, but not.
         // We should check to clarify the error case if user call this function from plain js
diff --git a/src/PlainResult/tap.ts b/src/PlainResult/tap.ts
index 7bf2e587..774d0b9b 100644
--- a/src/PlainResult/tap.ts
+++ b/src/PlainResult/tap.ts
@@ -1,22 +1,22 @@
-import { inspectBoth, inspectErr, inspectOk } from './inspect';
+import { inspectBothOfResult, inspectErrOfResult, inspectOkOfResult } from './inspect';
 
 /**
  *  @deprecated
  *  This will be removed in a future release.
- *  Use {@link inspectOk}
+ *  Use {@link inspectOkOfResult}
  */
-export const tapOk: typeof inspectOk = inspectOk;
+export const tapOk: typeof inspectOkOfResult = inspectOkOfResult;
 
 /**
  *  @deprecated
  *  This will be removed in a future release.
- *  Use {@link inspectErr}
+ *  Use {@link inspectErrOfResult}
  */
-export const tapErr: typeof inspectErr = inspectErr;
+export const tapErr: typeof inspectErrOfResult = inspectErrOfResult;
 
 /**
  *  @deprecated
  *  This will be removed in a future release.
- *  Use {@link inspectBoth}
+ *  Use {@link inspectBothOfResult}
  */
-export const tapBoth: typeof inspectBoth = inspectBoth;
+export const tapBoth: typeof inspectBothOfResult = inspectBothOfResult;
diff --git a/src/PlainResult/unwrap.ts b/src/PlainResult/unwrap.ts
index 3944025a..4add6dcd 100644
--- a/src/PlainResult/unwrap.ts
+++ b/src/PlainResult/unwrap.ts
@@ -1,4 +1,4 @@
-import { expectIsOk, expectIsErr } from './expect';
+import { expectOkForResult, expectErrForResult } from './expect';
 import { Result } from './Result';
 
 /**
@@ -7,10 +7,16 @@ import { Result } from './Result';
  *  @throws {TypeError}
  *      Throws if the self is a `Err`.
  */
-export function unwrapFromResult<T>(input: Result<T, unknown>): T | never {
-    return expectIsOk(input, 'called with `Err`');
+export function unwrapOkFromResult<T>(input: Result<T, unknown>): T | never {
+    return expectOkForResult(input, 'called with `Err`');
 }
 
+/**
+ *  @deprecated
+ *  Use {@link unwrapOkFromResult}
+ */
+export const unwrapFromResult: typeof unwrapOkFromResult = unwrapOkFromResult;
+
 /**
  *  Return the inner `E` of a `Err(E)`.
  *
@@ -18,5 +24,5 @@ export function unwrapFromResult<T>(input: Result<T, unknown>): T | never {
  *      Throws if the self is a `Ok`.
  */
 export function unwrapErrFromResult<E>(input: Result<unknown, E>): E | never {
-    return expectIsErr(input, 'called with `Ok`');
+    return expectErrForResult(input, 'called with `Ok`');
 }
diff --git a/src/PlainResult/unwrapOrElseAsync.ts b/src/PlainResult/unwrapOrElseAsync.ts
index 3d26c439..fe3f96cc 100644
--- a/src/PlainResult/unwrapOrElseAsync.ts
+++ b/src/PlainResult/unwrapOrElseAsync.ts
@@ -2,7 +2,7 @@ import { assertIsPromise } from '../internal/assert';
 import { ERR_MSG_RECOVERER_MUST_RETURN_PROMISE } from '../internal/ErrorMessage';
 import type { AsyncRecoveryFromErrorFn } from '../internal/Function';
 import { Result, isOk } from './Result';
-import { unwrapFromResult, unwrapErrFromResult } from './unwrap';
+import { unwrapOkFromResult, unwrapErrFromResult } from './unwrap';
 
 /**
  *  Unwraps _input_, returns the content of an `Ok(T)`.
@@ -13,7 +13,7 @@ export function unwrapOrElseAsyncFromResult<T, E>(
     recoverer: AsyncRecoveryFromErrorFn<E, T>
 ): Promise<T> {
     if (isOk(input)) {
-        const value = unwrapFromResult(input);
+        const value = unwrapOkFromResult(input);
         return Promise.resolve(value);
     }
 
diff --git a/tools/public_api/table.mjs b/tools/public_api/table.mjs
index bb7faf3a..d90938d2 100644
--- a/tools/public_api/table.mjs
+++ b/tools/public_api/table.mjs
@@ -460,6 +460,7 @@ export const apiTable = Object.freeze({
             'andThenAsync',
             'equal',
             'expect',
+            'expectOk',
             'expectIsOk',
             'expectErr',
             'expectIsErr',
@@ -485,6 +486,7 @@ export const apiTable = Object.freeze({
             'toOptionFromOk',
             'toOptionFromErr',
             'unwrap',
+            'unwrapOk',
             'unwrapErr',
             'unwrapOr',
             'unwrapOrElse',
@@ -526,6 +528,8 @@ export const apiTable = Object.freeze({
     },
     'PlainResult/expect': {
         'exports': [
+            'expectOkForResult',
+            'expectErrForResult',
             'expectIsOk',
             'expectIsErr',
         ]
@@ -537,6 +541,9 @@ export const apiTable = Object.freeze({
     },
     'PlainResult/inspect': {
         'exports': [
+            'inspectOkOfResult',
+            'inspectErrOfResult',
+            'inspectBothOfResult',
             'inspectOk',
             'inspectErr',
             'inspectBoth',
@@ -626,6 +633,7 @@ export const apiTable = Object.freeze({
     'PlainResult/unwrap': {
         'exports': [
             'unwrapFromResult',
+            'unwrapOkFromResult',
             'unwrapErrFromResult',
         ]
     },


Test patch:
diff --git a/__tests__/ClassResult/compat.test.mjs b/__tests__/ClassResult/compat.test.mjs
index 8702dac4..903f5522 100644
--- a/__tests__/ClassResult/compat.test.mjs
+++ b/__tests__/ClassResult/compat.test.mjs
@@ -1,7 +1,7 @@
 import test from 'ava';
 
 import { createOk, createErr, isOk, isErr } from '../../__dist/esm/PlainResult/Result.mjs';
-import { unwrapFromResult, unwrapErrFromResult } from '../../__dist/esm/PlainResult/unwrap.mjs';
+import { unwrapOkFromResult, unwrapErrFromResult } from '../../__dist/esm/PlainResult/unwrap.mjs';
 import {
     createOk as createClassicOk,
     createErr as createClassicErr,
@@ -33,7 +33,7 @@ test(`input is Classic's Ok`, (t) => {
     const actual = compatToPlainResult(input);
 
     t.true(isOk(actual), 'isOk');
-    t.is(unwrapFromResult(actual), expected, 'inner value');
+    t.is(unwrapOkFromResult(actual), expected, 'inner value');
 });
 
 test(`input is Classic's Err`, (t) => {
diff --git a/__tests__/PlainOption/ok_or.test.mjs b/__tests__/PlainOption/ok_or.test.mjs
index f6d3b977..5b77e248 100644
--- a/__tests__/PlainOption/ok_or.test.mjs
+++ b/__tests__/PlainOption/ok_or.test.mjs
@@ -2,7 +2,7 @@ import test from 'ava';
 
 import { createSome, createNone } from '../../__dist/esm/PlainOption/Option.mjs';
 import { okOrForPlainOption } from '../../__dist/esm/PlainOption/okOr.mjs';
-import { unwrapErrFromResult, unwrapFromResult } from '../../__dist/esm/PlainResult/unwrap.mjs';
+import { unwrapErrFromResult, unwrapOkFromResult } from '../../__dist/esm/PlainResult/unwrap.mjs';
 
 test('the input is Some', (t) => {
     const OK_VAL = Symbol('ok');
@@ -12,7 +12,7 @@ test('the input is Some', (t) => {
     const actual = okOrForPlainOption(input, ERR_VAL);
 
     t.true(actual.ok, 'the actual should be Ok');
-    t.is(unwrapFromResult(actual), OK_VAL, 'the actual should be wrap the expect');
+    t.is(unwrapOkFromResult(actual), OK_VAL, 'the actual should be wrap the expect');
 });
 
 test('the input is None', (t) => {
diff --git a/__tests__/PlainOption/ok_or_else.test.mjs b/__tests__/PlainOption/ok_or_else.test.mjs
index 6a4737fc..b3f9396b 100644
--- a/__tests__/PlainOption/ok_or_else.test.mjs
+++ b/__tests__/PlainOption/ok_or_else.test.mjs
@@ -2,7 +2,7 @@ import test from 'ava';
 
 import { createSome, createNone } from '../../__dist/esm/PlainOption/Option.mjs';
 import { okOrElseForPlainOption } from '../../__dist/esm/PlainOption/okOrElse.mjs';
-import { unwrapErrFromResult, unwrapFromResult } from '../../__dist/esm/PlainResult/unwrap.mjs';
+import { unwrapErrFromResult, unwrapOkFromResult } from '../../__dist/esm/PlainResult/unwrap.mjs';
 
 test('the input is Some', (t) => {
     t.plan(2);
@@ -17,7 +17,7 @@ test('the input is Some', (t) => {
     });
 
     t.true(actual.ok, 'the actual should be Ok');
-    t.is(unwrapFromResult(actual), OK_VAL, 'the actual should be wrap the expect');
+    t.is(unwrapOkFromResult(actual), OK_VAL, 'the actual should be wrap the expect');
 });
 
 test('the input is None', (t) => {
diff --git a/__tests__/PlainResult/equal.test.mjs b/__tests__/PlainResult/equal.test.mjs
index d9deb7d1..45ed0688 100644
--- a/__tests__/PlainResult/equal.test.mjs
+++ b/__tests__/PlainResult/equal.test.mjs
@@ -2,14 +2,14 @@ import test from 'ava';
 
 import { createOk, createErr, isOk, isErr } from '../../__dist/esm/PlainResult/Result.mjs';
 import { equalForResult } from '../../__dist/esm/PlainResult/equal.mjs';
-import { unwrapFromResult, unwrapErrFromResult } from '../../__dist/esm/PlainResult/unwrap.mjs';
+import { unwrapOkFromResult, unwrapErrFromResult } from '../../__dist/esm/PlainResult/unwrap.mjs';
 
 const INNER_VALUE_A = Symbol('A');
 const INNER_VALUE_B = Symbol('B');
 
 function toString(result) {
     if (isOk(result)) {
-        return `Ok<${String(unwrapFromResult(result))}>`;
+        return `Ok<${String(unwrapOkFromResult(result))}>`;
     } else if (isErr(result)) {
         return `Err<${String(unwrapErrFromResult(result))}>`;
     } else {
diff --git a/__tests__/PlainResult/expect/test_expect_err.test.mjs b/__tests__/PlainResult/expect/test_expect_err.test.mjs
index 6a667be5..50de79a3 100644
--- a/__tests__/PlainResult/expect/test_expect_err.test.mjs
+++ b/__tests__/PlainResult/expect/test_expect_err.test.mjs
@@ -1,7 +1,7 @@
 import test from 'ava';
 
 import { createOk, createErr } from '../../../__dist/esm/PlainResult/Result.mjs';
-import { expectIsErr } from '../../../__dist/esm/PlainResult/expect.mjs';
+import { expectErrForResult } from '../../../__dist/esm/PlainResult/expect.mjs';
 
 test('input=Ok(T), expect=Err(E)', (t) => {
     const NOT_EXPECTED = Symbol('not expected');
@@ -11,7 +11,7 @@ test('input=Ok(T), expect=Err(E)', (t) => {
     const MSG = 'throw if the input is not expected';
     t.throws(
         () => {
-            expectIsErr(input, MSG);
+            expectErrForResult(input, MSG);
         },
         {
             instanceOf: TypeError,
@@ -27,7 +27,7 @@ test('input=Err(E), expect=Err(E)', (t) => {
 
     let actual;
     t.notThrows(() => {
-        actual = expectIsErr(input, 'do not throw any errors');
+        actual = expectErrForResult(input, 'do not throw any errors');
     });
 
     t.is(actual, EXPECTED);
diff --git a/__tests__/PlainResult/expect/test_expect_ok.test.mjs b/__tests__/PlainResult/expect/test_expect_ok.test.mjs
index 1ae5414d..a7d79e98 100644
--- a/__tests__/PlainResult/expect/test_expect_ok.test.mjs
+++ b/__tests__/PlainResult/expect/test_expect_ok.test.mjs
@@ -1,7 +1,7 @@
 import test from 'ava';
 
 import { createOk, createErr } from '../../../__dist/esm/PlainResult/Result.mjs';
-import { expectIsOk } from '../../../__dist/esm/PlainResult/expect.mjs';
+import { expectOkForResult } from '../../../__dist/esm/PlainResult/expect.mjs';
 
 test('input=Ok(T), expect=Ok(T)', (t) => {
     const EXPECTED = Symbol('expected');
@@ -10,7 +10,7 @@ test('input=Ok(T), expect=Ok(T)', (t) => {
 
     let actual;
     t.notThrows(() => {
-        actual = expectIsOk(input, 'do not throw any errors');
+        actual = expectOkForResult(input, 'do not throw any errors');
     });
 
     t.is(actual, EXPECTED);
@@ -24,7 +24,7 @@ test('input=Err(E), expect=Ok(T)', (t) => {
     const MSG = 'throw if the input is not expected';
     t.throws(
         () => {
-            expectIsOk(input, MSG);
+            expectOkForResult(input, MSG);
         },
         {
             instanceOf: TypeError,
diff --git a/__tests__/PlainResult/inspect/test_inspect_both.test.mjs b/__tests__/PlainResult/inspect/test_inspect_both.test.mjs
index 4e984bdd..43b79e00 100644
--- a/__tests__/PlainResult/inspect/test_inspect_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 { inspectBoth } from '../../../__dist/esm/PlainResult/inspect.mjs';
+import { inspectBothOfResult } 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 = inspectBoth(
+    const actual = inspectBothOfResult(
         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 = inspectBoth(
+    const actual = inspectBothOfResult(
         input,
         (_v) => {
             t.fail('should not call this path');
diff --git a/__tests__/PlainResult/inspect/test_inspect_err.test.mjs b/__tests__/PlainResult/inspect/test_inspect_err.test.mjs
index 6de8aca6..0ccd3579 100644
--- a/__tests__/PlainResult/inspect/test_inspect_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 { inspectErr } from '../../../__dist/esm/PlainResult/inspect.mjs';
+import { inspectErrOfResult } 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 = inspectErr(input, (_v) => {
+    const actual = inspectErrOfResult(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 = inspectErr(input, (v) => {
+    const actual = inspectErrOfResult(input, (v) => {
         t.pass('should call the tap fn');
         t.is(v, INPUT_INNER, 'should be the expected arg');
     });
diff --git a/__tests__/PlainResult/inspect/test_inspect_ok.test.mjs b/__tests__/PlainResult/inspect/test_inspect_ok.test.mjs
index f7bbea50..f835b464 100644
--- a/__tests__/PlainResult/inspect/test_inspect_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 { inspectOk } from '../../../__dist/esm/PlainResult/inspect.mjs';
+import { inspectOkOfResult } 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 = inspectOk(input, (v) => {
+    const actual = inspectOkOfResult(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 = inspectOk(input, (_v) => {
+    const actual = inspectOkOfResult(input, (_v) => {
         t.pass('should not call the tap fn');
     });
 
diff --git a/__tests__/PlainResult/unwrap/unwrap_ok.test.mjs b/__tests__/PlainResult/unwrap/unwrap_ok.test.mjs
index b6330a1b..49c6049c 100644
--- a/__tests__/PlainResult/unwrap/unwrap_ok.test.mjs
+++ b/__tests__/PlainResult/unwrap/unwrap_ok.test.mjs
@@ -1,21 +1,21 @@
 import test from 'ava';
 
 import { createOk, createErr } from '../../../__dist/esm/PlainResult/Result.mjs';
-import { unwrapFromResult } from '../../../__dist/esm/PlainResult/unwrap.mjs';
+import { unwrapOkFromResult } from '../../../__dist/esm/PlainResult/unwrap.mjs';
 
 const EXPECTED_OK = Symbol('expected_ok');
 const EXPECTED_ERR = Symbol('expected_err');
 
 test('Ok', (t) => {
     const input = createOk(EXPECTED_OK);
-    t.is(unwrapFromResult(input), EXPECTED_OK);
+    t.is(unwrapOkFromResult(input), EXPECTED_OK);
 });
 
 test('Err', (t) => {
     t.throws(
         () => {
             const input = createErr(EXPECTED_ERR);
-            unwrapFromResult(input);
+            unwrapOkFromResult(input);
         },
         {
             instanceOf: TypeError,