diff --git a/System/IO/Streams/SHA.hs b/System/IO/Streams/SHA.hs
--- a/System/IO/Streams/SHA.hs
+++ b/System/IO/Streams/SHA.hs
@@ -58,14 +58,20 @@
 checkedSha512Input' :: String -> InputStream ByteString -> IO (InputStream ByteString)
 checkedSha512Input' = checkedShaInput sha512Incremental completeSha512Incremental
 
+-- | Strict pairs.
+data Pair a b = Pair !a !b
+
+uncurry' :: (a -> b -> c) -> Pair a b -> c
+uncurry' f (Pair a b) = f a b
+
 -- | Inspired by `S.countInput`. The returned IO action can be run only
 -- when the input stream is exhausted, otherwise an error occurs.
 shaInput :: Decoder a -> (Decoder a -> Int -> Digest a)
   -> InputStream ByteString -> IO (InputStream ByteString, IO (Digest a))
 shaInput increment end is = do
-  ref <- newIORef (increment, 0)
+  ref <- newIORef $ Pair increment 0
   is' <- S.makeInputStream $ prod ref
-  return $! (is', readIORef ref >>= uncurry complete)
+  return $! (is', readIORef ref >>= uncurry' complete)
 
   where
 
@@ -73,18 +79,18 @@
     mbs <- S.read is
     maybe
       (return Nothing)
-      (\bs -> (modifyRef ref (uncurry $ modify bs)) >> (return $! Just bs))
+      (\bs -> (modifyRef ref (uncurry' $ modify bs)) >> (return $! Just bs))
       mbs
 
   complete decoder c = return $! end decoder c
-  modify bs decoder c = (pushChunk decoder bs, c + (fromIntegral $ C.length bs))
+  modify bs decoder c = Pair (pushChunk decoder bs) (c + (fromIntegral $ C.length bs))
 
 -- | This returns an input stream exactly as the one being wrapped, but throws
 -- an error if the computed SHA hash does not match the one given.
 checkedShaInput :: Decoder a -> (Decoder a -> Int -> Digest a)
   -> String -> InputStream ByteString -> IO (InputStream ByteString)
 checkedShaInput increment end digest is = do
-  ref <- newIORef (increment, 0)
+  ref <- newIORef $ Pair increment 0
   is' <- S.makeInputStream $ prod ref
   return $! is'
 
@@ -94,15 +100,15 @@
     mbs <- S.read is
     maybe
       (do r <- readIORef ref
-          digest' <- uncurry complete r
+          digest' <- uncurry' complete r
           if digest == showDigest digest'
             then return Nothing
             else throwIO UnmatchedSHAException)
-      (\bs -> (modifyRef ref (uncurry $ modify bs)) >> (return $! Just bs))
+      (\bs -> (modifyRef ref (uncurry' $ modify bs)) >> (return $! Just bs))
       mbs
 
   complete decoder c = return $! end decoder c
-  modify bs decoder c = (pushChunk decoder bs, c + (fromIntegral $ C.length bs))
+  modify bs decoder c = Pair (pushChunk decoder bs) (c + (fromIntegral $ C.length bs))
 
 -- | Taken from System.IO.Streams.ByteString.
 {-# INLINE modifyRef #-}
diff --git a/bin/sha-streams.hs b/bin/sha-streams.hs
--- a/bin/sha-streams.hs
+++ b/bin/sha-streams.hs
@@ -1,5 +1,6 @@
 module Main (main) where
 
+import System.Environment (getArgs)
 import qualified System.IO.Streams as S
 
 import Data.Digest.Pure.SHA
@@ -7,7 +8,8 @@
 
 main :: IO ()
 main = do
-  d1 <- S.withFileAsInput "bin/sha-streams.hs" $ \is -> do
+  [filename] <- getArgs
+  d1 <- S.withFileAsInput filename $ \is -> do
     (is1, getSha1) <- sha1Input is
     (is224, getSha224) <- sha224Input is1
     (is256, getSha256) <- sha256Input is224
@@ -22,7 +24,8 @@
     getSha512 >>= putStrLn . showDigest
     return d1
 
-  -- This must throw an UnmatchedSHAException.
+  -- This must throw an UnmatchedSHAException (unless `filename` above is
+  -- "System/IO/Streams/SHA.hs").
   S.withFileAsInput "System/IO/Streams/SHA.hs" $ \is -> do
     (is1, _) <- sha1Input is
     is1' <- checkedSha1Input d1 is1
diff --git a/sha-streams.cabal b/sha-streams.cabal
--- a/sha-streams.cabal
+++ b/sha-streams.cabal
@@ -1,5 +1,5 @@
 name:                sha-streams
-version:             0.1.0
+version:             0.1.1
 Cabal-Version:       >= 1.8
 synopsis:            SHA hashes for io-streams.
 description:         SHA hashes for io-streams.
