From e278884af83d750e962f765caf0b292207b32313 Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 16 Oct 2001 15:06:38 +0000 Subject: [PATCH] [project @ 2001-10-16 15:06:38 by simonmar] Add a Show instance for HandlePosn --- ghc/lib/std/PrelHandle.hsc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 1.7.10.4