From: simonmar Date: Tue, 16 Oct 2001 15:06:38 +0000 (+0000) Subject: [project @ 2001-10-16 15:06:38 by simonmar] X-Git-Tag: Approximately_9120_patches~821 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=e278884af83d750e962f765caf0b292207b32313;p=ghc-hetmet.git [project @ 2001-10-16 15:06:38 by simonmar] Add a Show instance for HandlePosn --- diff --git a/ghc/lib/std/PrelHandle.hsc b/ghc/lib/std/PrelHandle.hsc index 4a9dadc..73efbe5 100644 --- a/ghc/lib/std/PrelHandle.hsc +++ b/ghc/lib/std/PrelHandle.hsc @@ -4,7 +4,7 @@ #undef DEBUG -- ----------------------------------------------------------------------------- --- $Id: PrelHandle.hsc,v 1.16 2001/08/23 10:36:50 sewardj Exp $ +-- $Id: PrelHandle.hsc,v 1.17 2001/10/16 15:06:38 simonmar Exp $ -- -- (c) The University of Glasgow, 1994-2001 -- @@ -952,6 +952,10 @@ data HandlePosn = HandlePosn Handle HandlePosition instance Eq HandlePosn where (HandlePosn h1 p1) == (HandlePosn h2 p2) = p1==p2 && h1==h2 +instance Show HandlePosn where + showsPrec p (HandlePosn h pos) = + showsPrec p h . showString " at position " . shows pos + -- HandlePosition is the Haskell equivalent of POSIX' off_t. -- We represent it as an Integer on the Haskell side, but -- cheat slightly in that hGetPosn calls upon a C helper