Util.System

idris-1.3.4: Functional Programming Language with Dependent Types

License | BSD3
Maintainer | The Idris Community.
Safe Haskell | None
Language | Haskell2010

Util.System

Description

Synopsis

- tempfile :: String -> IO (FilePath, Handle)
- withTempdir :: String -> (FilePath -> IO a) -> IO a
- rmFile :: FilePath -> IO ()
- catchIO :: IO a -> (IOError -> IO a) -> IO a
- isDarwin :: Bool
- isWindows :: Bool
- writeSource :: FilePath -> String -> IO ()
- writeSourceText :: FilePath -> Text -> IO ()
- readSource :: FilePath -> IO String
- readSourceStrict :: FilePath -> IO String
- setupBundledCC :: IO ()
- isATTY :: IO Bool

# Documentation

tempfile :: String -> IO (FilePath, Handle) #

Create a temp file with the extensiom ext (in the format ".xxx")

withTempdir :: String -> (FilePath -> IO a) -> IO a #

rmFile :: FilePath -> IO () #

catchIO :: IO a -> (IOError -> IO a) -> IO a #

isDarwin :: Bool #

isWindows :: Bool #

writeSource :: FilePath -> String -> IO () #

Write a source file, same as writeFile except the encoding is set to utf-8

writeSourceText :: FilePath -> Text -> IO () #

Write a utf-8 source file from Text

readSource :: FilePath -> IO String #

Read a source file, same as readFile but make sure the encoding is utf-8.

readSourceStrict :: FilePath -> IO String #

Read a source file, make sure that the it all has been read before exiting the function. | This is useful when we want to write the file again and need it to be closed.

setupBundledCC :: IO () #

isATTY :: IO Bool #