[Haskell-beginners] optimisation of code

PICCA Frederic-Emmanuel frederic-emmanuel.picca at synchrotron-soleil.fr
Mon Oct 1 17:01:48 UTC 2018


> My first instinct is to just use anyM instead of allM

> allFilesThere :: MonadIO m => [Path Abs File] -> m Bool
> allFilesThere fs = liftIO $ anyM (not . doesFileExist . fromAbsFile) fs

> However you'll now have the opposite problem.  It will take a lot of resources when all the files are there.  But maybe that is okay for your use case?

I need to reduce the worload when a file is missing.
I like a lot the partition idea.

Cheers

Frederic


More information about the Beginners mailing list