ghc-mod-2.1.0: 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

cradlePackageConf :: Maybe FilePath

The sandbox directory (e.g. "/foo/bar/packages-<ver>.conf/")

Instances

findCradleSource

Arguments

:: Maybe FilePath

A FilePath for a sandbox

-> GHCVersion 
-> IO Cradle 

Finding Cradle. An error would be thrown.

GHC version

type GHCVersion = StringSource

GHC version in String

getGHCVersion :: IO (GHCVersion, Int)Source

Getting GHC version. 7.6.3 becames 706 in the second of the result.

Options

data Options Source

Constructors

Options 

Fields

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

If True, browse also returns types.

expandSplice :: Bool

Whether or not Template Haskell should be expanded.

sandbox :: Maybe FilePath

The sandbox directory.

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

checkSyntaxSource

Arguments

:: Options 
-> Cradle 
-> FilePath

A target file

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

checkSource

Arguments

:: Options 
-> Cradle 
-> FilePath

A target file

-> 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 -> Ghc [String]Source

Listing installed modules.

debugSource

Arguments

:: Options 
-> Cradle 
-> GHCVersion 
-> FilePath

A target file

-> Ghc [String] 

Obtaining debug information.