wxdirect 0.13.1 → 0.13.1.1
raw patch · 2 files changed
+28/−1 lines, 2 files
Files
- src/IOExtra.hs +26/−0
- wxdirect.cabal +2/−1
+ src/IOExtra.hs view
@@ -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)
wxdirect.cabal view
@@ -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