cabal-ghci-0.2.0: Set up ghci with options taken from a .cabal file

Distribution.Dev.Interactive

Contents

Description

Retrieve ghci options for your cabal project

Synopsis

Installing into your .ghci

   $ head -n 4 >> ~/.ghci
   :m + Distribution.Dev.Interactive
   :def cabalset cabalSet
   :cabalset -fcabal-ghci
   :m - Distribution.Dev.Interactive

Arguments

-fflag
enable flag
-f-flag
disable flag
exec
load options for the exec executable

Exported functions

cabalSetSource

Arguments

:: String

arguments seperated by spaces

-> IO String 

cabalSet returns a list of ghci commands (seperated by newlines) that :set the packageOpts of the current cabal project

packageOptsSource

Arguments

:: FilePath

path to the .cabal file

-> PackageDescription

parsed package description

-> Maybe LocalBuildInfo

parsed build config

-> String

name of executable

-> Maybe [String] 

Build a list of ghci options needed to load files from a cabal project

loadCabalSource

Arguments

:: FilePath

usually the current directory

-> FlagAssignment

list of cabal flag assignments

-> IO LoadCabalRet 

Load the current cabal project file and parse it

lookForCabalFileSource

Arguments

:: FilePath

canonicalised path

-> IO (Maybe FilePath) 

Find a .cabal file in the path or any of it's parent directories

withOptsSource

Arguments

:: [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

Constructors

NoCabalFile

No cabal file found

MissingDeps [Dependency]

Missing dependencies

Pkg FilePath PackageDescription (Maybe LocalBuildInfo)

Successful loading and parsing of cabal file

Instances