// Standard Prelude - commonly used functions and types // This module can be imported to get essential utilities /// Identity function - returns its argument unchanged pub fn identity(x: T): T = x /// Constant function - returns first argument, ignores second pub fn const(a: A, b: B): A = a /// Function composition pub fn compose(f: fn(B): C, g: fn(A): B): fn(A): C = fn(x: A): C => f(g(x)) /// Flip argument order of a binary function pub fn flip(f: fn(A, B): C): fn(B, A): C = fn(b: B, a: A): C => f(a, b) /// Apply a function to a value (useful for pipelines) pub fn apply(f: fn(A): B, x: A): B = f(x) /// Check if two integers are equal pub fn eq(a: Int, b: Int): Bool = a == b /// Check if first is less than second pub fn lt(a: Int, b: Int): Bool = a < b /// Check if first is greater than second pub fn gt(a: Int, b: Int): Bool = a > b /// Negate a boolean pub fn not(b: Bool): Bool = if b then false else true /// Logical and pub fn and(a: Bool, b: Bool): Bool = if a then b else false /// Logical or pub fn or(a: Bool, b: Bool): Bool = if a then true else b