def effect

bolt@1.27.0.0 · src/rules/pedantic/fuel.bend:80

import bolt@1.27.0.0/src/rules/pedantic/fuel.bend as Fuel
import Base
import bolt@1.27.0.0/src/syntax/tree.bend as Tree
import bolt@1.27.0.0/src/rules/calls.bend as Calls

80# does a def's header return an effect: a top-level `->` with the
81# capitalized name `IO` right after it, on the next line (below) when the
82# arrow ends the header?
83def effect(sig: Tree.Node, +below: Tree.Node) -> Bool:
84  match sig:
85    case Tree.NCons{h, +rest}:
86      +more = effect(rest, below)
87      Bool.or(Bool.and(Calls.kind.leaf(~Calls.kind.arrow, h), effect.next(rest, below)), more)
88    case other:
89      False{}

Uses (7)

Used by (1)