Pudu programming language
Menu
API reference

Std.Text.Parse.integerIn

1 declaration

fn

integerIn: N -> fn(Std.Text.Parse.Input) -> Result[(N, Std.Text.Parse.Input), Std.Text.Parse.Problem] where N: Integer

This is a callable function.

What it does

A whole number counted in the caller's own integer type.

The witness carries the type: integerIn(0u8) parses a UInt8. A number

the text names but the type cannot hold is a parse problem, reported at

the position where it was read, rather than a silently wrapped value — which

is the same stance the language takes everywhere else about a number that

does not fit.

Read the signature

  • The text after the name is the type checked by Pudu.
  • Read arrows from left to right: inputs come first, and the final type is returned.
  • Names inside [ ] are type arguments, such as the item type held by a collection.
  • Result makes success and recoverable failure part of the function's type.

Back to Std.Text.ParseSearch related declarations