read -package:vector -package:vector-sized package:basement

read a cell in a mutable array. If the index is out of bounds, an error is raised.
read a cell in a mutable array. If the index is out of bounds, an error is raised.
read a cell in a mutable array. If the index is out of bounds, an error is raised.
Try to read a Double
Read an Floating like number of the form: Call a function with:
  • A boolean representing if the number is negative
  • The digits part represented as a single natural number (123.456 is represented as 123456)
  • The number of digits in the fractional part (e.g. 123.456 => 3)
  • The exponent if any
The code is structured as a simple state machine that:
  • Optionally Consume a - sign
  • Consume number for the integral part
  • Optionally
  • Consume .
  • Consume remaining digits if not already end of string
  • Optionally Consume a e or E follow by an optional - and a number
Read an Integer from a String Consume an optional minus sign and many digits until end of string.
Read a Natural from a String Consume many digits until end of string.
Try to read a floating number as a Rational Note that for safety reason, only exponent between -10000 and 10000 is allowed as otherwise DoS/OOM is very likely. if you don't want this behavior, switching to a scientific type (not provided yet) that represent the exponent separately is the advised solution.
Simple Reader monad
read from a cell in a mutable block without bounds checking. Reading from invalid memory can return unpredictable and invalid values. use read if unsure.
read from a cell in a mutable array without bounds checking. Reading from invalid memory can return unpredictable and invalid values. use read if unsure.
Read the variable in the Prim Monad
Read a value from Addr in a specific primitive monad
Read an element at an index in a mutable array
read from a cell in a mutable array without bounds checking. Reading from invalid memory can return unpredictable and invalid values. use read if unsure.