ghc-mod-4.1.2: Happy Haskell Programming

Safe HaskellNone

Language.Haskell.GhcMod

Contents

Description

The ghc-mod library.

Synopsis

Cradle

data Cradle Source

The environment where this library is used.

Constructors

Cradle 

Fields

cradleCurrentDir :: FilePath

The directory where this library is executed.

cradleRootDir :: FilePath

The project root directory.

cradleCabalFile :: Maybe FilePath

The file name of the found cabal file.

cradlePkgDbStack :: [GhcPkgDb]

Package database stack

Instances

findCradle :: IO CradleSource

Finding Cradle. Find a cabal file by tracing ancestor directories. Find a sandbox according to a cabal sandbox config in a cabal directory.

Options

data Options Source

Constructors

Options 

Fields

outputStyle :: OutputStyle
 
hlintOpts :: [String]
 
ghcOpts :: [GHCOption]
 
operators :: Bool

If True, browse also returns operators.

detailed :: Bool

If True, browse also returns types.

qualified :: Bool

If True, browse will return fully qualified name

lineSeparator :: LineSeparator

Line separator string.

newtype LineSeparator Source

The type for line separator. Historically, a Null string is used.

Constructors

LineSeparator String 

data OutputStyle Source

Output style.

Constructors

LispStyle

S expression style.

PlainStyle

Plain textstyle.

Types

type ModuleString = StringSource

Module name.

type Expression = StringSource

Haskell expression.

IO utilities

bootInfo :: Options -> Cradle -> IO StringSource

Printing necessary information for front-end booting.

browseModuleSource

Arguments

:: Options 
-> Cradle 
-> ModuleString

A module name. (e.g. "Data.List")

-> 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.

checkSyntaxSource

Arguments

:: Options 
-> Cradle 
-> [FilePath]

The target files.

-> IO String 

Checking syntax of a target file using GHC. Warnings and errors are returned.

lintSyntaxSource

Arguments

:: Options 
-> FilePath

A target file.

-> IO String 

Checking syntax of a target file using hlint. Warnings and errors are returned.

expandTemplateSource

Arguments

:: Options 
-> Cradle 
-> [FilePath]

The target files.

-> IO String 

Expanding Haskell Template.

infoExprSource

Arguments

:: Options 
-> Cradle 
-> FilePath

A target file.

-> Expression

A Haskell expression.

-> IO String 

Obtaining information of a target expression. (GHCi's info:)

typeExprSource

Arguments

:: Options 
-> Cradle 
-> FilePath

A target file.

-> Int

Line number.

-> Int

Column number.

-> IO String 

Obtaining type of a target expression. (GHCi's type:)

listModules :: Options -> Cradle -> IO StringSource

Listing installed modules.

listLanguages :: Options -> IO StringSource

Listing language extensions.

listFlags :: Options -> IO StringSource

Listing GHC flags. (e.g -fno-warn-orphans)

debugInfo :: Options -> Cradle -> IO StringSource

Obtaining debug information.

rootInfo :: Options -> Cradle -> IO StringSource

Obtaining root information.

packageDoc :: Options -> Cradle -> ModuleString -> IO StringSource

Obtaining the package name and the doc path of a module.

findSymbol :: Options -> Cradle -> Symbol -> IO StringSource

Finding modules to which the symbol belong.