summaryrefslogtreecommitdiff
path: root/ghc/GhciTags.hs
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2010-12-18 23:08:27 +0000
committerIan Lynagh <igloo@earth.li>2010-12-18 23:08:27 +0000
commitacb9c929a4ab025972027b55b4c18d4410207d29 (patch)
treea1502e8dc4013f918fd6881316c2bdd856fa9293 /ghc/GhciTags.hs
parentb00e3a6c0a82a8af3238d677f798d812cd7fd49f (diff)
downloadhaskell-acb9c929a4ab025972027b55b4c18d4410207d29.tar.gz
Replace uses of the old try function with the new one
Diffstat (limited to 'ghc/GhciTags.hs')
-rw-r--r--ghc/GhciTags.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/ghc/GhciTags.hs b/ghc/GhciTags.hs
index c4b52f39c2..c2e6973e18 100644
--- a/ghc/GhciTags.hs
+++ b/ghc/GhciTags.hs
@@ -13,6 +13,7 @@ module GhciTags (
createETagsFileCmd
) where
+import Exception
import GHC
import GhciMonad
import Outputable
@@ -29,7 +30,7 @@ import Panic
import Data.List
import Control.Monad
import System.IO
-import System.IO.Error as IO
+import System.IO.Error
-----------------------------------------------------------------------------
-- create tags file for currently loaded modules.
@@ -130,18 +131,18 @@ collateAndWriteTags :: TagsKind -> FilePath -> [TagInfo] -> IO (Either IOError (
-- ctags style with the Ex exresion being just the line number, Vim et al
collateAndWriteTags CTagsWithLineNumbers file tagInfos = do
let tags = unlines $ sortLe (<=) $ map showCTag tagInfos
- IO.try (writeFile file tags)
+ tryIO (writeFile file tags)
-- ctags style with the Ex exresion being a regex searching the line, Vim et al
collateAndWriteTags CTagsWithRegExes file tagInfos = do -- ctags style, Vim et al
tagInfoGroups <- makeTagGroupsWithSrcInfo tagInfos
let tags = unlines $ sortLe (<=) $ map showCTag $concat tagInfoGroups
- IO.try (writeFile file tags)
+ tryIO (writeFile file tags)
collateAndWriteTags ETags file tagInfos = do -- etags style, Emacs/XEmacs
tagInfoGroups <- makeTagGroupsWithSrcInfo $filter tagExported tagInfos
let tagGroups = map processGroup tagInfoGroups
- IO.try (writeFile file $ concat tagGroups)
+ tryIO (writeFile file $ concat tagGroups)
where
processGroup [] = ghcError (CmdLineError "empty tag file group??")