From 97d9ff33d71eb70e5e3e97906abb4fc97c948ca3 Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Fri, 2 Jan 2009 14:53:25 +0000 Subject: [PATCH] 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. --- Control/Exception/Base.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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")) -- 1.7.10.4