Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
87814219
Commit
87814219
authored
May 14, 2008
by
Ian Lynagh
Browse files
Define bracketOnError in compat; fixes the build for GHC 6.4
parent
8bcb5b64
Changes
2
Hide whitespace changes
Inline
Side-by-side
Distribution/Compat/Exception.hs
deleted
100644 → 0
View file @
8bcb5b64
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -cpp #-}
{-# OPTIONS_NHC98 -cpp #-}
{-# OPTIONS_JHC -fcpp #-}
-- #hide
module
Distribution.Compat.Exception
(
bracketOnError
)
where
import
Control.Exception
as
Exception
#
if
defined
(
__GLASGOW_HASKELL__
)
&&
(
__GLASGOW_HASKELL__
<
606
)
bracketOnError
::
IO
a
-- ^ computation to run first (\"acquire resource\")
->
(
a
->
IO
b
)
-- ^ computation to run last (\"release resource\")
->
(
a
->
IO
c
)
-- ^ computation to run in-between
->
IO
c
-- returns the value from the in-between computation
bracketOnError
before
after
thing
=
Exception
.
block
(
do
a
<-
before
Exception
.
catch
(
Exception
.
unblock
(
thing
a
))
(
\
e
->
do
{
after
a
;
Exception
.
throw
e
}))
#
endif
Distribution/Simple/Utils.hs
View file @
87814219
...
...
@@ -137,7 +137,7 @@ import System.IO
import
System.IO.Error
as
IO.Error
(
try
)
import
qualified
Control.Exception
as
Exception
(
bracket
,
bracket_
,
catch
,
finally
)
(
bracket
,
bracket_
,
bracketOnError
,
catch
,
finally
)
import
Distribution.Text
(
display
)
...
...
@@ -159,7 +159,6 @@ import qualified Control.Exception as Exception
(
throwIO
)
#
endif
import
Distribution.Compat.Exception
as
Exception
(
bracketOnError
)
import
Distribution.Compat.TempFile
(
openTempFile
,
openBinaryTempFile
)
import
Distribution.Verbosity
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment