Source/Packages

Std.Foundation

packages/foundation/standard/src/Std/Foundation.alpha

325 lines52 declarations11.6 KiBSHA-256 3dcbd3fa87ff

def · lines 153–160

stdBoolToNatural

Full file
A decision as a natural: zero is false, one is true. The conversion is explicit, so a count is never treated as a decision by accident.
153def stdBoolToNatural =
154  (lambda unrestricted value : (family StdBool) .
155    eliminate
156      StdBool
157      (lambda unrestricted current : (family StdBool) . Nat)
158      value
159      (branch StdTrue . 1)
160      (branch StdFalse . 0))

The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.