Thunk.lams: def of bolt@1.27.0.0 Import: import bolt@1.27.0.0/src/rules/suspicious/thunk.bend as Thunk Lines 130-141 of bolt@1.27.0.0/src/rules/suspicious/thunk.bend: https://jend.leeeet.dev/read.txt?path=bolt@1.27.0.0/src/rules/suspicious/thunk.bend&start_line=130&end_line=141 import Base import bolt@1.27.0.0/src/syntax/lex.bend as Lex import bolt@1.27.0.0/src/syntax/tree.bend as Tree # how many arguments of a group's kids, from here on, hold a `=>` leaf among # their own nodes; seen: the argument under way does def lams(nn: Tree.Node, +seen: Bool) -> Nat: match nn: case Tree.NCons{Tree.Leaf{Lex.Tok{k, t, _l, _c}}, rest}: +comma = Lex.is_comma(k) Nat.add(Bool.pick(Nat, Bool.and(comma, seen), 1n, 0n), lams(rest, Bool.and(Bool.not(comma), Bool.or(seen, String.eq(t, "=>"))))) case Tree.NCons{_h, rest}: lams(rest, seen) case _other: Bool.pick(Nat, seen, 1n, 0n) 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=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.eq https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/syntax/lex.bend&name=Tok https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/syntax/lex.bend&name=is_comma https://jend.leeeet.dev/definition.txt?path=bolt@1.27.0.0/src/syntax/tree.bend&name=Node