Snippets tagged filter

  • Filtering lists

    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 this

    Posted: 13 years ago by Tomas Petricek

  • Text file line filter (script)

    A script suitable for FSI that copies a (UTF-8) text file throwing away uninteresting lines in the process.

    2 people like this

    Posted: 9 years ago by Robert Nielsen

  • Faster Filter 2

    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 this

    Posted: 7 years ago by Jack Mott

  • Pipeline list processing

    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.

    92 people like this

    Posted: 13 years ago by Tomas Petricek

  • Faster Filter

    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 this

    Posted: 7 years ago by Jack Mott

  • Project Euler #1

    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 this

    Posted: 4 years ago by Eugene Gavrin