[Pkg-haskell-commits] [SCM] haskell-testpack branch, master, updated. debian/1.0.2-1-4-gb0d6b36
John Goerzen
jgoerzen at complete.org
Fri Apr 23 14:50:50 UTC 2010
The following commit has been merged in the master branch:
commit 50839b62310cc2bd236c13922af7ee9f21f8824f
Author: John Goerzen <jgoerzen at complete.org>
Date: Thu Dec 16 03:34:40 2004 +0100
Mroe EOF corrections
Keywords:
(jgoerzen at complete.org--projects/missingh--head--0.7--patch-75)
diff --git a/ChangeLog b/ChangeLog
index 4bfa169..96ca515 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,18 @@
# arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.7
#
+2004-12-15 20:34:40 GMT John Goerzen <jgoerzen at complete.org> patch-75
+
+ Summary:
+ Mroe EOF corrections
+ Revision:
+ missingh--head--0.7--patch-75
+
+
+ modified files:
+ ChangeLog libsrc/MissingH/HVIO.hs
+
+
2004-12-15 20:29:35 GMT John Goerzen <jgoerzen at complete.org> patch-74
Summary:
diff --git a/libsrc/MissingH/HVIO.hs b/libsrc/MissingH/HVIO.hs
index d8ea2a9..b39f465 100644
--- a/libsrc/MissingH/HVIO.hs
+++ b/libsrc/MissingH/HVIO.hs
@@ -63,6 +63,7 @@ class (Show a) => HVIOGeneric a where
vTestOpen :: a -> IO ()
-- | Whether or not we're at EOF. This may raise on exception
-- on some items, most notably write-only Handles such as stdout.
+ -- vIsEOF implementations must implicitly call vTestOpen.
vIsEOF :: a -> IO Bool
-- | Detailed show output.
vShow :: a -> IO String
@@ -74,7 +75,8 @@ class (Show a) => HVIOGeneric a where
-- May be Nothing.
vGetFP :: a -> IO (Maybe FilePath)
-- | Throw an isEOFError if we're at EOF; returns nothing otherwise.
- -- vTestEOF will implicitly call vTestOpen.
+ -- If an implementation overrides the default, make sure that it
+ -- calls vTestOpen at some point.
vTestEOF :: a -> IO ()
vShow x = return (show x)
@@ -88,8 +90,7 @@ class (Show a) => HVIOGeneric a where
fp <- vGetFP h
ioError (vMkIOError h et "" fp)
- vTestEOF h = do vTestOpen h
- e <- vIsEOF h
+ vTestEOF h = do e <- vIsEOF h
if e then vThrow h eofErrorType
else return ()
@@ -283,7 +284,8 @@ instance Show PipeReader where
instance HVIOGeneric PipeReader where
vClose = vioc_close . prv
vIsOpen = vioc_isopen . prv
- vIsEOF h = do mv <- vioc_get (prv h)
+ vIsEOF h = do vTestOpen h
+ mv <- vioc_get (prv h)
dat <- readMVar mv
return (dat == PipeEOF)
--
haskell-testpack
More information about the Pkg-haskell-commits
mailing list