Created
March 25, 2021 04:06
-
-
Save bradparker/040acc8409b26bd1f7a7283c666017ec to your computer and use it in GitHub Desktop.
This file contains hidden or 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
filtering :: | |
Applicative f => | |
(a -> f Bool) | |
-> List a | |
-> f (List a) | |
filtering p = | |
flip foldRight (pure Nil) $ \a fas -> | |
(\b as -> bool as (a :. as) b) <$> p a <*> fas |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment