Retrieve ghci options for your cabal project
- cabalSet :: String -> IO String
- packageOpts :: FilePath -> PackageDescription -> String -> Maybe [String]
- loadCabal :: FilePath -> FlagAssignment -> IO LoadCabalRet
- lookForCabalFile :: FilePath -> IO (Maybe FilePath)
- withOpts :: [String] -> (String -> IO a) -> ([String] -> IO a) -> IO a
- data LoadCabalRet
Installing into your .ghci
$ head -n 4 >> ~/.ghci :m + Distribution.Dev.Interactive :def cabalset cabalSet :cabalset :m - Distribution.Dev.Interactive
Arguments
-fflag
- enable flag
-f-flag
- disable flag
exec
- load options for the exec executable
Exported functions
cabalSet
returns a list of ghci commands (seperated by newlines) that :set the packageOpts
of the current cabal project
:: FilePath | path to the .cabal file |
-> PackageDescription | parsed package description |
-> String | name of executable |
-> Maybe [String] |
Build a list of ghci options needed to load files from a cabal project
:: FilePath | usually the current directory |
-> FlagAssignment | list of cabal flag assignments |
-> IO LoadCabalRet |
Load the current cabal project file and parse it
Find a .cabal file in the path or any of it's parent directories
:: [String] | List of cabal flag arguments and executable name |
-> (String -> IO a) | Error continuation. Recieves an error message. |
-> ([String] -> IO a) | Success continuation. Recieves a list of ghci arguments. |
-> IO a |
Generalised version of cabalSet
data LoadCabalRet Source
Return value for loadCabal
NoCabalFile | No cabal file found |
MissingDeps [Dependency] | Missing dependencies |
Pkg FilePath PackageDescription | Successful loading and parsing of cabal file |