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

  • 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