Let’s find files that not exist in the current directory:
filterM (\f -> return . not =<< doesFileExist f) files
And now I want to do it better with point notation:
filterM (liftM not . doesFileExist) files
Are there another approaches to do this? For example, later works not so good for composition of pure functions, need braces:
filterM (liftM (isExtensionPNG . not) . doesFileExist) files
You could define an infix operator to make it nicer to write: