From: simonpj@microsoft.com Date: Fri, 2 Jan 2009 14:53:25 +0000 (+0000) Subject: More compact error messages for record selectors X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=97d9ff33d71eb70e5e3e97906abb4fc97c948ca3;p=ghc-base.git More compact error messages for record selectors Make recSelError generate the standard part of the record selector error message (i.e. "No match in record selector") rather than have that string duplicated for every record selector. --- diff --git a/Control/Exception/Base.hs b/Control/Exception/Base.hs index b6893fb..f9f20f8 100644 --- a/Control/Exception/Base.hs +++ b/Control/Exception/Base.hs @@ -669,8 +669,9 @@ recSelError, recConError, irrefutPatError, runtimeError, nonExhaustiveGuardsError, patError, noMethodBindingError :: Addr# -> a -- All take a UTF8-encoded C string -recSelError s = throw (RecSelError (unpackCStringUtf8# s)) -- No location info unfortunately -runtimeError s = error (unpackCStringUtf8# s) -- No location info unfortunately +recSelError s = throw (RecSelError ("No match in record selector " + ++ unpackCStringUtf8# s)) -- No location info unfortunately +runtimeError s = error (unpackCStringUtf8# s) -- No location info unfortunately nonExhaustiveGuardsError s = throw (PatternMatchFail (untangle s "Non-exhaustive guards in")) irrefutPatError s = throw (PatternMatchFail (untangle s "Irrefutable pattern failed for pattern"))