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.

    64 people like this

    Posted: 6 years ago by Tomas Petricek

  • 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.

    71 people like this

    Posted: 6 years ago by Eugene Gavrin

  • 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: 8 months ago by Jack Mott