Two functions showing how to filter functional lists using the specified predicate. First version uses naive recursion and the second one is tail-recursive using the accumulator parameter.
75 people like thisPosted: 13 years ago by Tomas Petricek
A filter function for arrays that is up to 4x faster and uses less memory. The catch is you need to manage the IndexPool, in case you filter some huge arrays and want the memory back after.
3 people like thisPosted: 8 years ago by Jack Mott
This snippet is code that solves first Project Euler problem. It finds the sum of all the multiples of 3 or 5 below 1000. Please add other (more efficient, succinct or interesting) solutions to this snippet.
3 people like thisPosted: 4 years ago by Eugene Gavrin
A script suitable for FSI that copies a (UTF-8) text file throwing away uninteresting lines in the process.
2 people like thisPosted: 10 years ago by Robert Nielsen
Another faster filter. Faster in almost all circumstances for sufficiently simple predicates. Not as fast as http://www.fssnip.net/7Qp but does not require the hacky ThreadLocal ResizeArray.
1 people like thisPosted: 8 years ago by Jack Mott
An example showing how to process list in a pipeline. We first use List.filter to return only even numbers and then use List.map to format them as strings.
4 people like thisPosted: 4 months ago by Tomas Petricek