Show raw api
{
"functions": [
{
"name": "CollectBy",
"desc": "Returns a new List of Lists grouped by the collector function. The collector function takes an\nelement and returns the key to group by.\n\nThe grouped sublists are ordered by the order of the elements in the original list.\n\nThe order in which the sublists are returned is by alphabetical order of the collector keys.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "collector",
"desc": "A function that takes an element and returns the key to group by.",
"lua_type": "(any) -> string"
}
],
"returns": [
{
"desc": "The new List of grouped Lists.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"construct"
],
"source": {
"line": 248,
"path": "src/init.lua"
}
},
{
"name": "CountBy",
"desc": "Returns a new Dictionary of the number of elements for each group key returned by the collector\nfunction. The collector function takes an element and returns the key to group by.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "collector",
"desc": "A function that takes an element and returns the key to group by.",
"lua_type": "(any) -> any"
}
],
"returns": [
{
"desc": "The new Dictionary of grouped counts.",
"lua_type": "Dictionary"
}
],
"function_type": "static",
"tags": [
"construct"
],
"source": {
"line": 274,
"path": "src/init.lua"
}
},
{
"name": "GroupBy",
"desc": "Returns a new Dictionary of Lists grouped by the collector function. The collector function\ntakes an element and returns the key to group by.\n\nThe grouped sublists are ordered by the order of the elements in the original list.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "collector",
"desc": "A function that takes an element and returns the key to group by.",
"lua_type": "(any) -> any"
}
],
"returns": [
{
"desc": "The new Dictionary of grouped Lists.",
"lua_type": "Dictionary"
}
],
"function_type": "static",
"tags": [
"construct"
],
"source": {
"line": 301,
"path": "src/init.lua"
}
},
{
"name": "All",
"desc": "Returns true if every element in the List passes the predicate. Otherwise returns false.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "predicate",
"desc": "A function that takes an element and returns a boolean.",
"lua_type": "(any) -> boolean"
}
],
"returns": [
{
"desc": "True if every element passes the predicate, otherwise false.",
"lua_type": "boolean"
}
],
"function_type": "static",
"tags": [
"evaluate"
],
"source": {
"line": 333,
"path": "src/init.lua"
}
},
{
"name": "Any",
"desc": "Returns true if any element in the List passes the predicate. Otherwise returns false.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "predicate",
"desc": "A function that takes an element and returns a boolean.",
"lua_type": "(any) -> boolean"
}
],
"returns": [
{
"desc": "True if any element passes the predicate, otherwise false.",
"lua_type": "boolean"
}
],
"function_type": "static",
"tags": [
"evaluate"
],
"source": {
"line": 356,
"path": "src/init.lua"
}
},
{
"name": "Find",
"desc": "Returns the first value in the list that passes the predicate, or nil if none do.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "predicate",
"desc": "A function that takes an element and returns a boolean.",
"lua_type": "(any) -> boolean"
}
],
"returns": [
{
"desc": "The first value that passes the predicate, or nil if none do.",
"lua_type": "any | nil"
}
],
"function_type": "static",
"tags": [
"evaluate"
],
"source": {
"line": 379,
"path": "src/init.lua"
}
},
{
"name": "FindIndex",
"desc": "Returns the index of the first value in the list that passes the predicate, or nil if none do.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "predicate",
"desc": "A function that takes an element and returns a boolean.",
"lua_type": "(any) -> boolean"
}
],
"returns": [
{
"desc": "The index of the first value that passes the predicate, or nil if none do.",
"lua_type": "integer | nil"
}
],
"function_type": "static",
"tags": [
"evaluate"
],
"source": {
"line": 402,
"path": "src/init.lua"
}
},
{
"name": "IndexOf",
"desc": "Returns the index of the first value in the list that is equal to the value, or nil if none are.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "value",
"desc": "The value to search for.",
"lua_type": "any"
}
],
"returns": [
{
"desc": "The index of the first value that is equal to the value, or nil if none are.",
"lua_type": "integer | nil"
}
],
"function_type": "static",
"tags": [
"evaluate"
],
"source": {
"line": 425,
"path": "src/init.lua"
}
},
{
"name": "Includes",
"desc": "Returns true if the list includes the value, otherwise returns false.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "value",
"desc": "The value to search for.",
"lua_type": "any"
}
],
"returns": [
{
"desc": "True if the list includes the value, otherwise false.",
"lua_type": "boolean"
}
],
"function_type": "static",
"tags": [
"evaluate"
],
"source": {
"line": 442,
"path": "src/init.lua"
}
},
{
"name": "StartsWith",
"desc": "Returns true if the list elements at the start match the values, otherwise returns false.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "values",
"desc": "The list of values to search for.",
"lua_type": "List | {any}"
}
],
"returns": [
{
"desc": "True if the list elements at the start match the values, otherwise false.",
"lua_type": "boolean"
}
],
"function_type": "static",
"tags": [
"evaluate"
],
"source": {
"line": 463,
"path": "src/init.lua"
}
},
{
"name": "EndsWith",
"desc": "Returns true if the list elements at the end match the values, otherwise returns false.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "values",
"desc": "The list of values to search for.",
"lua_type": "List | {any}"
}
],
"returns": [
{
"desc": "True if the list elements at the end match the values, otherwise false.",
"lua_type": "boolean"
}
],
"function_type": "static",
"tags": [
"evaluate"
],
"source": {
"line": 486,
"path": "src/init.lua"
}
},
{
"name": "First",
"desc": "Returns the first element in the list, or nil if the list is empty.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
}
],
"returns": [
{
"desc": "The first element in the list, or nil if the list is empty.",
"lua_type": "any | nil"
}
],
"function_type": "static",
"tags": [
"evaluate"
],
"source": {
"line": 512,
"path": "src/init.lua"
}
},
{
"name": "Last",
"desc": "Returns the last element in the list, or nil if the list is empty.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
}
],
"returns": [
{
"desc": "The last element in the list, or nil if the list is empty.",
"lua_type": "any | nil"
}
],
"function_type": "static",
"tags": [
"evaluate"
],
"source": {
"line": 528,
"path": "src/init.lua"
}
},
{
"name": "Length",
"desc": "Returns the number of elements in the list.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
}
],
"returns": [
{
"desc": "The number of elements in the list.",
"lua_type": "number"
}
],
"function_type": "static",
"tags": [
"evaluate"
],
"source": {
"line": 544,
"path": "src/init.lua"
}
},
{
"name": "Count",
"desc": "Returns the number of elements which pass the predicate.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "predicate",
"desc": "A function that takes an element and returns a boolean.",
"lua_type": "(any) -> boolean"
}
],
"returns": [
{
"desc": "The number of elements which pass the predicate.",
"lua_type": "number"
}
],
"function_type": "static",
"tags": [
"evaluate"
],
"source": {
"line": 561,
"path": "src/init.lua"
}
},
{
"name": "Join",
"desc": "Returns a string concatenating all the elements in the list with the separator.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "separator",
"desc": "The separator to use between elements.",
"lua_type": "string"
}
],
"returns": [
{
"desc": "The concatenated string.",
"lua_type": "string"
}
],
"function_type": "static",
"tags": [
"evaluate"
],
"source": {
"line": 586,
"path": "src/init.lua"
}
},
{
"name": "Reduce",
"desc": "Returns a single value by iterating through the list, passing the result of each iteration into\nthe next iteration.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "reducer",
"desc": "A function that takes the result of the previous iteration and the current element, and returns the result of the next iteration.",
"lua_type": "(any, any) -> any"
},
{
"name": "initialValue",
"desc": "The initial value to pass into the first iteration.",
"lua_type": "any | nil"
}
],
"returns": [
{
"desc": "The result of the final iteration.",
"lua_type": "any"
}
],
"function_type": "static",
"tags": [
"evaluate"
],
"source": {
"line": 605,
"path": "src/init.lua"
}
},
{
"name": "Append",
"desc": "Returns a new List with the value appended to the end.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "value",
"desc": "The value to append.",
"lua_type": "any"
}
],
"returns": [
{
"desc": "The new List with the value appended.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 630,
"path": "src/init.lua"
}
},
{
"name": "Prepend",
"desc": "Returns a new List with the value prepended to the start.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "value",
"desc": "The value to prepend.",
"lua_type": "any"
}
],
"returns": [
{
"desc": "The new List with the value prepended.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 647,
"path": "src/init.lua"
}
},
{
"name": "Insert",
"desc": "Returns a new List with the value inserted at the index and all subsequent elements shifted to\nthe right.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "index",
"desc": "The index to insert the value at.",
"lua_type": "integer"
},
{
"name": "value",
"desc": "The value to insert.",
"lua_type": "any"
}
],
"returns": [
{
"desc": "The new List with the value inserted.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 666,
"path": "src/init.lua"
}
},
{
"name": "Concat",
"desc": "Returns a new List with the elements from the second List appended to the first.",
"params": [
{
"name": "firstList",
"desc": "",
"lua_type": "List"
},
{
"name": "secondList",
"desc": "The List to append.",
"lua_type": "List | {any}"
}
],
"returns": [
{
"desc": "The new List with the elements appended.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 692,
"path": "src/init.lua"
}
},
{
"name": "Drop",
"desc": "Returns a new List with count elements dropped from the start.\n\nIf a negative number is passed, it is an alias for `DropLast(list, -count)`.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "count",
"desc": "The number of elements to drop.",
"lua_type": "integer"
}
],
"returns": [
{
"desc": "The new List with the elements dropped.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 717,
"path": "src/init.lua"
}
},
{
"name": "DropLast",
"desc": "Returns a new List with count elements dropped from the end.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "count",
"desc": "The number of elements to drop.",
"lua_type": "integer"
}
],
"returns": [
{
"desc": "The new List with the elements dropped.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 752,
"path": "src/init.lua"
}
},
{
"name": "Remove",
"desc": "Returns a new List with the element at the index removed. All subsequent elements are shifted to\nthe left.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "index",
"desc": "The index to remove.",
"lua_type": "integer"
}
],
"returns": [
{
"desc": "The new List with the element removed.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 780,
"path": "src/init.lua"
}
},
{
"name": "Pull",
"desc": "Returns a new List with all elements matching the value removed.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "value",
"desc": "The value to remove.",
"lua_type": "any"
}
],
"returns": [
{
"desc": "The new List with the elements removed.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 802,
"path": "src/init.lua"
}
},
{
"name": "PullAll",
"desc": "Returns a new List with all elements matching any of the values removed.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "values",
"desc": "The list of values to remove.",
"lua_type": "List | {any}"
}
],
"returns": [
{
"desc": "The new List with the elements removed.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 827,
"path": "src/init.lua"
}
},
{
"name": "Filter",
"desc": "Returns a new List with only the elements that pass the predicate.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "predicate",
"desc": "A function that takes an element and its index, and returns a boolean.",
"lua_type": "(any, number) -> boolean"
}
],
"returns": [
{
"desc": "The new List with the elements filtered.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 852,
"path": "src/init.lua"
}
},
{
"name": "Slice",
"desc": "Returns a new List with the elements between the from and to indices, inclusive. If the to index\nis beyond the end of the List, it will be clamped to the end of the List.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "from",
"desc": "The start index.",
"lua_type": "integer"
},
{
"name": "to",
"desc": "The end index.",
"lua_type": "integer"
}
],
"returns": [
{
"desc": "The new List with the elements between the indices, inclusive.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 879,
"path": "src/init.lua"
}
},
{
"name": "Difference",
"desc": "Returns a new List that is the set (no duplicates) of all elements in the List that are not\npresent in the provided values.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "values",
"desc": "The list of values to subtract from the set.",
"lua_type": "List | {any}"
}
],
"returns": [
{
"desc": "The new List of the difference set.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 911,
"path": "src/init.lua"
}
},
{
"name": "DifferenceXor",
"desc": "Returns a new List containing the set (no duplicates) of all elements from either List that are\nonly present in one of the Lists.",
"params": [
{
"name": "firstList",
"desc": "",
"lua_type": "List"
},
{
"name": "secondList",
"desc": "",
"lua_type": "List | {any}"
}
],
"returns": [
{
"desc": "The new List of the difference set.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 937,
"path": "src/init.lua"
}
},
{
"name": "Intersection",
"desc": "Returns a new List containing the set (no duplicates) of all elements in the List that are also\npresent in the provided values.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "values",
"desc": "The list of values to intersect with.",
"lua_type": "List | {any}"
}
],
"returns": [
{
"desc": "The new List of the intersection set.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 969,
"path": "src/init.lua"
}
},
{
"name": "Take",
"desc": "Returns a new List that is a sublist of the List of length count from the start.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "count",
"desc": "The number of elements to take.",
"lua_type": "integer"
}
],
"returns": [
{
"desc": "The new List of the sublist.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 994,
"path": "src/init.lua"
}
},
{
"name": "TakeLast",
"desc": "Returns a new List that is a sublist of the List of length count from the end.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "count",
"desc": "The number of elements to take.",
"lua_type": "integer"
}
],
"returns": [
{
"desc": "The new List of the sublist.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 1024,
"path": "src/init.lua"
}
},
{
"name": "Unique",
"desc": "Returns a new List containing the set (no duplicates) of all elements in the List.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
}
],
"returns": [
{
"desc": "The new List of the set.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 1049,
"path": "src/init.lua"
}
},
{
"name": "Chunk",
"desc": "Returns a new List of Lists, where each inner List is of length size. The final List may be\nshorter if the length of the List is not a multiple of size.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "size",
"desc": "The length of each inner List.",
"lua_type": "integer"
}
],
"returns": [
{
"desc": "The new List of Lists.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 1075,
"path": "src/init.lua"
}
},
{
"name": "Reverse",
"desc": "Returns a new List with the elements in reverse order.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
}
],
"returns": [
{
"desc": "The new List with the elements in reverse order.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 1097,
"path": "src/init.lua"
}
},
{
"name": "Shuffle",
"desc": "Returns a new List with the elements shuffled pseudorandomly.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "seed",
"desc": "The seed to use for the pseudorandom number generator. If nil, the seed will be randomly generated.",
"lua_type": "number | nil"
}
],
"returns": [
{
"desc": "The new List with the elements shuffled.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 1120,
"path": "src/init.lua"
}
},
{
"name": "Sort",
"desc": "Returns a new List with the elements sorted according to the comparator function, or in\nascending order if no comparator is provided.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "comparator",
"desc": "A function that takes two elements and returns true if the first element should be sorted before the second. If nil, the elements will be sorted in ascending order.",
"lua_type": "((any, any) -> boolean) | nil"
}
],
"returns": [
{
"desc": "The new List with the elements sorted.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 1146,
"path": "src/init.lua"
}
},
{
"name": "Flatten",
"desc": "Returns a new List with any sublists flattened to the top level.\n\nBy default, only one level of sublists will be flattened. A depth can be specified to flatten\nmultiple levels of sublists.\n\nTo flatten all sublists, use `FlattenDeep`.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "depth",
"desc": "The number of levels of sublists to flatten. If nil, defaults to 1.",
"lua_type": "integer | nil"
}
],
"returns": [
{
"desc": "The new List with the sublists flattened.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 1172,
"path": "src/init.lua"
}
},
{
"name": "FlattenDeep",
"desc": "Returns a new List with all sublists flattened to the top level.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
}
],
"returns": [
{
"desc": "The new List with the sublists flattened.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 1204,
"path": "src/init.lua"
}
},
{
"name": "Map",
"desc": "Returns a new List with the elements mapped to new values, using the mapper function.",
"params": [
{
"name": "list",
"desc": "",
"lua_type": "List"
},
{
"name": "mapper",
"desc": "A function that takes an element and its index, and returns a new value.",
"lua_type": "(any, number) -> any"
}
],
"returns": [
{
"desc": "The new List with the elements mapped.",
"lua_type": "List"
}
],
"function_type": "static",
"tags": [
"manipulate"
],
"source": {
"line": 1235,
"path": "src/init.lua"
}
}
],
"properties": [],
"types": [],
"name": "List",
"desc": "A module containing data methods for evaluating and manipulating a [List] — an immutable array\nof values.\n\nAlso inherits all shared methods from [Immutable](/api/Immutable).",
"source": {
"line": 1860,
"path": "src/init.lua"
}
}