/* Unit Test: Standard Library */ /* Tests: All built-in higher-order functions */ /* Basic functions for testing */ double_func : x -> x * 2; square_func : x -> x * x; add_func : x y -> x + y; isPositive : x -> x > 0; /* Map function */ mapped1 : map @double_func 5; mapped2 : map @square_func 3; ..assert mapped1 = 10; ..assert mapped2 = 9; /* Compose function */ composed : compose @double_func @square_func 3; ..assert composed = 18; /* Pipe function */ piped : pipe @double_func @square_func 2; ..assert piped = 16; /* Apply function */ applied : apply @double_func 7; ..assert applied = 14; /* Reduce and Fold functions */ reduced : reduce @add_func 0 5; folded : fold @add_func 0 5; ..assert reduced = 5; ..assert folded = 5; /* Curry function */ curried : curry @add_func 3 4; ..assert curried = 7; ..out "Standard library test completed";