As part of this project, I'd like to validate the path of the file that's provided with passwords, i.e. pwds <- case cfgPasswords of Just passPath -> (map (Just . T.unpack) . lines) <$> readFileUtf8 passPath , in the case that the path for the file is not valid I'd like to log a message to that effect to the console.

How to accomplish this in Haskell?

logf' "Log level is {}" [show logLevel] setLogLevel logLevel debugf' "Configuration: {}" [show cfg] ncpus <- getNumProcessors logf' "Utilizing {} core(s)" [ncpus] setNumCapabilities ncpus pwds <- case cfgPasswords of Just passPath -> (map (Just . T.unpack) . lines) <$> readFileUtf8 passPath Nothing -> return $ replicate (length cfgPublicKeys) Nothing when (length cfgPublicKeys /= length cfgPrivateKeys) $ errorL' "The same amount of public keys and private keys must be specified" when (length cfgPublicKeys /= length pwds) $ errorL' "The same amount of passwords must be included in the passwords file as the number of private keys. (If a private key has no password, include a blank line.)" when (cfgPort == 0) $ errorL' "A listening port must be specified with 'port' in the configuration file or --port at runtime"