Skip to content

Comment on Making Map Operations Implicit in Programmingparent

Comments

I like my code to do what it says. You can pretty much do that in Haskell. If you allow me to add a definition first:

    mfilter' :: MonadPlus m => (a -> Bool) -> a -> m a
    mfilter' f = mfilter f . return
Then it's just:
    toUpperCase <=< mfilter' (\x -> length x /= 0) . trim
Which is pretty close. No need to change the language.
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.