diff --git a/simple-pipe.cabal b/simple-pipe.cabal
--- a/simple-pipe.cabal
+++ b/simple-pipe.cabal
@@ -2,7 +2,7 @@
 cabal-version:	>= 1.8
 
 name:		simple-pipe
-version:	0.0.0.8
+version:	0.0.0.9
 stability:	Experimental
 author:		Yoshikuni Jujo <PAF01143@nifty.ne.jp>
 maintainer:	Yoshikuni Jujo <PAF01143@nifty.ne.jp>
@@ -87,7 +87,7 @@
 source-repository	this
     type:	git
     location:	git://github.com/YoshikuniJujo/simple-pipe.git
-    tag:	simple-pipe-0.0.0.8
+    tag:	simple-pipe-0.0.0.9
 
 library
     hs-source-dirs:	src
diff --git a/src/Data/Pipe/ByteString.hs b/src/Data/Pipe/ByteString.hs
--- a/src/Data/Pipe/ByteString.hs
+++ b/src/Data/Pipe/ByteString.hs
@@ -1,16 +1,24 @@
-{-# LANGUAGE FlexibleContexts, PackageImports #-}
+{-# LANGUAGE FlexibleContexts, ScopedTypeVariables, PackageImports #-}
 
 module Data.Pipe.ByteString (fromHandleLn, toHandleLn, fromFileLn, toFileLn) where
 
+import Control.Applicative
 import "monads-tf" Control.Monad.Trans
 import Control.Monad.Trans.Control
+import Control.Exception (catch)
 import Data.Pipe
 import System.IO
+import GHC.IO.Exception
 
 import qualified Data.ByteString.Char8 as BSC
 
 fromHandleLn :: MonadIO m => Handle -> Pipe () BSC.ByteString m ()
-fromHandleLn h = liftIO (BSC.hGetLine h) >>= (>> fromHandleLn h) . yield
+fromHandleLn h = do
+	ml <- liftIO $ (Just <$> BSC.hGetLine h) `catch` \(e :: IOException) ->
+		case ioe_type e of
+			EOF -> return Nothing
+			_ -> ioException e
+	maybe (return ()) ((>> fromHandleLn h) . yield) ml
 
 toHandleLn :: MonadIO m => Handle -> Pipe BSC.ByteString () m ()
 toHandleLn h =
diff --git a/src/Data/Pipe/IO.hs b/src/Data/Pipe/IO.hs
--- a/src/Data/Pipe/IO.hs
+++ b/src/Data/Pipe/IO.hs
@@ -1,14 +1,22 @@
-{-# LANGUAGE FlexibleContexts, PackageImports #-}
+{-# LANGUAGE FlexibleContexts, ScopedTypeVariables, PackageImports #-}
 
 module Data.Pipe.IO (fromHandle, toHandle, fromFile, toFile) where
 
+import Control.Applicative
 import "monads-tf" Control.Monad.Trans
 import Control.Monad.Trans.Control
+import Control.Exception (catch)
 import Data.Pipe
 import System.IO
+import GHC.IO.Exception
 
 fromHandle :: MonadIO m => Handle -> Pipe () Char m ()
-fromHandle h = liftIO (hGetChar h) >>= (>> fromHandle h) . yield
+fromHandle h = do
+	mc <- liftIO $ (Just <$> hGetChar h) `catch` \(e :: IOException) ->
+		case ioe_type e of
+			EOF -> return Nothing
+			_ -> ioException e
+	maybe (return ()) ((>> fromHandle h) . yield) mc
 
 toHandle :: MonadIO m => Handle -> Pipe Char () m ()
 toHandle h = await >>= maybe (return ()) ((>> toHandle h) . liftIO . hPutChar h)
