def bit

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

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

111# 1 when i is a valid bin of a length-n histogram, else 0.
112# List.set (and therefore inc_at) is a no-op at i >= n.
113def bit(b: Bool) -> Nat:
114  match b:
115    case True{}:
116      1n
117    case False{}:
118      0n

Uses (2)

Used by (1)