hie-bios-0.6.2: Set up a GHC API session
Safe HaskellNone
LanguageHaskell2010

HIE.Bios.Config

Description

Logic and datatypes for parsing hie.yaml files.

Synopsis

Documentation

readConfig :: FromJSON a => FilePath -> IO (Config a) Source #

Decode given file to a 'Config a' value. Type variable a can be used to extend the 'hie.yaml' file format to extend configuration in the user-library. If the contents of the file is not a valid 'Config a', an IOException is thrown.

newtype Config a Source #

Configuration that can be used to load a Cradle. A configuration has roughly the following form:

cradle:
  cabal:
    component: "lib:hie-bios"

Constructors

Config 

Fields

Instances

Instances details
Functor Config Source # 
Instance details

Defined in HIE.Bios.Config

Methods

fmap :: (a -> b) -> Config a -> Config b #

(<$) :: a -> Config b -> Config a #

Eq a => Eq (Config a) Source # 
Instance details

Defined in HIE.Bios.Config

Methods

(==) :: Config a -> Config a -> Bool #

(/=) :: Config a -> Config a -> Bool #

Show (Config a) Source # 
Instance details

Defined in HIE.Bios.Config

Methods

showsPrec :: Int -> Config a -> ShowS #

show :: Config a -> String #

showList :: [Config a] -> ShowS #

FromJSON a => FromJSON (Config a) Source # 
Instance details

Defined in HIE.Bios.Config

Methods

parseJSON :: Value -> Parser (Config a)

parseJSONList :: Value -> Parser [Config a]

data CradleConfig a Source #

Constructors

CradleConfig 

Fields

  • cradleDependencies :: [FilePath]

    Dependencies of a cradle. Dependencies are expected to be relative to the root directory. The given files are not required to exist.

  • cradleType :: CradleType a

    Type of the cradle to use. Actions to obtain compiler flags from are dependant on this field.

Instances

Instances details
Functor CradleConfig Source # 
Instance details

Defined in HIE.Bios.Config

Methods

fmap :: (a -> b) -> CradleConfig a -> CradleConfig b #

(<$) :: a -> CradleConfig b -> CradleConfig a #

Eq a => Eq (CradleConfig a) Source # 
Instance details

Defined in HIE.Bios.Config

Show (CradleConfig a) Source # 
Instance details

Defined in HIE.Bios.Config

FromJSON a => FromJSON (CradleConfig a) Source # 
Instance details

Defined in HIE.Bios.Config

Methods

parseJSON :: Value -> Parser (CradleConfig a)

parseJSONList :: Value -> Parser [CradleConfig a]

data CradleType a Source #

Constructors

Cabal 
CabalMulti [(FilePath, String)] 
Stack 
StackMulti [(FilePath, String)] 
Bios 

Fields

  • call :: Callable

    Path to program or shell command that retrieves options to compile a file

  • depsCall :: Maybe Callable

    Optional path to program or shell command to obtain cradle dependencies. Each cradle dependency is to be expected to be on a separate line and relative to the root dir of the cradle.

  • ghcPath :: Maybe FilePath

    Optional path to the ghc binary

Direct 

Fields

None 
Multi [(FilePath, CradleConfig a)] 
Other 

Fields

Instances

Instances details
Functor CradleType Source # 
Instance details

Defined in HIE.Bios.Config

Methods

fmap :: (a -> b) -> CradleType a -> CradleType b #

(<$) :: a -> CradleType b -> CradleType a #

Eq a => Eq (CradleType a) Source # 
Instance details

Defined in HIE.Bios.Config

Methods

(==) :: CradleType a -> CradleType a -> Bool #

(/=) :: CradleType a -> CradleType a -> Bool #

Show (CradleType a) Source # 
Instance details

Defined in HIE.Bios.Config

FromJSON a => FromJSON (CradleType a) Source # 
Instance details

Defined in HIE.Bios.Config

Methods

parseJSON :: Value -> Parser (CradleType a)

parseJSONList :: Value -> Parser [CradleType a]

data Callable Source #

Instances

Instances details
Eq Callable Source # 
Instance details

Defined in HIE.Bios.Config

Show Callable Source # 
Instance details

Defined in HIE.Bios.Config