Portability | Linux |
---|---|
Stability | testing |
Maintainer | ongy, moepi |
Safe Haskell | Safe-Inferred |
This module provides utility functions used in monky modules
- readValue :: File -> IO Int
- 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 :: String -> IO [String]
Documentation
readValues :: File -> IO [Int]Source
Read the first line of the file and convert the words in it into Int
s
readContent :: FileReadable a => File -> IO [a]Source
Rewind the file descriptor and read the complete file as lines
splitAtEvery :: String -> String -> [String]Source
Split ys at every occurence of xs
maybeOpenFile :: Maybe String -> IO (Maybe File)Source
fmap fopen would give Maybe (IO File), this fixes that
sdivBound :: (Integral a, Bounded a) => a -> a -> aSource
0 save divide, uses maxbound for default value
sdivUBound :: Integral a => a -> a -> a -> aSource
0 save divide, uses default value
listDirectory :: String -> IO [String]Source