4 ms·
The article says List.map function list - Invokes function on every item within list and returns nothing. which isn't what map does in other functional progra
by Zak 15y ago
The article says
List.map function list - Invokes function on every item within list and returns nothing.
which isn't what map does in other functional programming languages. Applying a function and returning nothing isn't a very functional thing to do in general, as whenever possible functions should be called for their return values, not anything else they might do[0]. Map normally returns a list of the function applied to every element of the list. I looked up the documentation for F#'s map, and it appears to do the same thing:
http://msdn.microsoft.com/en-us/library/ee370378.aspx http://msdn.microsoft.com/en-us/library/ee370378.aspx
[0] And when possible, a function should only return a value, not do other things.
- xentronium 15y agoYeah, it's clearly an error on author's side.
- lifebeyondfife 15y agoYes, my mistake sorry. Correcting it now.