Binding to local functions works, at least as long as the bound function is considered first in each stage.
Dependencies work with a minor hack. This allows call expressions to bind to functions that have their possible type analyzed after the call is analyzed. The dependency causes the appropriate stages to be re-run for the call expressions.