mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
Add lifted directory operations in GF.System.Directory to eliminate the need for liftIO in various places
This commit is contained in:
@@ -1,7 +1,19 @@
|
||||
-- | Isolate backwards incompatible library changes to 'getModificationTime'
|
||||
module GF.System.Directory(getModificationTime,module D) where
|
||||
-- and provide lifted versions of some directory operations
|
||||
module GF.System.Directory(module GF.System.Directory,module D) where
|
||||
import Control.Monad.Trans(MonadIO(..))
|
||||
import qualified System.Directory as D
|
||||
import System.Directory as D hiding (getModificationTime)
|
||||
import System.Directory as D
|
||||
hiding (doesDirectoryExist,doesFileExist,getModificationTime,
|
||||
getCurrentDirectory,getDirectoryContents,removeFile)
|
||||
import Data.Time.Compat
|
||||
|
||||
getModificationTime path = fmap toUTCTime (D.getModificationTime path)
|
||||
doesDirectoryExist path = liftIO $ D.doesDirectoryExist path
|
||||
doesFileExist path = liftIO $ D.doesFileExist path
|
||||
getModificationTime path = liftIO $ fmap toUTCTime (D.getModificationTime path)
|
||||
getDirectoryContents path = liftIO $ D.getDirectoryContents path
|
||||
|
||||
getCurrentDirectory :: MonadIO io => io FilePath
|
||||
getCurrentDirectory = liftIO D.getCurrentDirectory
|
||||
|
||||
removeFile path = liftIO $ D.removeFile path
|
||||
Reference in New Issue
Block a user