LibFunctional-1.0

This project is abandoned and its default file will likely not work with the most recent version of World of Warcraft. Whether this project is out of date or its author has marked it as abandoned, this project is no longer maintained.

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

Example:

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 = fn.map(list, 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.


Comments

Posts Quoted:
Reply
Clear All Quotes

About This Project

  • Project ID
    56209
  • Created
    Apr 21, 2013
  • Last Released File
    Jun 11, 2013
  • Total Downloads
    3,949
  • License

Categories

Members

Recent Files