stack-1.3.2: The Haskell Tool Stack

Safe Haskell | None
Language | Haskell2010

Stack.Ghci

Description

Run a GHCi configured with the user's package(s).

Synopsis

- data GhciOpts = GhciOpts {
  - ghciTargets :: ![Text]
  - ghciArgs :: ![String]
  - ghciGhcCommand :: !(Maybe FilePath)
  - ghciNoLoadModules :: !Bool
  - ghciAdditionalPackages :: ![String]
  - ghciMainIs :: !(Maybe Text)
  - ghciLoadLocalDeps :: !Bool
  - ghciSkipIntermediate :: !Bool
  - ghciHidePackages :: !Bool
  - ghciNoBuild :: !Bool
  }
- data GhciPkgInfo = GhciPkgInfo {
  - ghciPkgName :: !PackageName
  - ghciPkgOpts :: ![(NamedComponent, BuildInfoOpts)]
  - ghciPkgDir :: !(Path Abs Dir)
  - ghciPkgModules :: !(Set ModuleName)
  - ghciPkgModFiles :: !(Set (Path Abs File))
  - ghciPkgCFiles :: !(Set (Path Abs File))
  - ghciPkgMainIs :: !(Map NamedComponent (Set (Path Abs File)))
  - ghciPkgTargetFiles :: !(Maybe (Set (Path Abs File)))
  - ghciPkgPackage :: !Package
  }
- data GhciException
  - = InvalidPackageOption String
  - | LoadingDuplicateModules
  - | MissingFileTarget String
  - | Can'tSpecifyFilesAndTargets
  - | Can'tSpecifyFilesAndMainIs
- ghci :: (StackM r m, HasEnvConfig r, MonadBaseUnlift IO m) => GhciOpts -> m ()
- renderScriptGhci :: [GhciPkgInfo] -> Maybe (Path Abs File) -> GhciScript
- renderScriptIntero :: [GhciPkgInfo] -> Maybe (Path Abs File) -> GhciScript

# Documentation

data GhciOpts #

Command-line options for GHC.

Constructors

GhciOpts |
Fields ghciTargets :: ![Text] ghciArgs :: ![String] ghciGhcCommand :: !(Maybe FilePath) ghciNoLoadModules :: !Bool ghciAdditionalPackages :: ![String] ghciMainIs :: !(Maybe Text) ghciLoadLocalDeps :: !Bool ghciSkipIntermediate :: !Bool ghciHidePackages :: !Bool ghciNoBuild :: !Bool

Instances

Show GhciOpts # |
Methods showsPrec :: Int -> GhciOpts -> ShowS # show :: GhciOpts -> String # showList :: [GhciOpts] -> ShowS #

data GhciPkgInfo #

Necessary information to load a package or its components.

Constructors

GhciPkgInfo |
Fields ghciPkgName :: !PackageName ghciPkgOpts :: ![(NamedComponent, BuildInfoOpts)] ghciPkgDir :: !(Path Abs Dir) ghciPkgModules :: !(Set ModuleName) ghciPkgModFiles :: !(Set (Path Abs File)) Module file paths. ghciPkgCFiles :: !(Set (Path Abs File)) C files. ghciPkgMainIs :: !(Map NamedComponent (Set (Path Abs File))) ghciPkgTargetFiles :: !(Maybe (Set (Path Abs File))) ghciPkgPackage :: !Package

Instances

Show GhciPkgInfo # |
Methods showsPrec :: Int -> GhciPkgInfo -> ShowS # show :: GhciPkgInfo -> String # showList :: [GhciPkgInfo] -> ShowS #

data GhciException #

Constructors

InvalidPackageOption String |
LoadingDuplicateModules |
MissingFileTarget String |
Can'tSpecifyFilesAndTargets |
Can'tSpecifyFilesAndMainIs |

Instances

Show GhciException # |
Methods showsPrec :: Int -> GhciException -> ShowS # show :: GhciException -> String # showList :: [GhciException] -> ShowS #
Exception GhciException # |
Methods toException :: GhciException -> SomeException # fromException :: SomeException -> Maybe GhciException # displayException :: GhciException -> String #

ghci :: (StackM r m, HasEnvConfig r, MonadBaseUnlift IO m) => GhciOpts -> m () #

Launch a GHCi session for the given local package targets with the given options and configure it with the load paths and extensions of those targets.

renderScriptGhci :: [GhciPkgInfo] -> Maybe (Path Abs File) -> GhciScript #

renderScriptIntero :: [GhciPkgInfo] -> Maybe (Path Abs File) -> GhciScript #