-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Happy Haskell Programming
--
-- The hhp command is a backend command to enrich Haskell programming on
-- editors. The hhpc/hhpi commands are based on HHP library which is a
-- wrapper of GHC API and Cabal API. This package includes the hhpc
-- command, the hhpi command, the HHP library, and Emacs front-end. For
-- more information, please see its home page.
@package hhp
@version 0.0.2
-- | The Happy Haskell Programming library in low level.
module Hhp.Internal
-- | A single GHC command line option.
type GHCOption = String
-- | A package's name, verson and id.
type Package = (PackageBaseName, PackageVersion, PackageId)
-- | A package name.
type PackageBaseName = String
-- | A package version.
type PackageVersion = String
-- | A package id.
type PackageId = String
-- | An include directory for modules.
type IncludeDir = FilePath
-- | Option information for GHC
data CompilerOptions
CompilerOptions :: [GHCOption] -> [IncludeDir] -> [Package] -> CompilerOptions
-- | Command line options
[ghcOptions] :: CompilerOptions -> [GHCOption]
-- | Include directories for modules
[includeDirs] :: CompilerOptions -> [IncludeDir]
-- | Dependent package names
[depPackages] :: CompilerOptions -> [Package]
-- | Parsing a cabal file and returns PackageDescription.
-- IOException is thrown if parsing fails.
parseCabalFile :: FilePath -> IO PackageDescription
-- | Getting necessary CompilerOptions from three information
-- sources.
getCompilerOptions :: [GHCOption] -> Cradle -> PackageDescription -> IO CompilerOptions
-- | Extracting all BuildInfo for libraries, executables, and tests.
cabalAllBuildInfo :: PackageDescription -> [BuildInfo]
-- | Extracting package names of dependency.
cabalDependPackages :: [BuildInfo] -> [PackageBaseName]
-- | Extracting include directories for modules.
cabalSourceDirs :: [BuildInfo] -> [IncludeDir]
-- | Extracting all Module FilePaths for libraries,
-- executables, tests and benchmarks.
cabalAllTargets :: PackageDescription -> IO ([String], [String], [String], [String])
-- | Return the DynFlags currently in use in the GHC session.
getDynamicFlags :: IO DynFlags
-- | Set the files as targets and load them.
setTargetFiles :: [FilePath] -> Ghc ()
-- | Set the session flag (e.g. "-Wall" or "-w:") then executes a body. Log
-- messages are returned as String. Right is success and Left is
-- failure.
withLogger :: Options -> (DynFlags -> DynFlags) -> Ghc () -> Ghc (Either String String)
-- | Set DynFlags equivalent to "-w:".
setNoWaringFlags :: DynFlags -> DynFlags
-- | Set DynFlags equivalent to "-Wall".
setAllWaringFlags :: DynFlags -> DynFlags
-- | The Happy Haskell Programming library. API for interactive processes
module Hhp.Ghc
-- | Converting the Ghc monad to the IO monad.
withGHC :: FilePath -> Ghc a -> IO a
withGHC' :: Ghc a -> IO a
-- | Initialize the DynFlags relating to the compilation of a single
-- file or GHC session according to the Cradle and Options
-- provided.
initializeFlagsWithCradle :: Options -> Cradle -> Ghc ()
-- | Printing necessary information for front-end booting.
boot :: Options -> Ghc String
-- | Getting functions, classes, etc from a module. If detailed is
-- True, their types are also obtained. If operators is
-- True, operators are also returned.
browse :: Options -> ModuleString -> Ghc String
-- | Checking syntax of a target file using GHC. Warnings and errors are
-- returned.
check :: Options -> [FilePath] -> Ghc (Either String String)
-- | Obtaining information of a target expression. (GHCi's info:)
info :: Options -> FilePath -> Expression -> Ghc String
-- | Obtaining type of a target expression. (GHCi's type:)
types :: Options -> FilePath -> Int -> Int -> Ghc String
-- | Listing installed modules.
modules :: Options -> Ghc String
-- | Type of key for SymMdlDb.
type Symbol = String
-- | Database from Symbol to modules.
data SymMdlDb
-- | Creating SymMdlDb.
getSymMdlDb :: Ghc SymMdlDb
-- | Looking up SymMdlDb with Symbol to find modules.
lookupSym :: Options -> Symbol -> SymMdlDb -> String
-- | Obtaining the directory for system libraries.
getSystemLibDir :: IO (Maybe FilePath)
-- | The Happy Haskell Programming library. API for commands.
module Hhp
-- | The environment where this library is used.
data Cradle
Cradle :: FilePath -> FilePath -> Maybe FilePath -> [GhcPkgDb] -> Cradle
-- | The directory where this library is executed.
[cradleCurrentDir] :: Cradle -> FilePath
-- | The project root directory.
[cradleRootDir] :: Cradle -> FilePath
-- | The file name of the found cabal file.
[cradleCabalFile] :: Cradle -> Maybe FilePath
-- | Package database stack
[cradlePkgDbStack] :: Cradle -> [GhcPkgDb]
-- | Finding Cradle. Find a cabal file by tracing ancestor
-- directories. Find a sandbox according to a cabal sandbox config in a
-- cabal directory.
findCradle :: IO Cradle
data Options
Options :: OutputStyle -> [String] -> [GHCOption] -> Bool -> Bool -> Bool -> LineSeparator -> Options
[outputStyle] :: Options -> OutputStyle
[hlintOpts] :: Options -> [String]
[ghcOpts] :: Options -> [GHCOption]
-- | If True, browse also returns operators.
[operators] :: Options -> Bool
-- | If True, browse also returns types.
[detailed] :: Options -> Bool
-- | If True, browse will return fully qualified name
[qualified] :: Options -> Bool
-- | Line separator string.
[lineSeparator] :: Options -> LineSeparator
-- | The type for line separator. Historically, a Null string is used.
newtype LineSeparator
LineSeparator :: String -> LineSeparator
-- | Output style.
data OutputStyle
-- | S expression style.
LispStyle :: OutputStyle
-- | Plain textstyle.
PlainStyle :: OutputStyle
-- | A default Options.
defaultOptions :: Options
-- | Module name.
type ModuleString = String
-- | Haskell expression.
type Expression = String
-- | Printing necessary information for front-end booting.
bootInfo :: Options -> Cradle -> IO String
-- | Getting functions, classes, etc from a module. If detailed is
-- True, their types are also obtained. If operators is
-- True, operators are also returned.
browseModule :: Options -> Cradle -> ModuleString -> IO String
-- | Checking syntax of a target file using GHC. Warnings and errors are
-- returned.
checkSyntax :: Options -> Cradle -> [FilePath] -> IO String
-- | Checking syntax of a target file using hlint. Warnings and errors are
-- returned.
lintSyntax :: Options -> FilePath -> IO String
-- | Expanding Haskell Template.
expandTemplate :: Options -> Cradle -> [FilePath] -> IO String
-- | Obtaining information of a target expression. (GHCi's info:)
infoExpr :: Options -> Cradle -> FilePath -> Expression -> IO String
-- | Obtaining type of a target expression. (GHCi's type:)
typeExpr :: Options -> Cradle -> FilePath -> Int -> Int -> IO String
-- | Listing installed modules.
listModules :: Options -> Cradle -> IO String
-- | Listing language extensions.
listLanguages :: Options -> IO String
-- | Listing GHC flags. (e.g -Wno-orphans)
listFlags :: Options -> IO String
-- | Obtaining debug information.
debugInfo :: Options -> Cradle -> IO String
-- | Obtaining root information.
rootInfo :: Options -> Cradle -> IO String
-- | Obtaining the package name and the doc path of a module.
packageDoc :: Options -> Cradle -> ModuleString -> IO String
-- | Finding modules to which the symbol belong.
findSymbol :: Options -> Cradle -> Symbol -> IO String