def find

bolt@1.27.0.0 · src/syntax/outline.bend:546

import bolt@1.27.0.0/src/syntax/outline.bend as Outline
import Base
import bolt@1.27.0.0/src/lazy/lazy.bend as Lazy

546# the item of that name; imports are not names of the module
547def find(items: List<&2, Item>, +name: String) -> Maybe<&2, Item>:
548  match items:
549    case Nil{}:
550      None{}
551    case Con{Item{+k, +nm, l, s, d, p}, t}:
552      Lazy.stop(Maybe<&2, Item>, Bool.and(Bool.not(is_import(k)), String.eq(nm, name)),
553        Some{Item{k, nm, l, s, d, p}}, _u => find(t, name))

Uses (9)

Used by (5)