Maybe Rant

It's 1:30 AM and I finally finished implementing a simple function after more than an hour.

Not sure if I should be upset about my stupidity or glad that I solved it.

If anyone is interested in learning Haskell I totally recommend these exercises: https://github.com/data61/fp-course

filtering :: Applicative f => (a -> f Bool) -> List a -> f (List a)
filtering p = foldRight (\a -> lift2 (bool id (a:.)) (p a)) (pure Nil)

  • 1
    Haskell 😮 you should be proud of urself. Its not easy. 🤜🤛
Add Comment