Skip to content

EvandroLG/pipe.lua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pipe

An implementation of the pipeline operator in Lua

Build Status license

Installation

To install pipe, run:

$ luarocks install pipe

How does it work?

pipe function pipes the value of an expression into a function that allows the creation of chained function calls.

pipe performs left-to-right function composition. See the example below:

local pipe = require('pipe')

function exclamation(str)
  return str .. '!'
end

local wrapped = pipe(string.upper, exclamation)
wrapped('Lua is nice') -- LUA IS NICE!

License

MIT

About

An implementation of the `pipeline` operator in Lua

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published