Skip to content

Std\Types

Types – runtime type conversions.

Provides functions to convert between Yona’s primitive types: Int, Float, Bool, and String.

Parse a string as an integer.

import toInt from Std\Types in
toInt "42" # => 42

Parse a string as a float.

import toFloat from Std\Types in
toFloat "3.14" # => 3.14

Convert an integer to its string representation.

import intToString from Std\Types in
intToString 42 # => "42"

Convert a float to its string representation.

import floatToString from Std\Types in
floatToString 3.14 # => "3.14"

Convert a boolean to "true" or "false".

import boolToString from Std\Types in
boolToString true # => "true"