Safe Haskell | None |
---|---|
Language | Haskell2010 |
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 CradleType a
- = Cabal { }
- | CabalMulti [(FilePath, String)]
- | Stack { }
- | StackMulti [(FilePath, String)]
- | Bios { }
- | Direct { }
- | None
- | Multi [(FilePath, CradleConfig a)]
- | Other {
- otherConfig :: a
- originalYamlValue :: Value
- data Callable
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.
Configuration that can be used to load a Cradle
.
A configuration has roughly the following form:
cradle: cabal: component: "lib:hie-bios"
Config | |
|
data CradleConfig a Source #
CradleConfig | |
|
Instances
Functor CradleConfig Source # | |
Defined in HIE.Bios.Config fmap :: (a -> b) -> CradleConfig a -> CradleConfig b # (<$) :: a -> CradleConfig b -> CradleConfig a # | |
Eq a => Eq (CradleConfig a) Source # | |
Defined in HIE.Bios.Config (==) :: CradleConfig a -> CradleConfig a -> Bool # (/=) :: CradleConfig a -> CradleConfig a -> Bool # | |
Show (CradleConfig a) Source # | |
Defined in HIE.Bios.Config showsPrec :: Int -> CradleConfig a -> ShowS # show :: CradleConfig a -> String # showList :: [CradleConfig a] -> ShowS # | |
FromJSON a => FromJSON (CradleConfig a) Source # | |
Defined in HIE.Bios.Config parseJSON :: Value -> Parser (CradleConfig a) parseJSONList :: Value -> Parser [CradleConfig a] |
data CradleType a Source #
Cabal | |
CabalMulti [(FilePath, String)] | |
Stack | |
StackMulti [(FilePath, String)] | |
Bios | |
Direct | |
None | |
Multi [(FilePath, CradleConfig a)] | |
Other | |
|
Instances
Functor CradleType Source # | |
Defined in HIE.Bios.Config fmap :: (a -> b) -> CradleType a -> CradleType b # (<$) :: a -> CradleType b -> CradleType a # | |
Eq a => Eq (CradleType a) Source # | |
Defined in HIE.Bios.Config (==) :: CradleType a -> CradleType a -> Bool # (/=) :: CradleType a -> CradleType a -> Bool # | |
Show (CradleType a) Source # | |
Defined in HIE.Bios.Config showsPrec :: Int -> CradleType a -> ShowS # show :: CradleType a -> String # showList :: [CradleType a] -> ShowS # | |
FromJSON a => FromJSON (CradleType a) Source # | |
Defined in HIE.Bios.Config parseJSON :: Value -> Parser (CradleType a) parseJSONList :: Value -> Parser [CradleType a] |