ghc-mod-3.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.

cradleCabalDir :: Maybe FilePath

The directory where a cabal file is found.

cradleCabalFile :: Maybe FilePath

The file name of the found cabal file.

cradlePackageDbOpts :: [GHCOption]

The package db options. (["-no-user-package-db","-package-db","/foo/bar/i386-osx-ghc-7.6.3-packages.conf.d"])

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 :: [String]
 
operators :: Bool

If True, browse also returns operators.

detailed :: Bool

If True, browse also returns types.

expandSplice :: Bool

Whether or not Template Haskell should be expanded.

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

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.

infoExprSource

Arguments

:: Options 
-> Cradle 
-> FilePath

A target file.

-> ModuleString

A module name.

-> Expression

A Haskell expression.

-> IO String 

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

typeExprSource

Arguments

:: Options 
-> Cradle 
-> FilePath

A target file.

-> ModuleString

A odule name.

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

debugInfoSource

Arguments

:: Options 
-> Cradle 
-> FilePath

A target file.

-> IO String 

Obtaining debug information.

Converting the Ghc monad to the IO monad

withGHCSource

Arguments

:: Alternative m 
=> FilePath

A target file displayed in an error message.

-> Ghc (m a)

Ghc actions created by the Ghc utilities.

-> IO (m a) 

Converting the Ghc monad to the IO monad.

withGHCDummyFileSource

Arguments

:: Alternative m 
=> Ghc (m a)

Ghc actions created by the Ghc utilities.

-> IO (m a) 

Converting the Ghc monad to the IO monad.

Ghc utilities

browseSource

Arguments

:: Options 
-> Cradle 
-> ModuleString

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

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

checkSource

Arguments

:: Options 
-> Cradle 
-> [FilePath]

The target files.

-> Ghc [String] 

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

infoSource

Arguments

:: Options 
-> Cradle 
-> FilePath

A target file.

-> ModuleString

A module name.

-> Expression

A Haskell expression.

-> Ghc String 

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

typeOfSource

Arguments

:: Options 
-> Cradle 
-> FilePath

A target file.

-> ModuleString

A odule name.

-> Int

Line number.

-> Int

Column number.

-> Ghc String 

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

listMods :: Options -> Cradle -> Ghc [String]Source

Listing installed modules.

debugSource

Arguments

:: Options 
-> Cradle 
-> FilePath

A target file.

-> Ghc [String] 

Obtaining debug information.