hie-bios-0.12.0: Set up a GHC API session

Safe Haskell | Safe-Inferred
Language | Haskell2010

HIE.Bios.Config

Description

Logic and datatypes for parsing `hie.yaml` files.

Synopsis

- readConfig :: FromJSON a => FilePath -> IO (Config a)
- newtype Config a = Config {
  - cradle :: CradleConfig a
  }
- data CradleConfig a = CradleConfig {
  - cradleDependencies :: [FilePath]
  - cradleType :: CradleType a
  }
- data CabalType
- pattern CabalType :: Maybe String -> CabalType
- cabalComponent :: CabalType -> Maybe String
- data StackType
- pattern StackType :: Maybe String -> Maybe String -> StackType
- stackComponent :: StackType -> Maybe String
- stackYaml :: StackType -> Maybe String
- data CradleType a
  - = Cabal {
    - cabalType :: !CabalType
    }
  - | CabalMulti {
    - defaultCabal :: !CabalType
    - subCabalComponents :: [(FilePath, CabalType)]
    }
  - | Stack {
    - stackType :: !StackType
    }
  - | StackMulti {
    - defaultStack :: !StackType
    - subStackComponents :: [(FilePath, StackType)]
    }
  - | Bios {
    - call :: Callable
    - depsCall :: Maybe Callable
    - ghcPath :: Maybe FilePath
    }
  - | Direct {
    - arguments :: [String]
    }
  - | None
  - | Multi [(FilePath, CradleConfig a)]
  - | Other {
    - otherConfig :: a
    - originalYamlValue :: Value
    }
- data Callable
  - = Program FilePath
  - | Command String

# Documentation

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

newtype Config a #

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 cradle :: CradleConfig a

#### Instances

Instances details

Functor Config # |
Instance details Defined in HIE.Bios.Config Methods fmap :: (a -> b) -> Config a -> Config b # (<$) :: a -> Config b -> Config a #
Show (Config a) # |
Instance details Defined in HIE.Bios.Config Methods showsPrec :: Int -> Config a -> ShowS show :: Config a -> String showList :: [Config a] -> ShowS
Eq a => Eq (Config a) # |
Instance details Defined in HIE.Bios.Config Methods (==) :: Config a -> Config a -> Bool (/=) :: Config a -> Config a -> Bool

data CradleConfig a #

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 # |
Instance details Defined in HIE.Bios.Config Methods fmap :: (a -> b) -> CradleConfig a -> CradleConfig b # (<$) :: a -> CradleConfig b -> CradleConfig a #
Show (CradleConfig a) # |
Instance details Defined in HIE.Bios.Config Methods showsPrec :: Int -> CradleConfig a -> ShowS show :: CradleConfig a -> String showList :: [CradleConfig a] -> ShowS
Eq a => Eq (CradleConfig a) # |
Instance details Defined in HIE.Bios.Config Methods (==) :: CradleConfig a -> CradleConfig a -> Bool (/=) :: CradleConfig a -> CradleConfig a -> Bool

data CabalType #

#### Instances

Instances details

Monoid CabalType # |
Instance details Defined in HIE.Bios.Config Methods mempty :: CabalType mappend :: CabalType -> CabalType -> CabalType mconcat :: [CabalType] -> CabalType
Semigroup CabalType # |
Instance details Defined in HIE.Bios.Config Methods (<>) :: CabalType -> CabalType -> CabalType # sconcat :: NonEmpty CabalType -> CabalType stimes :: Integral b => b -> CabalType -> CabalType
Show CabalType # |
Instance details Defined in HIE.Bios.Config Methods showsPrec :: Int -> CabalType -> ShowS show :: CabalType -> String showList :: [CabalType] -> ShowS
Eq CabalType # |
Instance details Defined in HIE.Bios.Config Methods (==) :: CabalType -> CabalType -> Bool (/=) :: CabalType -> CabalType -> Bool

pattern CabalType :: Maybe String -> CabalType #

cabalComponent :: CabalType -> Maybe String #

data StackType #

#### Instances

Instances details

Monoid StackType # |
Instance details Defined in HIE.Bios.Config Methods mempty :: StackType mappend :: StackType -> StackType -> StackType mconcat :: [StackType] -> StackType
Semigroup StackType # |
Instance details Defined in HIE.Bios.Config Methods (<>) :: StackType -> StackType -> StackType # sconcat :: NonEmpty StackType -> StackType stimes :: Integral b => b -> StackType -> StackType
Show StackType # |
Instance details Defined in HIE.Bios.Config Methods showsPrec :: Int -> StackType -> ShowS show :: StackType -> String showList :: [StackType] -> ShowS
Eq StackType # |
Instance details Defined in HIE.Bios.Config Methods (==) :: StackType -> StackType -> Bool (/=) :: StackType -> StackType -> Bool

pattern StackType :: Maybe String -> Maybe String -> StackType #

stackComponent :: StackType -> Maybe String #

stackYaml :: StackType -> Maybe String #

data CradleType a #

Constructors

Cabal |
Fields cabalType :: !CabalType
CabalMulti |
Fields defaultCabal :: !CabalType subCabalComponents :: [(FilePath, CabalType)]
Stack |
Fields stackType :: !StackType
StackMulti |
Fields defaultStack :: !StackType subStackComponents :: [(FilePath, StackType)]
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 arguments :: [String]
None |
Multi [(FilePath, CradleConfig a)] |
Other |
Fields otherConfig :: a originalYamlValue :: Value

#### Instances

Instances details

Functor CradleType # |
Instance details Defined in HIE.Bios.Config Methods fmap :: (a -> b) -> CradleType a -> CradleType b # (<$) :: a -> CradleType b -> CradleType a #
Show (CradleType a) # |
Instance details Defined in HIE.Bios.Config Methods showsPrec :: Int -> CradleType a -> ShowS show :: CradleType a -> String showList :: [CradleType a] -> ShowS
Eq a => Eq (CradleType a) # |
Instance details Defined in HIE.Bios.Config Methods (==) :: CradleType a -> CradleType a -> Bool (/=) :: CradleType a -> CradleType a -> Bool

data Callable #

Constructors

Program FilePath |
Command String |

#### Instances

Instances details

Show Callable # |
Instance details Defined in HIE.Bios.Config Methods showsPrec :: Int -> Callable -> ShowS show :: Callable -> String showList :: [Callable] -> ShowS
Eq Callable # |
Instance details Defined in HIE.Bios.Config Methods (==) :: Callable -> Callable -> Bool (/=) :: Callable -> Callable -> Bool