def BigInt.read

bend-kit-bignum@0.1.0.0 · bigint.bend:486

import bend-kit-bignum@0.1.0.0/bigint.bend as Bigint
import Base

486# An optional '-' and at least one ASCII digit; leading zeros are fine.
487def BigInt.read(s: String) -> Maybe<&2, BigInt>:
488  match s:
489    case SCon{'-', t}:
490      BigInt.read.fin(True{}, Mag.digits(t, True{}, Nil{}))
491    case t:
492      BigInt.read.fin(False{}, Mag.digits(t, True{}, Nil{}))

Uses (11)

Used by (2)