CK Kashyap <[email protected]> writes: > What are the benefits of making it an instance of Functor?
The ability to use fmap rather than liftM. > I'd appreciate it very much if you could give me some pointers on the > usages of guard, when and msum. You can use when to have an operation occur only when a condition is true: when :: (Monad m) => Bool -> m () -> m () e.g. to delete a file only if it actually exists: ,---- | tryDeleteFile :: FilePath -> IO () | tryDeleteFile f = do ex <- doesFileExist f | when ex (removeFile f) `---- -- Ivan Lazar Miljenovic [email protected] IvanMiljenovic.wordpress.com _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
