76 people like it.
Like the snippet!
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.
1: 2: 3: 4: 5: 6: 7: |
|
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: |
|
Link: | http://fssnip.net/m |
Posted: | 14 years ago |
Author: | Tomas Petricek |
Tags: | list , filter , recursion , pattern matching |