def float.yaml

yaml-for-bend@0.1.1.0 · core.bend:126

import yaml-for-bend@0.1.1.0/core.bend as Core
import Base
import yaml-for-bend@0.1.1.0/value.bend as V

126# !!float: a float, or an integer written as one ("3" is 3.0).
127def float.yaml(m: Maybe<&2, String>, i: Maybe<&2, String>) -> Maybe<&2, V.Yaml>:
128  match m:
129    case Some{t}:
130      Some{V.Float{t}}
131    case None{}:
132      match i:
133        case Some{t}:
134          Some{V.Float{t ++ ".0"}}
135        case None{}:
136          None{}

Uses (4)

Used by (1)