Module

Type.Data.Peano.Nat.Parse

Package
purescript-typelevel-peano
Repository
csicar/purescript-typelevel-peano

#ParseNat Source

class ParseNat (sym :: Symbol) (nat :: Nat) | nat -> sym, sym -> nat

Parses a Nat from a Symbol

ParseNat "2" ~> (Succ (Succ Z))
ParseNat "1283" ~> (Succ (...))

Instances

#parseNat Source

parseNat :: forall a sym. ParseNat sym a => SProxy sym -> NProxy a

value-level parse of number

parseNat (SProxy "10") ~> D10