| Maintainer | ongy, moepi | 
|---|---|
| Stability | testing | 
| Portability | Linux | 
| Safe Haskell | None | 
| Language | Haskell2010 | 
Monky.Utility
Description
This module provides utility functions used in monky modules
- readValue :: File -> IO Int
- readValueI :: File -> IO Integer
- readValues :: File -> IO [Int]
- fopen :: String -> IO File
- fclose :: File -> IO ()
- data File
- readLine :: LineReadable a => File -> IO a
- readContent :: FileReadable a => File -> IO [a]
- findLine :: Eq a => [a] -> [[a]] -> Maybe [a]
- splitAtEvery :: String -> String -> [String]
- maybeOpenFile :: Maybe String -> IO (Maybe File)
- sdivBound :: (Integral a, Bounded a) => a -> a -> a
- sdivUBound :: Integral a => a -> a -> a -> a
- listDirectory :: FilePath -> IO [FilePath]
- data UName
- getUname :: UName
- getKernelVersion :: (Word, Word)
Documentation
readValueI :: File -> IO Integer Source #
Read the first line of the file and convert it into an Integer
readValues :: File -> IO [Int] Source #
Read the first line of the file and convert the words in it into Ints
type alias to distinguish system functions from utility
readContent :: FileReadable a => File -> IO [a] Source #
Rewind the file descriptor and read the complete file as lines
maybeOpenFile :: Maybe String -> IO (Maybe File) Source #
fmap fopen would give Maybe (IO File), this fixes that
sdivBound :: (Integral a, Bounded a) => a -> a -> a infixl 7 Source #
0 save divide, uses maxbound for default value
sdivUBound :: Integral a => a -> a -> a -> a infixl 7 Source #
0 save divide, uses default value
listDirectory :: FilePath -> IO [FilePath] #
listDirectory dir. and ..).
The operation may fail with:
- HardwareFaultA physical I/O error has occurred.- [EIO]
- InvalidArgumentThe operand is not a valid directory name.- [ENAMETOOLONG, ELOOP]
- isDoesNotExistError/- NoSuchThingThe directory does not exist.- [ENOENT, ENOTDIR]
- isPermissionError/- PermissionDeniedThe process has insufficient privileges to perform the operation.- [EACCES]
- ResourceExhaustedInsufficient resources are available to perform the operation.- [EMFILE, ENFILE]
- InappropriateTypeThe path refers to an existing non-directory object.- [ENOTDIR]
Since: 1.2.5.0
The haskell type for Cs utsname (man uname)
getKernelVersion :: (Word, Word) Source #
Get the kernel version as (major, minor)