Wednesday, December 27, 2006

Good news

It seems String.map will be added to the F# library in its next release. Also, there were quite good responses to the points I raised about library functions in the F# mailing list. Don Syme noted that zip is already there, and it's called List.combine. I hadn't noticed this.

Also, Robert Pickering, author of the upcoming APress book Foundations of F#, responded on his blog with a short version of the ROT13 algorithm, using only functions already present in the current library:
http://strangelights.com/blog/archive/2006/12/27/1580.aspx

It basically uses List.mapi instead of my combo of zip, drop and take. List.mapi maps a function over a list, but this function gets as arguments the list element and its index. And mapping over a string is implemented by converting the string to a char array, using Array.map over it and then creating a new string based on the result.

No comments: