Last active
November 24, 2016 18:22
-
-
Save kaveet/a397dab4d01ddd9e692a4d1470d83ced to your computer and use it in GitHub Desktop.
Haskell filter implementation with foldr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Problem 2: Write a function `filter'` that mimics the functionality of `filter` from the standard prelude, making use of `foldr` | |
module MyFilter where | |
filter' p = foldr (\x xs -> if p x then x : xs else xs) [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment