Repository: dubzzz/fast-check
Pull request #1716 (2021-04-09 18:56:56)

🚚 Move array arbitraries into /arbitrary
<!-- Why is this PR for? -->
<!-- Describe the reason why you opened this PR or give a link towards the associated issue. -->

## In a nutshell

❌ New feature
❌ Fix an issue
❌ Documentation improvement
✔️ Other: *please explain*

(✔️: yes, ❌: no)

## Potential impacts

No impact is expected as IDE fail to import the right paths with auto-imports different from root.
Non-root import changed for array, set


codesandbox[bot]: This pull request is automatically built and testable in [CodeSandbox](https://codesandbox.io).

  To see build info of the built libraries, click [here](https://ci.codesandbox.io/status/dubzzz/fast-check/pr/1716/builds/118113) or the icon next to each commit SHA.

Latest deployment of this branch, based on commit a98bc6a9ea641a26fbe99a6204b4ae0a0c54b1c1:

|Sandbox| Source |
|--|--|
|[Vanilla](https://codesandbox.io/s/vanilla-p3998)| Configuration |
|[fast-check-examples](https://codesandbox.io/s/fast-check-examples-vfeff)| Configuration |

codecov[bot]: # [Codecov](https://codecov.io/gh/dubzzz/fast-check/pull/1716?src=pr&el=h1) Report
> Merging [#1716](https://codecov.io/gh/dubzzz/fast-check/pull/1716?src=pr&el=desc) (a98bc6a) into [main](https://codecov.io/gh/dubzzz/fast-check/commit/65554729d766260c45aa4f812cbe09d7adc29f5f?el=desc) (6555472) will **increase** coverage by `0.00%`.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/dubzzz/fast-check/pull/1716/graphs/tree.svg?width=650&height=150&src=pr&token=fRi2fJN730)](https://codecov.io/gh/dubzzz/fast-check/pull/1716?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##             main    #1716   +/-   ##
=======================================
  Coverage   96.50%   96.51%           
=======================================
  Files         106      108    +2     
  Lines        3580     3585    +5     
  Branches      710      710           
=======================================
+ Hits         3455     3460    +5     
  Misses        121      121           
  Partials        4        4           
```

| Flag | Coverage Δ | |
|---|---|---|
| unit-tests | `96.51% <100.00%> (+<0.01%)` | :arrow_up: |
| unit-tests-10.x-Linux | `?` | |
| unit-tests-12.x-Linux | `?` | |
| unit-tests-14.x-Linux | `96.51% <100.00%> (+<0.01%)` | :arrow_up: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Impacted Files](https://codecov.io/gh/dubzzz/fast-check/pull/1716?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...arbitrary/\_internals/helpers/BuildCompareFilter.ts](https://codecov.io/gh/dubzzz/fast-check/pull/1716/diff?src=pr&el=tree#diff-c3JjL2FyYml0cmFyeS9faW50ZXJuYWxzL2hlbHBlcnMvQnVpbGRDb21wYXJlRmlsdGVyLnRz) | `100.00% <ø> (ø)` | |
| [src/arbitrary/\_internals/ArrayArbitrary.ts](https://codecov.io/gh/dubzzz/fast-check/pull/1716/diff?src=pr&el=tree#diff-c3JjL2FyYml0cmFyeS9faW50ZXJuYWxzL0FycmF5QXJiaXRyYXJ5LnRz) | `84.15% <100.00%> (ø)` | |
| [...trary/\_internals/helpers/MaxLengthFromMinLength.ts](https://codecov.io/gh/dubzzz/fast-check/pull/1716/diff?src=pr&el=tree#diff-c3JjL2FyYml0cmFyeS9faW50ZXJuYWxzL2hlbHBlcnMvTWF4TGVuZ3RoRnJvbU1pbkxlbmd0aC50cw==) | `100.00% <100.00%> (ø)` | |
| [src/arbitrary/array.ts](https://codecov.io/gh/dubzzz/fast-check/pull/1716/diff?src=pr&el=tree#diff-c3JjL2FyYml0cmFyeS9hcnJheS50cw==) | `100.00% <100.00%> (ø)` | |
| [src/arbitrary/set.ts](https://codecov.io/gh/dubzzz/fast-check/pull/1716/diff?src=pr&el=tree#diff-c3JjL2FyYml0cmFyeS9zZXQudHM=) | `100.00% <100.00%> (ø)` | |
| [src/check/arbitrary/DictionaryArbitrary.ts](https://codecov.io/gh/dubzzz/fast-check/pull/1716/diff?src=pr&el=tree#diff-c3JjL2NoZWNrL2FyYml0cmFyeS9EaWN0aW9uYXJ5QXJiaXRyYXJ5LnRz) | `100.00% <100.00%> (ø)` | |
| [src/check/arbitrary/EmailArbitrary.ts](https://codecov.io/gh/dubzzz/fast-check/pull/1716/diff?src=pr&el=tree#diff-c3JjL2NoZWNrL2FyYml0cmFyeS9FbWFpbEFyYml0cmFyeS50cw==) | `100.00% <100.00%> (ø)` | |
| [src/check/arbitrary/FunctionArbitrary.ts](https://codecov.io/gh/dubzzz/fast-check/pull/1716/diff?src=pr&el=tree#diff-c3JjL2NoZWNrL2FyYml0cmFyeS9GdW5jdGlvbkFyYml0cmFyeS50cw==) | `100.00% <100.00%> (ø)` | |
| [src/check/arbitrary/HostArbitrary.ts](https://codecov.io/gh/dubzzz/fast-check/pull/1716/diff?src=pr&el=tree#diff-c3JjL2NoZWNrL2FyYml0cmFyeS9Ib3N0QXJiaXRyYXJ5LnRz) | `100.00% <100.00%> (ø)` | |
| [src/check/arbitrary/IpArbitrary.ts](https://codecov.io/gh/dubzzz/fast-check/pull/1716/diff?src=pr&el=tree#diff-c3JjL2NoZWNrL2FyYml0cmFyeS9JcEFyYml0cmFyeS50cw==) | `100.00% <100.00%> (ø)` | |
| ... and [9 more](https://codecov.io/gh/dubzzz/fast-check/pull/1716/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/dubzzz/fast-check/pull/1716?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/dubzzz/fast-check/pull/1716?src=pr&el=footer). Last update [6555472...a98bc6a](https://codecov.io/gh/dubzzz/fast-check/pull/1716?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/src/check/arbitrary/ArrayArbitrary.ts b/src/arbitrary/_internals/ArrayArbitrary.ts
similarity index 70%
rename from src/check/arbitrary/ArrayArbitrary.ts
rename to src/arbitrary/_internals/ArrayArbitrary.ts
index 0378e485..58e51b46 100644
--- a/src/check/arbitrary/ArrayArbitrary.ts
+++ b/src/arbitrary/_internals/ArrayArbitrary.ts
@@ -1,13 +1,12 @@
 import { Random } from '../../random/generator/Random';
 import { Stream } from '../../stream/Stream';
-import { cloneIfNeeded, cloneMethod } from '../symbols';
-import { Arbitrary } from './definition/Arbitrary';
-import { integer } from '../../arbitrary/integer';
+import { cloneIfNeeded, cloneMethod } from '../../check/symbols';
+import { integer } from '../integer';
 import { makeLazy } from '../../stream/LazyIterableIterator';
 import { buildCompareFilter } from './helpers/BuildCompareFilter';
-import { NextArbitrary } from './definition/NextArbitrary';
-import { convertFromNext, convertToNext } from './definition/Converters';
-import { NextValue } from './definition/NextValue';
+import { NextArbitrary } from '../../check/arbitrary/definition/NextArbitrary';
+import { convertToNext } from '../../check/arbitrary/definition/Converters';
+import { NextValue } from '../../check/arbitrary/definition/NextValue';
 
 /** @internal */
 type ArrayArbitraryContext = {
@@ -216,94 +215,3 @@ export class ArrayArbitrary<T> extends NextArbitrary<T[]> {
     );
   }
 }
-
-/**
- * Compute `maxLength` based on `minLength`
- * @internal
- */
-export function maxLengthFromMinLength(minLength: number): number {
-  return 2 * minLength + 10;
-}
-
-/**
- * Constraints to be applied on {@link array}
- * @remarks Since 2.4.0
- * @public
- */
-export interface ArrayConstraints {
-  /**
-   * Lower bound of the generated array size
-   * @remarks Since 2.4.0
-   */
-  minLength?: number;
-  /**
-   * Upper bound of the generated array size
-   * @remarks Since 2.4.0
-   */
-  maxLength?: number;
-}
-
-/**
- * For arrays of values coming from `arb`
- * @param arb - Arbitrary used to generate the values inside the array
- * @remarks Since 0.0.1
- * @public
- */
-function array<T>(arb: Arbitrary<T>): Arbitrary<T[]>;
-/**
- * For arrays of values coming from `arb` having an upper bound size
- *
- * @param arb - Arbitrary used to generate the values inside the array
- * @param maxLength - Upper bound of the generated array size
- *
- * @deprecated
- * Superceded by `fc.array(arb, {maxLength})` - see {@link https://github.com/dubzzz/fast-check/issues/992 | #992}.
- * Ease the migration with {@link https://github.com/dubzzz/fast-check/tree/main/codemods/unify-signatures | our codemod script}.
- *
- * @remarks Since 0.0.1
- * @public
- */
-function array<T>(arb: Arbitrary<T>, maxLength: number): Arbitrary<T[]>;
-/**
- * For arrays of values coming from `arb` having lower and upper bound size
- *
- * @param arb - Arbitrary used to generate the values inside the array
- * @param minLength - Lower bound of the generated array size
- * @param maxLength - Upper bound of the generated array size
- *
- * @deprecated
- * Superceded by `fc.array(arb, {minLength, maxLength})` - see {@link https://github.com/dubzzz/fast-check/issues/992 | #992}.
- * Ease the migration with {@link https://github.com/dubzzz/fast-check/tree/main/codemods/unify-signatures | our codemod script}.
- *
- * @remarks Since 0.0.7
- * @public
- */
-function array<T>(arb: Arbitrary<T>, minLength: number, maxLength: number): Arbitrary<T[]>;
-/**
- * For arrays of values coming from `arb` having lower and upper bound size
- *
- * @param arb - Arbitrary used to generate the values inside the array
- * @param constraints - Constraints to apply when building instances
- *
- * @remarks Since 2.4.0
- * @public
- */
-function array<T>(arb: Arbitrary<T>, constraints: ArrayConstraints): Arbitrary<T[]>;
-function array<T>(arb: Arbitrary<T>, ...args: [] | [number] | [number, number] | [ArrayConstraints]): Arbitrary<T[]> {
-  const nextArb = convertToNext(arb);
-  // fc.array(arb)
-  if (args[0] === undefined) return convertFromNext(new ArrayArbitrary<T>(nextArb, 0, maxLengthFromMinLength(0)));
-  // fc.array(arb, constraints)
-  if (typeof args[0] === 'object') {
-    const minLength = args[0].minLength || 0;
-    const specifiedMaxLength = args[0].maxLength;
-    const maxLength = specifiedMaxLength !== undefined ? specifiedMaxLength : maxLengthFromMinLength(minLength);
-    return convertFromNext(new ArrayArbitrary<T>(nextArb, minLength, maxLength));
-  }
-  // fc.array(arb, minLength, maxLength)
-  if (args[1] !== undefined) return convertFromNext(new ArrayArbitrary<T>(nextArb, args[0], args[1]));
-  // fc.array(arb, maxLength)
-  return convertFromNext(new ArrayArbitrary<T>(nextArb, 0, args[0]));
-}
-
-export { array };
diff --git a/src/check/arbitrary/helpers/BuildCompareFilter.ts b/src/arbitrary/_internals/helpers/BuildCompareFilter.ts
similarity index 93%
rename from src/check/arbitrary/helpers/BuildCompareFilter.ts
rename to src/arbitrary/_internals/helpers/BuildCompareFilter.ts
index 6760f58c..84ee521f 100644
--- a/src/check/arbitrary/helpers/BuildCompareFilter.ts
+++ b/src/arbitrary/_internals/helpers/BuildCompareFilter.ts
@@ -1,4 +1,4 @@
-import { NextValue } from '../definition/NextValue';
+import { NextValue } from '../../../check/arbitrary/definition/NextValue';
 
 /** @internal */
 function subArrayContains<T>(tab: T[], upperBound: number, includeValue: (v: T) => boolean): boolean {
diff --git a/src/arbitrary/_internals/helpers/MaxLengthFromMinLength.ts b/src/arbitrary/_internals/helpers/MaxLengthFromMinLength.ts
new file mode 100644
index 00000000..ff3226a4
--- /dev/null
+++ b/src/arbitrary/_internals/helpers/MaxLengthFromMinLength.ts
@@ -0,0 +1,7 @@
+/**
+ * Compute `maxLength` based on `minLength`
+ * @internal
+ */
+export function maxLengthFromMinLength(minLength: number): number {
+  return 2 * minLength + 10;
+}
diff --git a/src/arbitrary/array.ts b/src/arbitrary/array.ts
new file mode 100644
index 00000000..7c2c97a1
--- /dev/null
+++ b/src/arbitrary/array.ts
@@ -0,0 +1,86 @@
+import { Arbitrary } from '../check/arbitrary/definition/Arbitrary';
+import { convertFromNext, convertToNext } from '../check/arbitrary/definition/Converters';
+import { ArrayArbitrary } from './_internals/ArrayArbitrary';
+import { maxLengthFromMinLength } from './_internals/helpers/MaxLengthFromMinLength';
+
+/**
+ * Constraints to be applied on {@link array}
+ * @remarks Since 2.4.0
+ * @public
+ */
+export interface ArrayConstraints {
+  /**
+   * Lower bound of the generated array size
+   * @remarks Since 2.4.0
+   */
+  minLength?: number;
+  /**
+   * Upper bound of the generated array size
+   * @remarks Since 2.4.0
+   */
+  maxLength?: number;
+}
+
+/**
+ * For arrays of values coming from `arb`
+ * @param arb - Arbitrary used to generate the values inside the array
+ * @remarks Since 0.0.1
+ * @public
+ */
+function array<T>(arb: Arbitrary<T>): Arbitrary<T[]>;
+/**
+ * For arrays of values coming from `arb` having an upper bound size
+ *
+ * @param arb - Arbitrary used to generate the values inside the array
+ * @param maxLength - Upper bound of the generated array size
+ *
+ * @deprecated
+ * Superceded by `fc.array(arb, {maxLength})` - see {@link https://github.com/dubzzz/fast-check/issues/992 | #992}.
+ * Ease the migration with {@link https://github.com/dubzzz/fast-check/tree/main/codemods/unify-signatures | our codemod script}.
+ *
+ * @remarks Since 0.0.1
+ * @public
+ */
+function array<T>(arb: Arbitrary<T>, maxLength: number): Arbitrary<T[]>;
+/**
+ * For arrays of values coming from `arb` having lower and upper bound size
+ *
+ * @param arb - Arbitrary used to generate the values inside the array
+ * @param minLength - Lower bound of the generated array size
+ * @param maxLength - Upper bound of the generated array size
+ *
+ * @deprecated
+ * Superceded by `fc.array(arb, {minLength, maxLength})` - see {@link https://github.com/dubzzz/fast-check/issues/992 | #992}.
+ * Ease the migration with {@link https://github.com/dubzzz/fast-check/tree/main/codemods/unify-signatures | our codemod script}.
+ *
+ * @remarks Since 0.0.7
+ * @public
+ */
+function array<T>(arb: Arbitrary<T>, minLength: number, maxLength: number): Arbitrary<T[]>;
+/**
+ * For arrays of values coming from `arb` having lower and upper bound size
+ *
+ * @param arb - Arbitrary used to generate the values inside the array
+ * @param constraints - Constraints to apply when building instances
+ *
+ * @remarks Since 2.4.0
+ * @public
+ */
+function array<T>(arb: Arbitrary<T>, constraints: ArrayConstraints): Arbitrary<T[]>;
+function array<T>(arb: Arbitrary<T>, ...args: [] | [number] | [number, number] | [ArrayConstraints]): Arbitrary<T[]> {
+  const nextArb = convertToNext(arb);
+  // fc.array(arb)
+  if (args[0] === undefined) return convertFromNext(new ArrayArbitrary<T>(nextArb, 0, maxLengthFromMinLength(0)));
+  // fc.array(arb, constraints)
+  if (typeof args[0] === 'object') {
+    const minLength = args[0].minLength || 0;
+    const specifiedMaxLength = args[0].maxLength;
+    const maxLength = specifiedMaxLength !== undefined ? specifiedMaxLength : maxLengthFromMinLength(minLength);
+    return convertFromNext(new ArrayArbitrary<T>(nextArb, minLength, maxLength));
+  }
+  // fc.array(arb, minLength, maxLength)
+  if (args[1] !== undefined) return convertFromNext(new ArrayArbitrary<T>(nextArb, args[0], args[1]));
+  // fc.array(arb, maxLength)
+  return convertFromNext(new ArrayArbitrary<T>(nextArb, 0, args[0]));
+}
+export { array };
diff --git a/src/check/arbitrary/SetArbitrary.ts b/src/arbitrary/set.ts
similarity index 95%
rename from src/check/arbitrary/SetArbitrary.ts
rename to src/arbitrary/set.ts
index eead573a..536577a1 100644
--- a/src/check/arbitrary/SetArbitrary.ts
+++ b/src/arbitrary/set.ts
@@ -1,6 +1,7 @@
-import { ArrayArbitrary, maxLengthFromMinLength } from './ArrayArbitrary';
-import { Arbitrary } from './definition/Arbitrary';
-import { convertFromNext, convertToNext } from './definition/Converters';
+import { ArrayArbitrary } from './_internals/ArrayArbitrary';
+import { Arbitrary } from '../check/arbitrary/definition/Arbitrary';
+import { convertFromNext, convertToNext } from '../check/arbitrary/definition/Converters';
+import { maxLengthFromMinLength } from './_internals/helpers/MaxLengthFromMinLength';
 
 /**
  * Build fully set SetConstraints from a partial data
@@ -192,5 +193,4 @@ function set<T>(
   if (minLength === 0) return arrayArb;
   return arrayArb.filter((tab) => tab.length >= minLength);
 }
-
 export { set };
diff --git a/src/check/arbitrary/DictionaryArbitrary.ts b/src/check/arbitrary/DictionaryArbitrary.ts
index 3c3eb6f5..22a955f0 100644
--- a/src/check/arbitrary/DictionaryArbitrary.ts
+++ b/src/check/arbitrary/DictionaryArbitrary.ts
@@ -1,6 +1,6 @@
 import { Arbitrary } from './definition/Arbitrary';
 
-import { set } from './SetArbitrary';
+import { set } from '../../arbitrary/set';
 import { tuple } from './TupleArbitrary';
 
 /** @internal */
diff --git a/src/check/arbitrary/EmailArbitrary.ts b/src/check/arbitrary/EmailArbitrary.ts
index 3b7a4048..4573e022 100644
--- a/src/check/arbitrary/EmailArbitrary.ts
+++ b/src/check/arbitrary/EmailArbitrary.ts
@@ -1,4 +1,4 @@
-import { array } from './ArrayArbitrary';
+import { array } from '../../arbitrary/array';
 import { buildLowerAlphaNumericArb } from './helpers/SpecificCharacterRange';
 import { domain } from './HostArbitrary';
 import { stringOf } from './StringArbitrary';
diff --git a/src/check/arbitrary/FunctionArbitrary.ts b/src/check/arbitrary/FunctionArbitrary.ts
index daec9071..97b30a9c 100644
--- a/src/check/arbitrary/FunctionArbitrary.ts
+++ b/src/check/arbitrary/FunctionArbitrary.ts
@@ -1,7 +1,7 @@
 import { hash } from '../../utils/hash';
 import { stringify } from '../../utils/stringify';
 import { cloneMethod, hasCloneMethod } from '../symbols';
-import { array } from './ArrayArbitrary';
+import { array } from '../../arbitrary/array';
 import { Arbitrary } from './definition/Arbitrary';
 import { integer } from '../../arbitrary/integer';
 import { tuple } from './TupleArbitrary';
diff --git a/src/check/arbitrary/HostArbitrary.ts b/src/check/arbitrary/HostArbitrary.ts
index c95a0ba0..1223abb7 100644
--- a/src/check/arbitrary/HostArbitrary.ts
+++ b/src/check/arbitrary/HostArbitrary.ts
@@ -1,4 +1,4 @@
-import { array } from './ArrayArbitrary';
+import { array } from '../../arbitrary/array';
 import {
   buildAlphaNumericPercentArb,
   buildLowerAlphaArb,
diff --git a/src/check/arbitrary/IpArbitrary.ts b/src/check/arbitrary/IpArbitrary.ts
index 150e05b4..594772fa 100644
--- a/src/check/arbitrary/IpArbitrary.ts
+++ b/src/check/arbitrary/IpArbitrary.ts
@@ -1,4 +1,4 @@
-import { array } from './ArrayArbitrary';
+import { array } from '../../arbitrary/array';
 import { constantFrom } from './ConstantArbitrary';
 import { Arbitrary } from './definition/Arbitrary';
 import { nat } from '../../arbitrary/nat';
diff --git a/src/check/arbitrary/LoremArbitrary.ts b/src/check/arbitrary/LoremArbitrary.ts
index 006296ca..57e05e71 100644
--- a/src/check/arbitrary/LoremArbitrary.ts
+++ b/src/check/arbitrary/LoremArbitrary.ts
@@ -1,4 +1,4 @@
-import { array } from './ArrayArbitrary';
+import { array } from '../../arbitrary/array';
 import { constant } from './ConstantArbitrary';
 import { Arbitrary } from './definition/Arbitrary';
 import { frequency } from './FrequencyArbitrary';
diff --git a/src/check/arbitrary/ObjectArbitrary.ts b/src/check/arbitrary/ObjectArbitrary.ts
index 2a0ac5e7..ee1dd279 100644
--- a/src/check/arbitrary/ObjectArbitrary.ts
+++ b/src/check/arbitrary/ObjectArbitrary.ts
@@ -1,7 +1,7 @@
 import { Arbitrary } from './definition/Arbitrary';
 
 import { stringify } from '../../utils/stringify';
-import { array } from './ArrayArbitrary';
+import { array } from '../../arbitrary/array';
 import { boolean } from './BooleanArbitrary';
 import { constant } from './ConstantArbitrary';
 import { dictionary, toObject } from './DictionaryArbitrary';
@@ -10,7 +10,7 @@ import { frequency } from './FrequencyArbitrary';
 import { maxSafeInteger } from '../../arbitrary/maxSafeInteger';
 import { memo, Memo } from './MemoArbitrary';
 import { oneof } from './OneOfArbitrary';
-import { set } from './SetArbitrary';
+import { set } from '../../arbitrary/set';
 import { string, unicodeString } from './StringArbitrary';
 import { tuple } from './TupleArbitrary';
 import { bigInt } from '../../arbitrary/bigInt';
diff --git a/src/check/arbitrary/SparseArrayArbitrary.ts b/src/check/arbitrary/SparseArrayArbitrary.ts
index 92295249..2f078cf2 100644
--- a/src/check/arbitrary/SparseArrayArbitrary.ts
+++ b/src/check/arbitrary/SparseArrayArbitrary.ts
@@ -1,8 +1,8 @@
-import { maxLengthFromMinLength } from './ArrayArbitrary';
 import { Arbitrary } from './definition/Arbitrary';
 import { nat } from '../../arbitrary/nat';
-import { set } from './SetArbitrary';
+import { set } from '../../arbitrary/set';
 import { tuple } from './TupleArbitrary';
+import { maxLengthFromMinLength } from '../../arbitrary/_internals/helpers/MaxLengthFromMinLength';
 
 /**
  * Constraints to be applied on {@link sparseArray}
diff --git a/src/check/arbitrary/StringArbitrary.ts b/src/check/arbitrary/StringArbitrary.ts
index e425c635..bd484050 100644
--- a/src/check/arbitrary/StringArbitrary.ts
+++ b/src/check/arbitrary/StringArbitrary.ts
@@ -1,4 +1,5 @@
-import { array, maxLengthFromMinLength } from './ArrayArbitrary';
+import { array } from '../../arbitrary/array';
+import { maxLengthFromMinLength } from '../../arbitrary/_internals/helpers/MaxLengthFromMinLength';
 import { ascii, base64, char, char16bits, fullUnicode, hexa, unicode } from './CharacterArbitrary';
 import { Arbitrary } from './definition/Arbitrary';
 
diff --git a/src/check/arbitrary/TypedArrayArbitrary.ts b/src/check/arbitrary/TypedArrayArbitrary.ts
index 765a67ab..60cf1696 100644
--- a/src/check/arbitrary/TypedArrayArbitrary.ts
+++ b/src/check/arbitrary/TypedArrayArbitrary.ts
@@ -1,4 +1,4 @@
-import { array } from './ArrayArbitrary';
+import { array } from '../../arbitrary/array';
 import { Arbitrary } from './definition/Arbitrary';
 import { DoubleNextConstraints } from './DoubleNextArbitrary';
 import { double, float } from './FloatingPointArbitrary';
diff --git a/src/check/arbitrary/WebArbitrary.ts b/src/check/arbitrary/WebArbitrary.ts
index c0c82547..cf2ffa4f 100644
--- a/src/check/arbitrary/WebArbitrary.ts
+++ b/src/check/arbitrary/WebArbitrary.ts
@@ -1,4 +1,4 @@
-import { array } from './ArrayArbitrary';
+import { array } from '../../arbitrary/array';
 import { constantFrom } from './ConstantArbitrary';
 import { constant } from './ConstantArbitrary';
 import { buildAlphaNumericPercentArb } from './helpers/SpecificCharacterRange';
diff --git a/src/fast-check-default.ts b/src/fast-check-default.ts
index 2161ed77..1234934c 100644
--- a/src/fast-check-default.ts
+++ b/src/fast-check-default.ts
@@ -19,7 +19,7 @@ import {
 import { assert, check } from './check/runner/Runner';
 import { sample, statistics } from './check/runner/Sampler';
 
-import { array, ArrayConstraints } from './check/arbitrary/ArrayArbitrary';
+import { array, ArrayConstraints } from './arbitrary/array';
 import { bigInt, BigIntConstraints } from './arbitrary/bigInt';
 import { bigIntN } from './arbitrary/bigIntN';
 import { bigUint, BigUintConstraints } from './arbitrary/bigUint';
@@ -68,7 +68,7 @@ import {
 import { oneof, OneOfValue, OneOfConstraints } from './check/arbitrary/OneOfArbitrary';
 import { option, OptionConstraints } from './check/arbitrary/OptionArbitrary';
 import { record, RecordConstraints, RecordValue } from './check/arbitrary/RecordArbitrary';
-import { set, SetConstraints } from './check/arbitrary/SetArbitrary';
+import { set, SetConstraints } from './arbitrary/set';
 import { infiniteStream } from './check/arbitrary/StreamArbitrary';
 import {
   asciiString,


Test patch:
diff --git a/test/unit/check/arbitrary/helpers/BuildCompareFilter.utest.spec.ts b/test/unit/arbitrary/_internals/helpers/BuildCompareFilter.spec.ts
similarity index 88%
rename from test/unit/check/arbitrary/helpers/BuildCompareFilter.utest.spec.ts
rename to test/unit/arbitrary/_internals/helpers/BuildCompareFilter.spec.ts
index 1de48d90..7031b36c 100644
--- a/test/unit/check/arbitrary/helpers/BuildCompareFilter.utest.spec.ts
+++ b/test/unit/arbitrary/_internals/helpers/BuildCompareFilter.spec.ts
@@ -1,8 +1,7 @@
 import * as fc from '../../../../../lib/fast-check';
+import { buildCompareFilter } from '../../../../../src/arbitrary/_internals/helpers/BuildCompareFilter';
 import { NextValue } from '../../../../../src/check/arbitrary/definition/NextValue';
 
-import { buildCompareFilter } from '../../../../../src/check/arbitrary/helpers/BuildCompareFilter';
-
 describe('buildCompareFilter', () => {
   it('should filter array from duplicated values', () =>
     fc.assert(
diff --git a/test/unit/check/arbitrary/ArrayArbitrary.spec.ts b/test/unit/check/arbitrary/ArrayArbitrary.spec.ts
index a59b13a0..f2bf9243 100644
--- a/test/unit/check/arbitrary/ArrayArbitrary.spec.ts
+++ b/test/unit/check/arbitrary/ArrayArbitrary.spec.ts
@@ -2,7 +2,7 @@ import * as fc from '../../../../lib/fast-check';
 
 import { Arbitrary } from '../../../../src/check/arbitrary/definition/Arbitrary';
 import { Shrinkable } from '../../../../src/check/arbitrary/definition/Shrinkable';
-import { array } from '../../../../src/check/arbitrary/ArrayArbitrary';
+import { array } from '../../../../src/arbitrary/array';
 import { context } from '../../../../src/check/arbitrary/ContextArbitrary';
 import { nat } from '../../../../src/arbitrary/nat';
 import { Random } from '../../../../src/random/generator/Random';
diff --git a/test/unit/check/arbitrary/SetArbitrary.spec.ts b/test/unit/check/arbitrary/SetArbitrary.spec.ts
index 1ade3ea2..0e6e8814 100644
--- a/test/unit/check/arbitrary/SetArbitrary.spec.ts
+++ b/test/unit/check/arbitrary/SetArbitrary.spec.ts
@@ -1,6 +1,6 @@
 import * as fc from '../../../../lib/fast-check';
 
-import { set } from '../../../../src/check/arbitrary/SetArbitrary';
+import { set } from '../../../../src/arbitrary/set';
 import { nat } from '../../../../src/arbitrary/nat';
 import { string } from '../../../../src/check/arbitrary/StringArbitrary';
 
diff --git a/test/unit/check/arbitrary/SparseArrayArbitrary.utest.spec.ts b/test/unit/check/arbitrary/SparseArrayArbitrary.utest.spec.ts
index b46145e4..0240a314 100644
--- a/test/unit/check/arbitrary/SparseArrayArbitrary.utest.spec.ts
+++ b/test/unit/check/arbitrary/SparseArrayArbitrary.utest.spec.ts
@@ -6,11 +6,11 @@ import { mocked } from 'ts-jest/utils';
 import fc from '../../../../lib/fast-check';
 
 import * as NatMock from '../../../../src/arbitrary/nat';
-import * as SetArbitraryMock from '../../../../src/check/arbitrary/SetArbitrary';
+import * as SetArbitraryMock from '../../../../src/arbitrary/set';
 import * as TupleArbitraryMock from '../../../../src/check/arbitrary/TupleArbitrary';
 import { arbitraryFor } from './generic/ArbitraryBuilder';
 jest.mock('../../../../src/arbitrary/nat');
-jest.mock('../../../../src/check/arbitrary/SetArbitrary');
+jest.mock('../../../../src/arbitrary/set');
 jest.mock('../../../../src/check/arbitrary/TupleArbitrary');
 
 const validSparseArrayConstraints = (removedKeys: (keyof SparseArrayConstraints)[] = []) =>
diff --git a/test/unit/check/arbitrary/TypedArrayArbitrary.utest.spec.ts b/test/unit/check/arbitrary/TypedArrayArbitrary.utest.spec.ts
index e6651fd9..7b7274aa 100644
--- a/test/unit/check/arbitrary/TypedArrayArbitrary.utest.spec.ts
+++ b/test/unit/check/arbitrary/TypedArrayArbitrary.utest.spec.ts
@@ -12,9 +12,9 @@ import {
 import { Arbitrary } from '../../../../src/check/arbitrary/definition/Arbitrary';
 
 import { mocked } from 'ts-jest/utils';
-jest.mock('../../../../src/check/arbitrary/ArrayArbitrary');
+jest.mock('../../../../src/arbitrary/array');
 jest.mock('../../../../src/arbitrary/integer');
-import * as ArrayArbitraryMock from '../../../../src/check/arbitrary/ArrayArbitrary';
+import * as ArrayArbitraryMock from '../../../../src/arbitrary/array';
 import * as IntegerMock from '../../../../src/arbitrary/integer';
 
 const validArrayConstraintsArb = () =>