Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cycles.IO
- removeIfExists :: FilePath -> IO ()
- removeDirIfExists :: FilePath -> IO ()
- putStrLongLn :: String -> IO ()
- readInt :: String -> Int
- readIntList' :: String -> String -> [Int]
- readIntList :: String -> [Int]
- ifElseError :: Bool -> t -> t
- graphToNumCycles :: [[Int]] -> Bool -> IO Int
- processCycles :: String -> [[Int]] -> [[Int]]
- graphToCycles :: [[Int]] -> Bool -> IO [[Int]]
- graphToMaxcyCode :: [[Int]] -> Int -> String -> String -> IO String
- compileAllInDir :: String -> IO ()
- runAllInDir :: String -> IO ()
Documentation
removeIfExists :: FilePath -> IO ()
This function allows one to remove a file with included exception handling
removeDirIfExists :: FilePath -> IO ()
Like removeIfExists
, this function allows one to remove a file with included exception handling
putStrLongLn :: String -> IO ()
This function only prints a line when its length is > 2. It's useful, because without it, many of these function print blank lines when there are no compile/run errors.
readIntList' :: String -> String -> [Int]
Note: numStr is in little endian order
readIntList :: String -> [Int]
ifElseError :: Bool -> t -> t
This allows one to easily use monadic values for if-then
graphToNumCycles :: [[Int]] -> Bool -> IO Int
This function takes a graph and whether it is a digraph and returns the number of directed cycles in it
processCycles :: String -> [[Int]] -> [[Int]]
This function takes an output from the FindCy C code, performs a basic check ('is there a "done" mark?'), makes sure the output agrees with the expected graph, and reads the cycles into an [Int]
graphToCycles :: [[Int]] -> Bool -> IO [[Int]]
This function takes a graph and whether it is a digraph and returns a list of all directed cycles (somewhat slow, because it uses Haskell's read function)
graphToMaxcyCode :: [[Int]] -> Int -> String -> String -> IO String
This function takes a graph and automatically finds all cycles to output a string containing the C code to compute its maximally cyclic orientations
compileAllInDir :: String -> IO ()
This function does exactly what it says, for '.c' files
runAllInDir :: String -> IO ()
This function runs all the files in a given directory, ascertained by those filenames that do not include a .