All pastes #2073867 Raw Edit

Untitled

public text v1 · immutable
#2073867 ·published 2011-06-02 21:28 UTC
rendered paste body
main :: IO ()
main = handleSqlError $ do
          config <- liftM P.parseConfig $ readFile "blah.ini"
          case config of
              Left err -> error $ show err
              Right xs -> map runCfg xs

--runCfg :: (String, [(String, String)]) -> IO ()
runCfg c = let cfg   = M.fromListWith (++) $ map (\ (k, v) -> (k, [v]) ) $ snd c
               sorIO = connectODBC $ svlu "_ODBC1" cfg
               carIO = connectODBC $ svlu "_ODBC2" cfg
           in do
               sconn   <- sIO
...
                       putStrLn $ "Mismatched between SOR and carrier: " ++ mismatch




---------------------------------
GHC sez:

Couldn't match expected type `IO a0' with actual type `[Char]'
Expected type: IO a0
  Actual type: String
In the expression: show $ map runCfg xs


using

runCfg $ head xs

in place of

map runCfg xs

works.  So I think I just can't use map like I want to.  For some reason.