def operand_refusal
import bendtorch-core@0.1.0.0/src/autograd/sgd_LAWS.bend as SgdLAWSimport Base
import bendtorch-core@0.1.0.0/src/autograd/sgd.bend as Sgd
138# What a parameter's node allows: a node with no operands, a leaf, is
139# accepted; a node with operands is refused with NotLeaf.
140def operand_refusal(targets: List<&2, Nat>) -> Maybe<&2, Sgd.Error>:
141 match targets:
142 case Nil{}:
143 None{}
144 case Con{target, rest}:
145 Some{Sgd.NotLeaf{}}