$ luarocks install luatableExtends Lua's table library with iterators, functional helpers, set operations and utilities. Enhanced tables get these as methods plus operator overloads. Works on Lua 5.1 - 5.4 and LuaJIT 2.1.
local table = require "luatable"
local t = table { 1, 2, 3, 4 }
print(t:accept(table.even):map(table.sqr):reduce(0, table.sum)) --> 20
Constructors: table{...} / table.new, of, init, zeros, ones, ofChars
Iterators: iter, range, group, slide, keys, values, inverse
Functional: map, reduce, accept, reject, each, eachi, flat, deepflat, flatmap, all, any, allPairs, anyPairs
Utilities: max, min, avg, maximize, minimize, sample, shuffle, reverse, slice, find, clone, merge, unique, purify, equal, keyList, valueList, valueSequence, tostring
Sets: union, negation, intersect, keySet, valueSet
Methods: at, get, first, last, has, haskey, empty, append, push, pop, head, lshift, rshift, shift, clear
Operators: + (union), - (negation), * (intersect), .. (merge), == (equal)
More examples: https://github.com/Luca96/lua-table