def nats_sum

unified-nsga-iii@0.2.2.0 · util.bend:103

import unified-nsga-iii@0.2.2.0/util.bend as Util
import Base

103# Sum of a Nat histogram. Used to lock mid-split count conservation.
104def nats_sum(xs: List<&2, Nat>) -> Nat:
105  match xs:
106    case Nil{}:
107      0n
108    case +x <> rest:
109      Nat.add(x, nats_sum(rest))

Uses (3)

Used by (0)

No other definition uses this definition.