Skip to content

Commit 048fe5d

Browse files
committed
hlint
1 parent dde5f22 commit 048fe5d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ghcide/src/Development/IDE/Plugin/CodeAction.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ codeAction lsp state _ (TextDocumentIdentifier uri) _range CodeActionContext{_di
8686
<*> use GhcSession `traverse` mbFile
8787
<*> use GetAnnotatedParsedSource `traverse` mbFile
8888
-- This is quite expensive 0.6-0.7s on GHC
89-
pkgExports <- fromMaybe mempty (envPackageExports <$> env)
89+
pkgExports <- maybe mempty envPackageExports env
9090
localExports <- readVar (exportsMap $ shakeExtras state)
9191
let
9292
exportsMap = localExports <> pkgExports

ghcide/src/Development/IDE/Types/HscEnvEq.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import TcRnMonad (initIfaceLoad, WhereFrom (ImportByUser))
2424
import LoadIface (loadInterface)
2525
import qualified Maybes
2626
import OpenTelemetry.Eventlog (withSpan)
27-
import Control.Monad.Extra (mapMaybeM, join)
27+
import Control.Monad.Extra (mapMaybeM, join, eitherM)
2828
import Control.Concurrent.Extra (newVar, modifyVar)
2929
import Control.Concurrent.Async (Async, async, waitCatch)
3030
import Control.Exception (throwIO, mask)
@@ -127,7 +127,7 @@ instance Binary HscEnvEq where
127127
onceAsync :: IO a -> IO (IO a)
128128
onceAsync act = do
129129
var <- newVar OncePending
130-
let run as = either throwIO pure =<< waitCatch as
130+
let run as = eitherM throwIO pure (waitCatch as)
131131
pure $ mask $ \unmask -> join $ modifyVar var $ \v -> case v of
132132
OnceRunning x -> pure (v, unmask $ run x)
133133
OncePending -> do

0 commit comments

Comments
 (0)