Library of helper functions that enable functional style programming and perform commonly used operations on lists and tables.


local fn = LibStub("LibFunctional-1.0")

local list = { 1, 2, 3, 4, 5 }

-- returns a list with the result of applying the specified function to all the values in the list
local mapped =, function(x) return x * 2 end)

-- returns the product of all the values in the list
local s = fn.reduce(mapped, function(a, b) return a * b end)

-- prints a sorted list of all the names of global variables that match "CHAT_FRAME"
local addmessage = fn.bind(DEFAULT_CHAT_FRAME.AddMessage, DEFAULT_CHAT_FRAME)
fn.each(fn.sort(fn.filter(fn.keys(_G), function(x) return string.match(x, "CHAT_FRAME") end)), addmessage)

See the API page for more details.

You must login to post a comment. Don't have an account? Register to get one!


Date created
Apr 21, 2013
Last updated
Apr 23, 2013