def float.yaml

yaml-for-bend@0.1.1.0 · yaml11.bend:212

import yaml-for-bend@0.1.1.0/yaml11.bend as Yaml11
import Base
import yaml-for-bend@0.1.1.0/value.bend as V
import yaml-for-bend@0.1.1.0/num.bend as N

212# !!float: a float, or an integer written as one ("3" is 3.0).
213def float.yaml(m: Maybe<&2, String>, i: Maybe<&2, String>) -> Maybe<&2, V.Yaml>:
214  match m:
215    case Some{t}:
216      Some{V.Float{t}}
217    case None{}:
218      match i:
219        case Some{t}:
220          Some{V.Float{N.dec.exact(t)}}
221        case None{}:
222          None{}

Uses (4)

Used by (1)