How to avoid boilerplate assignments like doesExist <- doesDirectoryExist path and case doesExist of ... within IO?
Is there a more idiomatic way than this?
import System.Directory import System.Environment main = do path:_ <- getArgs doesDirectoryExist path >>= cond (putStrLn $ path ++ " Exists") (putStrLn $ path ++ " Does not exist") cond b c a = if a then b else c
condisflip boolif you importData.Bool.