hhp-0.0.3: Happy Haskell Programming

Safe HaskellNone
LanguageHaskell2010

Hhp.Internal

Contents

Description

The Happy Haskell Programming library in low level.

Synopsis

Types

type GHCOption = String Source #

A single GHC command line option.

type Package = (PackageBaseName, PackageVersion, PackageId) Source #

A package's name, verson and id.

type PackageBaseName = String Source #

A package name.

type PackageVersion = String Source #

A package version.

type PackageId = String Source #

A package id.

type IncludeDir = FilePath Source #

An include directory for modules.

data CompilerOptions Source #

Option information for GHC

Constructors

CompilerOptions 

Fields

Cabal API

parseCabalFile :: FilePath -> IO PackageDescription Source #

Parsing a cabal file and returns PackageDescription. IOException is thrown if parsing fails.

getCompilerOptions :: [GHCOption] -> Cradle -> PackageDescription -> IO CompilerOptions Source #

Getting necessary CompilerOptions from three information sources.

cabalAllBuildInfo :: PackageDescription -> [BuildInfo] Source #

Extracting all BuildInfo for libraries, executables, and tests.

cabalDependPackages :: [BuildInfo] -> [PackageBaseName] Source #

Extracting package names of dependency.

cabalSourceDirs :: [BuildInfo] -> [IncludeDir] Source #

Extracting include directories for modules.

cabalAllTargets :: PackageDescription -> IO ([String], [String], [String], [String]) Source #

Extracting all Module FilePaths for libraries, executables, tests and benchmarks.

IO

getDynamicFlags :: IO DynFlags Source #

Return the DynFlags currently in use in the GHC session.

Targets

setTargetFiles :: [FilePath] -> Ghc () Source #

Set the files as targets and load them.

Logging

withLogger :: Options -> (DynFlags -> DynFlags) -> Ghc () -> Ghc (Either String String) Source #

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.

setNoWaringFlags :: DynFlags -> DynFlags Source #

Set DynFlags equivalent to "-w:".

setAllWaringFlags :: DynFlags -> DynFlags Source #

Set DynFlags equivalent to "-Wall".