From 7a6a119829aac0caeeccf56b90ca33845822556e Mon Sep 17 00:00:00 2001 From: Arjun Kathuria Date: Tue, 7 Sep 2021 14:21:24 +0530 Subject: [PATCH] Patch for MonadLogger deletion since new rebase --- lib/GHCup.hs | 11 +++++------ lib/GHCup/Utils.hs | 3 +-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/GHCup.hs b/lib/GHCup.hs index eb5a847..fa58f29 100644 --- a/lib/GHCup.hs +++ b/lib/GHCup.hs @@ -417,7 +417,7 @@ installCabalBindist :: ( MonadMask m m () installCabalBindist dlinfo ver isoFilepath forceInstall = do - lift $ $(logDebug) $ "Requested to install cabal version " <> prettyVer ver + lift $ logDebug $ "Requested to install cabal version " <> prettyVer ver PlatformRequest {..} <- lift getPlatformReq Dirs {..} <- lift getDirs @@ -429,7 +429,7 @@ installCabalBindist dlinfo ver isoFilepath forceInstall = do | forceInstall , regularCabalInstalled , Nothing <- isoFilepath -> do - lift $ $(logInfo) $ "Removing the currently installed version first!" + lift $ logInfo $ "Removing the currently installed version first!" liftE $ rmCabalVer ver | not forceInstall @@ -453,7 +453,7 @@ installCabalBindist dlinfo ver isoFilepath forceInstall = do case isoFilepath of Just isoDir -> do -- isolated install - lift $ $(logInfo) $ "isolated installing Cabal to " <> T.pack isoDir + lift $ logInfo $ "isolated installing Cabal to " <> T.pack isoDir liftE $ installCabalUnpacked workdir isoDir Nothing forceInstall Nothing -> do -- regular install @@ -465,7 +465,6 @@ installCabalBindist dlinfo ver isoFilepath forceInstall = do when (maybe True (ver >=) lInstCabal) $ liftE $ setCabal ver checkIfToolInstalled :: ( MonadIO m - , MonadLogger m , MonadReader env m , HasDirs env , MonadCatch m) => @@ -486,14 +485,14 @@ checkIfToolInstalled tool ver = do _ -> pure False -- | Install an unpacked cabal distribution.Symbol -installCabalUnpacked :: (MonadLogger m, MonadCatch m, MonadIO m) +installCabalUnpacked :: (MonadCatch m, HasLog env, MonadIO m, MonadReader env m) => FilePath -- ^ Path to the unpacked cabal bindist (where the executable resides) -> FilePath -- ^ Path to install to -> Maybe Version -- ^ Nothing for isolated install -> Bool -- ^ Force Install -> Excepts '[CopyError, FileAlreadyExistsError] m () installCabalUnpacked path inst mver' forceInstall = do - lift $ $(logInfo) "Installing cabal" + lift $ logInfo "Installing cabal" let cabalFile = "cabal" liftIO $ createDirRecursive' inst let destFileName = cabalFile diff --git a/lib/GHCup/Utils.hs b/lib/GHCup/Utils.hs index ad21d46..419a0cf 100644 --- a/lib/GHCup/Utils.hs +++ b/lib/GHCup/Utils.hs @@ -250,7 +250,6 @@ getInstalledGHCs = do -- | Get all installed cabals, by matching on @~\/.ghcup\/bin/cabal-*@. getInstalledCabals :: ( MonadReader env m , HasDirs env - , HasLog env , MonadIO m , MonadCatch m ) @@ -268,7 +267,7 @@ getInstalledCabals = do -- | Whether the given cabal version is installed. -cabalInstalled :: (HasLog env, MonadIO m, MonadReader env m, HasDirs env, MonadCatch m) => Version -> m Bool +cabalInstalled :: (MonadIO m, MonadReader env m, HasDirs env, MonadCatch m) => Version -> m Bool cabalInstalled ver = do vers <- fmap rights getInstalledCabals pure $ elem ver vers