Add a Show instance for HandlePosn
#undef DEBUG
-- -----------------------------------------------------------------------------
#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
--
--
-- (c) The University of Glasgow, 1994-2001
--
instance Eq HandlePosn where
(HandlePosn h1 p1) == (HandlePosn h2 p2) = p1==p2 && h1==h2
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
-- 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