def exp.read

yaml-for-bend@0.1.1.0 · num.bend:150

import yaml-for-bend@0.1.1.0/num.bend as Num
import Base

150def exp.read(s: String) -> Exp:
151  match s:
152    case SCon{c, t}:
153      match c:
154        case '-':
155          Exp{True{}, exp.nat(t)}
156        case '+':
157          Exp{False{}, exp.nat(t)}
158        case _:
159          Exp{False{}, exp.nat(SCon{c, t})}
160    case SNil{}:
161      Exp{False{}, 0n}

Uses (8)

Used by (1)