Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jeffrey young
hpc
Commits
d26eaafa
Commit
d26eaafa
authored
14 years ago
by
Ian Lynagh
Browse files
Options
Downloads
Patches
Plain Diff
Replace uses of the old catch function with the new one
parent
875b9103
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Trace/Hpc/Mix.hs
+2
-2
2 additions, 2 deletions
Trace/Hpc/Mix.hs
Trace/Hpc/Tix.hs
+6
-6
6 additions, 6 deletions
Trace/Hpc/Tix.hs
Trace/Hpc/Util.hs
+6
-0
6 additions, 0 deletions
Trace/Hpc/Util.hs
with
14 additions
and
8 deletions
Trace/Hpc/Mix.hs
+
2
−
2
View file @
d26eaafa
...
...
@@ -28,7 +28,7 @@ import Data.Char
-- been introduced in that module, accessed by tick-number position
-- in the list
import
Trace.Hpc.Util
(
HpcPos
,
insideHpcPos
,
Hash
,
HpcHash
(
..
))
import
Trace.Hpc.Util
(
HpcPos
,
insideHpcPos
,
Hash
,
HpcHash
(
..
)
,
catchIO
)
import
Trace.Hpc.Tix
-- | 'Mix' is the information about a modules static properties, like
...
...
@@ -98,7 +98,7 @@ readMix dirNames mod' = do
Left
_
->
True
Right
tix
->
h
==
tixModuleHash
tix
)
->
return
$
Just
r
_
->
return
$
Nothing
)
`
catch
`
(
\
_
->
return
$
Nothing
)
_
->
return
$
Nothing
)
`
catch
IO
`
(
\
_
->
return
$
Nothing
)
|
dirName
<-
dirNames
]
case
catMaybes
res
of
...
...
This diff is collapsed.
Click to expand it.
Trace/Hpc/Tix.hs
+
6
−
6
View file @
d26eaafa
...
...
@@ -9,7 +9,7 @@ module Trace.Hpc.Tix(Tix(..), TixModule(..),
readTix
,
writeTix
,
getTixFileName
)
where
import
Data.List
(
isSuffixOf
)
import
Trace.Hpc.Util
(
Hash
)
import
Trace.Hpc.Util
(
Hash
,
catchIO
)
-- 'Tix ' is the storage format for our dynamic imformation about what
-- boxes are ticked.
...
...
@@ -34,11 +34,11 @@ tixModuleTixs (TixModule _ _ _ tixs) = tixs
-- read a Tix File.
readTix
::
String
->
IO
(
Maybe
Tix
)
readTix
tix_filename
=
catch
(
do
contents
<-
readFile
$
tix_filename
return
$
Just
$
read
contents
)
(
\
_
->
return
$
Nothing
)
->
IO
(
Maybe
Tix
)
readTix
tix_filename
=
catch
IO
(
do
contents
<-
readFile
$
tix_filename
return
$
Just
$
read
contents
)
(
\
_
->
return
$
Nothing
)
-- write a Tix File.
writeTix
::
String
...
...
This diff is collapsed.
Click to expand it.
Trace/Hpc/Util.hs
+
6
−
0
View file @
d26eaafa
...
...
@@ -11,8 +11,10 @@ module Trace.Hpc.Util
,
insideHpcPos
,
HpcHash
(
..
)
,
Hash
,
catchIO
)
where
import
qualified
Control.Exception
as
Exception
import
Data.List
(
foldl'
)
import
Data.Char
(
ord
)
import
Data.Bits
(
xor
)
...
...
@@ -103,3 +105,7 @@ instance HpcHash HpcPos where
hxor
::
Hash
->
Hash
->
Hash
hxor
(
Hash
x
)
(
Hash
y
)
=
Hash
$
x
`
xor
`
y
catchIO
::
IO
a
->
(
Exception
.
IOException
->
IO
a
)
->
IO
a
catchIO
=
Exception
.
catch
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment