Std\Bool
Boolean combinators and conditional helpers.
Provides logical operations beyond the built-in && and || operators,
plus conditional execution helpers.
Functions
Section titled “Functions”not : Int -> Bool
Section titled “not : Int -> Bool”Logical negation.
not true # => falsenot false # => trueand : Int -> Int -> Int
Section titled “and : Int -> Int -> Int”Logical AND (short-circuiting).
and true true # => trueand true false # => falseor : Int -> Int -> Bool
Section titled “or : Int -> Int -> Bool”Logical OR (short-circuiting).
or false true # => trueor false false # => falsexor : Int -> Int -> Bool
Section titled “xor : Int -> Int -> Bool”Exclusive OR — true when exactly one argument is true.
xor true false # => truexor true true # => falseimplies : Int -> Int -> Int
Section titled “implies : Int -> Int -> Int”Logical implication: a → b. False only when a is true and b is false.
implies true true # => trueimplies true false # => falseimplies false true # => truewhen : Int -> (a -> b) -> Int
Section titled “when : Int -> (a -> b) -> Int”Executes fn () if cond is true, otherwise returns :ok.
when true (\-> 42) # => 42when false (\-> 42) # => :okunless : Int -> (a -> b) -> Symbol
Section titled “unless : Int -> (a -> b) -> Symbol”Executes fn () if cond is false, otherwise returns :ok.
unless false (\-> 42) # => 42unless true (\-> 42) # => :ok