diff options
| author | Joey Hess <joeyh@joeyh.name> | 2016-12-26 12:08:02 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2016-12-26 12:09:38 -0400 |
| commit | 5605c9665e57b22c7415691984f31f75b3337cd9 (patch) | |
| tree | 8f5790d1bb4dab6220e21449caf6ed1d5f802405 /src/Utility/Misc.hs | |
| parent | 1d868470e4ec6ec6211206003279ac4bc8465c4f (diff) | |
| parent | 44bf67b7a2da75ef80e32d6409cc41a6ab8b6ffe (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Utility/Misc.hs')
| -rw-r--r-- | src/Utility/Misc.hs | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/Utility/Misc.hs b/src/Utility/Misc.hs index ebb42576..4498c0a0 100644 --- a/src/Utility/Misc.hs +++ b/src/Utility/Misc.hs @@ -10,9 +10,6 @@ module Utility.Misc where -import Utility.FileSystemEncoding -import Utility.Monad - import System.IO import Control.Monad import Foreign @@ -35,20 +32,6 @@ hGetContentsStrict = hGetContents >=> \s -> length s `seq` return s readFileStrict :: FilePath -> IO String readFileStrict = readFile >=> \s -> length s `seq` return s -{- Reads a file strictly, and using the FileSystemEncoding, so it will - - never crash on a badly encoded file. -} -readFileStrictAnyEncoding :: FilePath -> IO String -readFileStrictAnyEncoding f = withFile f ReadMode $ \h -> do - fileEncoding h - hClose h `after` hGetContentsStrict h - -{- Writes a file, using the FileSystemEncoding so it will never crash - - on a badly encoded content string. -} -writeFileAnyEncoding :: FilePath -> String -> IO () -writeFileAnyEncoding f content = withFile f WriteMode $ \h -> do - fileEncoding h - hPutStr h content - {- Like break, but the item matching the condition is not included - in the second result list. - |
