main :: IO ()
main = do
  baseURl <- getBaseUrlArg
  getCurrentDirectory >>= print
  statisticsStore <- Arch.getPackagesStats "packageStatistics.json"
  case statisticsStore of
    Right y -> do
      let readState = ArchCompareReadState baseURl y
      scottyT 3000 (\x -> runReaderT x readState) $ do
       get (literal "/comparePackage") $ comparePackageHandler
       get "/comparePackage" $ comparePackageFormHandler
       get "" $ comparePackageFormHandler
       get (comparePackageRouteMatcher "/comparePackage") $ comparePackageHandler
    Left e -> error $ "Unable to find data store: " ++ e
main :: IO ()
main = do
  baseURl <- getBaseUrlArg
  getCurrentDirectory >>= print
  statisticsStore <- Arch.getPackagesStats "packageStatistics.json"
  case statisticsStore of
    Right y -> do
      let readState = ArchCompareReadState baseURl y
      scottyT 3000 (\x -> runReaderT x readState) $ do
       get (literal "/comparePackage") $ comparePackageHandler
       get "/comparePackage" $ comparePackageFormHandler
       get "" $ comparePackageFormHandler
       get (comparePackageRouteMatcher "/comparePackage") $ comparePackageHandler
    Left e -> error $ "Unable to find data store: " ++ e
main = do
  baseURl <- getBaseUrlArg
  getCurrentDirectory >>= print
  statisticsStore <- Arch.getPackagesStats "packageStatistics.json"
  case statisticsStore of
    Right y -> do
      let readState = ArchCompareReadState baseURl y
      scottyT 3000 (\x -> runReaderT x readState) $ do
       get (literal "/comparePackage") $ comparePackageHandler
       get "/comparePackage" $ comparePackageFormHandler
       get "" $ comparePackageFormHandler
       get (comparePackageRouteMatcher "/comparePackage") $ comparePackageHandler
    Left e -> error $ "Unable to find data store: " ++ e