
17 Feb
2016
17 Feb
'16
12:21 p.m.
Oleg Grenrus
And one more comment:
The law:
filter f = mapMaybe (liftA2 (<$) id (guard ∘ f))
is very hard to understand.
filter f = mapMaybe (\x -> if f x then Just x else Nothing)
Wow, the difference is simply astounding for me. Does this monster liftA2 (<$) id (guard ∘ f) really stand for \x -> if f x then Just x else Nothing ? Is there really no simpler "compact" representation for this trivial idea in Haskell? -- с уважениeм / respectfully, Косырев Сергей