Re:Functional programming for Object Oriented programmers
by lifebeyondfife on Thursday November 24, 2011 @01:49PM
(#3275095)
Yes, my mistake sorry. Correcting it now.
Re:Functional programming for Object Oriented programmers
by xentronium on Thursday November 24, 2011 @01:31PM
(#3275042)
Yeah, it's clearly an error on author's side.
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
[0] And when possible, a function should only return a value, not do other things.