We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 28c96bb commit 6d17d91Copy full SHA for 6d17d91
packages/gp/src/ast.ts
@@ -1,3 +1,4 @@
1
+import type { Maybe } from "@thi.ng/api";
2
import { assert } from "@thi.ng/errors/assert";
3
import { SYSTEM } from "@thi.ng/random/system";
4
import { iterate } from "@thi.ng/transducers/iterate";
@@ -70,7 +71,7 @@ export class AST<OP, T> {
70
71
let loc = this.asZipper(tree).next!;
72
if (!loc) return tree;
73
while (true) {
- let nextLoc: Location<ASTNode<OP, T>> | undefined;
74
+ let nextLoc: Maybe<Location<ASTNode<OP, T>>>;
75
if (rnd!.probability(probMutate)) {
76
loc = loc.replace(
77
this.randomASTNode(0, Math.min(limit - loc.depth, maxDepth))
0 commit comments