def BigInt.read
import bend-kit-bignum@0.1.0.0/bigint.bend as Bigintimport 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{}))