def has_arrow

bolt@1.27.0.0 · src/rules/calls.bend:277

import bolt@1.27.0.0/src/rules/calls.bend as Calls
import Base
import bolt@1.27.0.0/src/syntax/tree.bend as Tree
import bolt@1.27.0.0/src/lazy/lazy.bend as Lazy

277# does a chain hold a top-level `->`?
278def has_arrow(pp: Tree.Node) -> Bool:
279  match pp:
280    case Tree.NCons{h, rest}:
281      Lazy.or_else(kind.leaf(~kind.arrow, h), _u => has_arrow(rest))
282    case other:
283      False{}

Uses (5)

Used by (2)