From: simonpj Date: Thu, 13 Dec 2001 10:48:29 +0000 (+0000) Subject: [project @ 2001-12-13 10:48:29 by simonpj] X-Git-Tag: Approximately_9120_patches~391 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=99a7c45faea79d98928bd5e02b7c60b4eba3cae9;p=ghc-hetmet.git [project @ 2001-12-13 10:48:29 by simonpj] Swap order of test; see comments in code --- diff --git a/ghc/lib/std/PrelNum.lhs b/ghc/lib/std/PrelNum.lhs index 4d0af57..e2cf190 100644 --- a/ghc/lib/std/PrelNum.lhs +++ b/ghc/lib/std/PrelNum.lhs @@ -1,5 +1,5 @@ % ------------------------------------------------------------------------------ -% $Id: PrelNum.lhs,v 1.42 2001/10/31 16:38:55 rrt Exp $ +% $Id: PrelNum.lhs,v 1.43 2001/12/13 10:48:29 simonpj Exp $ % % (c) The University of Glasgow, 1994-2000 % @@ -442,7 +442,10 @@ dn_list x delta lim = go (x::Integer) \begin{code} instance Show Integer where showsPrec p n r - | n < 0 && p > 6 = '(' : jtos n (')' : r) + | p > 6 && n < 0 = '(' : jtos n (')' : r) + -- Minor point: testing p first gives better code + -- in the not-uncommon case where the p argument + -- is a constant | otherwise = jtos n r showList = showList__ (showsPrec 0)