Fix type of List.map and clean up its PascaLIGO example in list reference page

This commit is contained in:
John David Pressman 2020-02-11 17:27:27 -08:00
parent 8db8f6f039
commit 93ed763483

View File

@ -30,7 +30,7 @@ let size_ = (s: list(int)): nat => List.size(s);
Alias of `List.size`. Alias of `List.size`.
## List.map(map_function: a' -> a', lst: a' list) : 'a list ## List.map(map_function: a' -> b', lst: a' list) : 'b list
Apply an operation defined by `map_function` to each element of a list and return Apply an operation defined by `map_function` to each element of a list and return
a list of the modified elements. a list of the modified elements.
@ -38,7 +38,7 @@ a list of the modified elements.
<!--DOCUSAURUS_CODE_TABS--> <!--DOCUSAURUS_CODE_TABS-->
<!--Pascaligo--> <!--Pascaligo-->
```pascaligo group=b ```pascaligo group=b
function increment(const i: int): int is block { skip } with i + 1; function increment(const i: int): int is i + 1;
// Creates a new list with elements incremented by 1 // Creates a new list with elements incremented by 1
const incremented_list: list(int) = list_map(increment, list 1; 2; 3; end ); const incremented_list: list(int) = list_map(increment, list 1; 2; 3; end );
``` ```