diff --git a/src/IOExtra.hs b/src/IOExtra.hs
new file mode 100644
--- /dev/null
+++ b/src/IOExtra.hs
@@ -0,0 +1,26 @@
+-----------------------------------------------------------------------------------------
+{-| Module      :  IOExtra
+    Copyright   :  (c) Dave Tapley 2011
+    License     :  BSD-style
+
+    Maintainer  :  wxhaskell-devel@lists.sourceforge.net
+
+    Defines most of the classes in wxWindows.
+-}
+-----------------------------------------------------------------------------------------
+module IOExtra( writeFileLazy ) where
+
+import Control.Exception
+import Control.Monad
+import System.Directory
+import System.Environment
+import System.IO.Error
+import qualified System.IO.Strict as Strictly
+
+{-----------------------------------------------------------------------------------------
+Only write to the file if its contents have changed,
+e.g. don't change the file's modifed time unless you change the contents.
+-----------------------------------------------------------------------------------------}
+writeFileLazy :: FilePath -> String -> IO ()
+writeFileLazy f str = fileChanged >>= flip when (writeFile f str)
+    where fileChanged = return . either (const True) (/= str)  =<< tryJust (guard . isDoesNotExistError) (Strictly.readFile f)
diff --git a/wxdirect.cabal b/wxdirect.cabal
--- a/wxdirect.cabal
+++ b/wxdirect.cabal
@@ -1,5 +1,5 @@
 name:         wxdirect
-version:      0.13.1
+version:      0.13.1.1
 license:      BSD3
 license-file: LICENSE
 author:       Daan Leijen
@@ -50,6 +50,7 @@
                , CompileSTC
                , DeriveTypes
                , HaskellNames
+               , IOExtra
                , MultiSet
                , ParseC
                , ParseEiffel
