def is_choice
import bend-lint-rules@0.2.0.0/performance/missed_fork.bend as MissedForkimport Base
import bend-lint-api@0.2.0.0/linter/lint.bend as Lint
49# Whether an application's nodes call Bool.pick, Bool.and or Bool.or: its arguments are alternatives, each an
50# expression of its own.
51def is_choice(kids: List<&2, Lint.Node>) -> Bool:
52 match kids:
53 case Con{Lint.Node{Lint.Reference{t}, n, s, k, f}, rest}:
54 List.contains(~String, ~String.eq, ["Bool.pick", "Bool.and", "Bool.or"], t)
55 case _:
56 False{}