Module
pooka/bool
src/pooka/bool.pookaTwo small answers are sometimes enough.
Convert Boolean values to their Pooka spellings and parse exactly those spellings. Parsing is case-sensitive: other text produces InvalidBoolean rather than a guess.
import pooka/bool
assert bool.parse("True") == Ok(True)
API reference
enum ParseError
ParseError.InvalidBoolean
to_string(value: Bool) -> String
INFERRED
fn(Bool) -> StringUse the language's capitalized Boolean spelling.
import pooka/bool
assert bool.to_string(True) == "True"
parse(text: String) -> Result(Bool, ParseError)
INFERRED
fn(String) -> Result(Bool, pooka/bool.ParseError)Accept exactly True or False, preserving case.
import pooka/bool
assert bool.parse("False") == Ok(False)
not(value: Bool) -> Bool
INFERRED
fn(Bool) -> BoolReturn the opposite Boolean value.
import pooka/bool
assert bool.not(True) == False