Functional programming utility functions
Signature | hs.fnutils.concat(table1, table2) |
---|---|
Type | Function |
Description |
Join two tables together |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/fnutils/fnutils.lua line 190 |
Signature | hs.fnutils.contains(table, element) -> bool |
---|---|
Type | Function |
Description |
Determine if a table contains a given object |
Parameters |
|
Returns |
|
Source | extensions/fnutils/fnutils.lua line 152 |
Signature | hs.fnutils.copy(table) -> table |
---|---|
Type | Function |
Description |
Copy a table using |
Parameters |
|
Returns |
|
Source | extensions/fnutils/fnutils.lua line 135 |
Signature | hs.fnutils.each(table, fn) |
---|---|
Type | Function |
Description |
Execute a function across a table (in arbitrary order), and discard the results |
Parameters |
|
Returns |
|
Source | extensions/fnutils/fnutils.lua line 76 |
Signature | hs.fnutils.every(table, fn) -> bool |
---|---|
Type | Function |
Description |
Returns true if the application of fn on every entry in table is true. |
Parameters |
|
Returns |
|
Source | extensions/fnutils/fnutils.lua line 356 |
Signature | hs.fnutils.filter(table, fn) -> table |
---|---|
Type | Function |
Description |
Filter a table by running a predicate function on its elements (in arbitrary order) |
Parameters |
|
Returns |
|
Notes |
processing and for better performance. |
Source | extensions/fnutils/fnutils.lua line 112 |
Signature | hs.fnutils.find(table, fn) -> element |
---|---|
Type | Function |
Description |
Execute a function across a table and return the first element where that function returns true |
Parameters |
|
Returns |
|
Source | extensions/fnutils/fnutils.lua line 261 |
Signature | hs.fnutils.ieach(list, fn) |
---|---|
Type | Function |
Description |
Execute a function across a list-like table in order, and discard the results |
Parameters |
|
Returns |
|
Source | extensions/fnutils/fnutils.lua line 62 |
Signature | hs.fnutils.ifilter(list, fn) -> list |
---|---|
Type | Function |
Description |
Filter a list-like table by running a predicate function on its elements in order |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/fnutils/fnutils.lua line 91 |
Signature | hs.fnutils.imap(list, fn) -> list |
---|---|
Type | Function |
Description |
Execute a function across a list-like table in order, and collect the results |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/fnutils/fnutils.lua line 10 |
Signature | hs.fnutils.indexOf(table, element) -> number or nil |
---|---|
Type | Function |
Description |
Determine the location in a table of a given object |
Parameters |
|
Returns |
|
Source | extensions/fnutils/fnutils.lua line 171 |
Signature | hs.fnutils.map(table, fn) -> table |
---|---|
Type | Function |
Description |
Execute a function across a table (in arbitrary order) and collect the results |
Parameters |
|
Returns |
|
Notes |
processing and for better performance. |
Source | extensions/fnutils/fnutils.lua line 37 |
Signature | hs.fnutils.mapCat(table, fn) -> table |
---|---|
Type | Function |
Description |
Execute, across a table, a function that outputs tables, and concatenate all of those tables together |
Parameters |
|
Returns |
|
Source | extensions/fnutils/fnutils.lua line 210 |
Signature | hs.fnutils.reduce(table, fn[, initial]) -> table |
---|---|
Type | Function |
Description |
Reduce a table to a single element, using a function |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/fnutils/fnutils.lua line 228 |
Signature | hs.fnutils.some(table, fn) -> bool |
---|---|
Type | Function |
Description |
Returns true if the application of fn on entries in table are true for at least one of the members. |
Parameters |
|
Returns |
|
Source | extensions/fnutils/fnutils.lua line 374 |
Signature | hs.fnutils.split(sString, sSeparator [, nMax] [, bPlain]) -> { array } |
---|---|
Type | Function |
Description |
Convert string to an array of strings, breaking at the specified separator. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/fnutils/fnutils.lua line 472 |
Signature | hs.fnutils.cycle(table) -> fn() |
---|---|
Type | Constructor |
Description |
Creates a function that repeatedly iterates a table |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/fnutils/fnutils.lua line 330 |
Signature | hs.fnutils.partial(fn, ...) -> fn' |
---|---|
Type | Constructor |
Description |
Returns a new function which takes the provided arguments and pre-applies them as the initial arguments to the provided function. When the new function is later invoked with additional arguments, they are appended to the end of the initial list given and the complete list of arguments is finally passed into the provided function and its result returned. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/fnutils/fnutils.lua line 298 |
Signature | hs.fnutils.sequence(...) -> fn |
---|---|
Type | Constructor |
Description |
Creates a function that will collect the result of a series of functions into a table |
Parameters |
|
Returns |
|
Source | extensions/fnutils/fnutils.lua line 278 |
Signature | hs.fnutils.sortByKeys(table[ , function]) -> function |
---|---|
Type | Constructor |
Description |
Iterator for retrieving elements from a table of key-value pairs in the order of the keys. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/fnutils/fnutils.lua line 392 |
Signature | hs.fnutils.sortByKeyValues(table[ , function]) -> function |
---|---|
Type | Constructor |
Description |
Iterator for retrieving elements from a table of key-value pairs in the order of the values. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/fnutils/fnutils.lua line 432 |
© 2014–2017 Hammerspoon contributors
Licensed under the MIT License.
https://www.hammerspoon.org/docs/hs.fnutils.html