Skip to content

Commit c655372

Browse files
mapExceptT liftIO . ExceptT => ExceptT . liftIO
1 parent 817708f commit c655372

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

plugins/hls-fourmolu-plugin/src/Ide/Plugin/Fourmolu.hs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,9 @@ provider recorder plId ideState typ contents fp fo = ExceptT $ withIndefinitePro
7272
<$> liftIO (runAction "Fourmolu" ideState $ use GhcSession fp)
7373
useCLI <- liftIO $ runAction "Fourmolu" ideState $ usePropertyAction #external plId properties
7474
if useCLI
75-
then mapExceptT liftIO $ ExceptT
76-
$ handle @IOException
77-
(pure . Left . PluginInternalError . T.pack . show)
78-
$ runExceptT $ cliHandler fileOpts
75+
then ExceptT . liftIO $
76+
handle @IOException (pure . Left . PluginInternalError . T.pack . show) $
77+
runExceptT (cliHandler fileOpts)
7978
else do
8079
logWith recorder Debug $ LogCompiledInVersion VERSION_fourmolu
8180
FourmoluConfig{..} <-
@@ -104,7 +103,7 @@ provider recorder plId ideState typ contents fp fo = ExceptT $ withIndefinitePro
104103
, cfgDebug = False
105104
, cfgPrinterOpts = resolvePrinterOpts [lspPrinterOpts, cfgFilePrinterOpts]
106105
}
107-
mapExceptT liftIO $ ExceptT $
106+
ExceptT . liftIO $
108107
bimap (PluginInternalError . T.pack . show) (InL . makeDiffTextEdit contents)
109108
<$> try @OrmoluException (ormolu config fp' contents)
110109
where

0 commit comments

Comments
 (0)