diff options
author | simonpj@microsoft.com <unknown> | 2010-09-14 13:46:39 +0000 |
---|---|---|
committer | simonpj@microsoft.com <unknown> | 2010-09-14 13:46:39 +0000 |
commit | c3c5bee6961d5d94b900c6f430f8770262688ac5 (patch) | |
tree | 26cf34f28bc648171c3de03b8bc46cbf261bce64 /libraries/base/Control/Exception | |
parent | b6c6bc8730716c822b6e01d52e66c36502d248a2 (diff) | |
download | haskell-c3c5bee6961d5d94b900c6f430f8770262688ac5.tar.gz |
Add absentError.
This patch accompanies the HEAD patch:
Tue Sep 14 12:38:27 BST 2010 simonpj@microsoft.com
* Make absent-arg wrappers work for unlifted types (fix Trac #4306)
Previously we were simply passing arguments of unlifted
type to a wrapper, even if they were absent, which was
stupid.
See Note [Absent error Id] in WwLib.
Diffstat (limited to 'libraries/base/Control/Exception')
-rw-r--r-- | libraries/base/Control/Exception/Base.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libraries/base/Control/Exception/Base.hs b/libraries/base/Control/Exception/Base.hs index 1dc668b398..8ea4bf4bda 100644 --- a/libraries/base/Control/Exception/Base.hs +++ b/libraries/base/Control/Exception/Base.hs @@ -109,6 +109,7 @@ module Control.Exception.Base ( -- * Calls for GHC runtime recSelError, recConError, irrefutPatError, runtimeError, nonExhaustiveGuardsError, patError, noMethodBindingError, + absentError, nonTermination, nestedAtomically, #endif ) where @@ -705,12 +706,14 @@ instance Exception NestedAtomically #ifdef __GLASGOW_HASKELL__ recSelError, recConError, irrefutPatError, runtimeError, - nonExhaustiveGuardsError, patError, noMethodBindingError + nonExhaustiveGuardsError, patError, noMethodBindingError, + absentError :: Addr# -> a -- All take a UTF8-encoded C string recSelError s = throw (RecSelError ("No match in record selector " ++ unpackCStringUtf8# s)) -- No location info unfortunately runtimeError s = error (unpackCStringUtf8# s) -- No location info unfortunately +absentError s = error ("Oops! Entered absent arg " ++ unpackCStringUtf8# s) nonExhaustiveGuardsError s = throw (PatternMatchFail (untangle s "Non-exhaustive guards in")) irrefutPatError s = throw (PatternMatchFail (untangle s "Irrefutable pattern failed for pattern")) |