LuaFun - LuaJit Functional
Intro LuaFun μ μ - LuaJit Hight Performance Functional Programming Library luajitμ λ΄μ₯ν¨μλ₯Ό νμ₯νμ¬ λ€μν νλ‘κ·Έλλ°μ λλλ€. νλμ© κ³΅λΆν΄μ νμ©νλ©΄ λ§€μ° κ°λ ₯ν ν΄μ΄ λ κ²μ΄λ€. Usage κΈ°λ³Έ μ¬μ©λ² $ git clone https://github.com/luafun/luafun.git $ cd luafun $ luajit -i > -- Functional style > require "fun" () > -- calculate sum(x for x^2 in 1..n) > n = 100 > print(reduce(operator.add, 0, map(function(x) return x^2 end, range(n)))) 328350 > -- Object-oriented style > local fun = require "fun" > -- calculate sum(x for x^2 in 1..n) > print(fun.range(n):map(function(x) return x^2 end):reduce(operator.add, 0)) 328350 Using the Library Links github https://github.com/luafun/luafun Document https://luafun.github.io/