diff --git a/app/ghcup/Main.hs b/app/ghcup/Main.hs index cfb4c15..339d3c0 100644 --- a/app/ghcup/Main.hs +++ b/app/ghcup/Main.hs @@ -1244,8 +1244,12 @@ Report bugs at |] -- Getting download and platform info -- ---------------------------------------- + -- for some commands we want lazy loading + let wrapIO = case optCommand of + Whereis _ _ -> unsafeInterleaveIO + _ -> id - pfreq <- unsafeInterleaveIO $ ( + pfreq <- wrapIO $ ( runLogger . runE @'[NoCompatiblePlatform, NoCompatibleArch, DistroNotFound] . liftE $ platformRequest ) >>= \case VRight r -> pure r @@ -1254,7 +1258,7 @@ Report bugs at |] ($(logError) $ T.pack $ prettyShow e) exitWith (ExitFailure 2) - ghcupInfo <- unsafeInterleaveIO $ + ghcupInfo <- wrapIO $ ( runLogger . runE @'[JSONError , DownloadFailed, FileDoesNotExistError] $ liftE