Effective Haskell: bad `Right` in the last listing (page 223)

handleArgs :: IO (Either String FilePath)
handleArgs =
  -- placeholder
  where
    parseArgs argumentList =
      case argumentList of
        [] -> Left "Error: No arguments provided!"
        (arg:args) -> Right args

According to the previous text Whether we pass a single argument or several arguments, we’re always printing out the first thing that was passed in., the last line should probably be

        (arg:_) -> Right arg
1 Like

great catch- thanks!