main :: IO ()
main = runScript $ do
  args <- scriptIO $ getArgs
  env  <- loadConfig
  fn   <- headMay args ?? usage
  e <- scriptIO . runApp env . loadAndInsert $ fn
  scriptIO . putStrLn . either appErrorString successString $ e
main :: IO ()
main = runScript $ do
  args <- scriptIO $ getArgs
  env  <- loadConfig
  fn   <- headMay args ?? usage
  e <- scriptIO . runApp env . loadAndInsert $ fn
  scriptIO . putStrLn . either appErrorString successString $ e
main = runScript $ do
  args <- scriptIO $ getArgs
  env  <- loadConfig
  fn   <- headMay args ?? usage
  e <- scriptIO . runApp env . loadAndInsert $ fn
  scriptIO . putStrLn . either appErrorString successString $ e