GAP:List
From Groupprops
This article is about a GAP function.
Definition
Function type
This function takes two inputs, the first being a list and the second being a function.
Behavior
The function behaves the way "map" behaves in the context of functional programming languages: it outputs a new list where each element is obtained by applying the function to the corresponding element of the input list.
Nature of input | Output | |
---|---|---|
First input is a list, second input is a function | New list, whose ![]() ![]() | |
Either of the inputs is undefined | Error of the form Variable: <..> must have an assigned value at ... | |
First input is not a list | NoMethodFound error | |
Second input is something but is not a function | Error of the form Function Calls: <func> must be a function ... | |
The function given as the second input cannot be applied to the elements of the list given in the first input | NoMethodFound error (or possibly usage error, depending on the nature of the issue) |
Related functions
Function | Meaning |
---|---|
Filtered | |
ForAll |