RepeatedCall.is_guarded: def of bend-lint-rules@0.2.0.0 Import: import bend-lint-rules@0.2.0.0/performance/repeated_call.bend as RepeatedCall Lines 72-87 of bend-lint-rules@0.2.0.0/performance/repeated_call.bend: https://jend.leeeet.dev/read.txt?path=bend-lint-rules@0.2.0.0/performance/repeated_call.bend&start_line=72&end_line=87 import Base import bend-lint-api@0.2.0.0/linter/lint.bend as Lint import bend-lint-rules@0.2.0.0/performance/deep_call_in_fork.bend as Deep import bend-lint-rules@0.2.0.0/performance/missed_fork.bend as Fork # Whether a node below `path` may not run on the path of its branch, or runs as a copy made on purpose: under a lambda, # a value of a choice (Bool.pick, Bool.and, Bool.or), or a value of a parallel let. def is_guarded(path: List<&2, Lint.Above>, found: Bool) -> Bool: match path found: case _ True{}: True{} case Nil{} False{}: False{} case Con{Lint.Above{Lint.Node{Lint.Lambda{b, q}, n, s, k, f}, at}, rest} False{}: True{} case Con{Lint.Above{Lint.Node{Lint.Application{}, n, s, +kids, f}, at}, rest} False{}: is_guarded(rest, Fork.is_choice(kids)) case Con{Lint.Above{Lint.Node{Lint.Destructure{q}, n, s, +kids, f}, at}, rest} False{}: is_guarded(rest, Nat.is_gt(Deep.binders(kids, 0n), 1n) && Bool.not(Deep.is_last(kids, at))) case Con{a, rest} False{}: is_guarded(rest, False{}) Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_gt https://jend.leeeet.dev/definition.txt?path=bend-lint-api@0.2.0.0/linter/lint.bend&name=Above https://jend.leeeet.dev/definition.txt?path=bend-lint-api@0.2.0.0/linter/lint.bend&name=Node https://jend.leeeet.dev/definition.txt?path=bend-lint-api@0.2.0.0/linter/lint.bend&name=Syntax https://jend.leeeet.dev/definition.txt?path=bend-lint-rules@0.2.0.0/performance/deep_call_in_fork.bend&name=binders https://jend.leeeet.dev/definition.txt?path=bend-lint-rules@0.2.0.0/performance/deep_call_in_fork.bend&name=is_last https://jend.leeeet.dev/definition.txt?path=bend-lint-rules@0.2.0.0/performance/missed_fork.bend&name=is_choice