[→] luarrow [→] |> The true Pipeline-operator |> . $ The Haskell-inspired function compositions . $ * % The new syntax for Lua, and you ^ % 🚗 Quick Examples Powered by Lua's beautiful operator overloading (of % , * , ^ ), bringing you the elegance of: OCaml, Julia, F#, PHP, Elixir, Elm's true pipeline operators x |> f |> g -- Unlike pipe(x, f, g) (cheap pipe function ) 1 The beauty of the pipeline operator hardly needs mentioning here pipeline -- Unlike (cheap pipe ) local arrow = require ( ' luarrow ' ). arrow -- The **true** pipeline operator local _ = 42 % arrow ( function ( x ) return x - 2 end ) ^ arrow ( function ( x ) return x * 10 end ) ^ arrow ( function ( x ) return x + 1 end ) ^ arrow ( print ) -- 401 Equivalent to: 2 // PHP 42 |> ( fn ( $ x ) => $ x - 2 ) |> ( fn ( $ x ) => $ x * 10 ) |> ( fn ( $ x ) => $ x + 1 ) |> var_dump (...); Haskell's highly readable f . g . h $ x syntax -- Unlike f(g(h(x))) (too many parentheses!) This notation is also used in mathematics, and similarly, it is a very beautiful syntax syntax -- Unlike (too many parentheses!) local fun = require ( ' luarrow ' ). fun local function f ( x ) return x + 1 end local function g ( x ) return x * 10 end local function h ( x ) return x - 2 end -- Compose and apply with Haskell-like syntax! local result = fun ( f ) * fun ( g ) * fun ( h ) % 42 print ( result ) -- 401 Equivalent to: -- Haskell print . f . g . h $ 42 Detailed documentation can be found in ./luarrow.lua/doc/ directory. ✨ Why luarrow? Write dramatically cleaner, more expressive Lua code: Beautiful code - Make your functional pipelines readable and maintainable - Make your functional pipelines readable and maintainable Elegant composition - Chain multiple functions naturally with * / ^ operators True pipeline operators - Transform data with intuitive left-to-right flow x % f ^ g Haskell-inspired syntax - Write f * g % x instead of f(g(x)) - Chain multiple functions naturally with / operators Zero dependencies - Pure Lua implement...
First seen: 2025-12-09 06:28
Last seen: 2025-12-09 08:28