From d007fa817a24081258c6466f397983188a0424c1 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Mon, 28 Apr 2014 21:59:54 +0900 Subject: [PATCH] better names. --- Language/Haskell/GhcMod/Logger.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Language/Haskell/GhcMod/Logger.hs b/Language/Haskell/GhcMod/Logger.hs index 6cde57e..038fd97 100644 --- a/Language/Haskell/GhcMod/Logger.hs +++ b/Language/Haskell/GhcMod/Logger.hs @@ -48,7 +48,7 @@ appendLogRef df (LogRef ref) _ sev src style msg = do -- executes a body. Log messages are returned as 'String'. -- Right is success and Left is failure. withLogger :: Options -> (DynFlags -> DynFlags) -> Ghc () -> Ghc (Either String String) -withLogger opt setDF body = ghandle (handleErrMsg opt) $ do +withLogger opt setDF body = ghandle (sourceError opt) $ do logref <- liftIO $ newLogRef withDynFlags (setLogger logref . setDF) $ do body @@ -59,8 +59,8 @@ withLogger opt setDF body = ghandle (handleErrMsg opt) $ do ---------------------------------------------------------------- -- | Converting 'SourceError' to 'String'. -handleErrMsg :: Options -> SourceError -> Ghc (Either String String) -handleErrMsg opt err = do +sourceError :: Options -> SourceError -> Ghc (Either String String) +sourceError opt err = do dflag <- G.getSessionDynFlags style <- getStyle let ret = convert opt . errBagToStrList dflag style . srcErrorMessages $ err