Safe Haskell | None |
---|---|
Language | Haskell2010 |
HIE.Bios.Types
Synopsis
- hie_bios_output :: String
- hie_bios_ghc :: String
- hie_bios_ghc_args :: String
- hie_bios_arg :: String
- hie_bios_deps :: String
- data Cradle a = Cradle {}
- data ActionName a
- data Log
- data LoadStyle
- data CradleAction a = CradleAction {
- actionName :: ActionName a
- runCradle :: FilePath -> LoadStyle -> IO (CradleLoadResult ComponentOptions)
- runGhcCmd :: [String] -> IO (CradleLoadResult String)
- data CradleLoadResult r
- cradleLoadResult :: c -> (CradleError -> c) -> (r -> c) -> CradleLoadResult r -> c
- newtype CradleLoadResultT (m :: Type -> Type) a = CradleLoadResultT {
- runCradleResultT :: m (CradleLoadResult a)
- modCradleError :: Monad m => CradleLoadResultT m a -> (CradleError -> m CradleError) -> CradleLoadResultT m a
- throwCE :: forall (m :: Type -> Type) a. Monad m => CradleError -> CradleLoadResultT m a
- data CradleError = CradleError {}
- data ComponentOptions = ComponentOptions {}
- prettyCmdSpec :: CmdSpec -> String
- prettyProcessEnv :: CreateProcess -> [String]
Documentation
Environment variable containing the filepath to which cradle actions write their results to. If the filepath does not exist, cradle actions must create them.
hie_bios_ghc :: String #
Environment variable pointing to the GHC location used by cabal's and stack's GHC wrapper.
If not set, will default to sensible defaults.
Environment variable with extra arguments passed to the GHC location in cabal's and stack's GHC wrapper.
If not set, assume no extra arguments.
hie_bios_arg :: String #
Environment variable pointing to the source file location that caused the cradle action to be executed.
hie_bios_deps :: String #
Environment variable pointing to a filepath to which dependencies of a cradle can be written to by the cradle action.
The environment of a single Cradle
.
A Cradle
is a unit for the respective build-system.
It contains the root directory of the Cradle
, the name of
the Cradle
(for debugging purposes), and knows how to set up
a GHC session that is able to compile files that are part of this Cradle
.
A Cradle
may be a single unit in the "cabal-install" context, or
the whole package, comparable to how "stack" works.
Constructors
Cradle | |
Fields
|
data ActionName a #
Instances
Functor ActionName # | |
Defined in HIE.Bios.Types Methods fmap :: (a -> b) -> ActionName a -> ActionName b # (<$) :: a -> ActionName b -> ActionName a # | |
Show a => Show (ActionName a) # | |
Defined in HIE.Bios.Types Methods showsPrec :: Int -> ActionName a -> ShowS # show :: ActionName a -> String # showList :: [ActionName a] -> ShowS # | |
Eq a => Eq (ActionName a) # | |
Defined in HIE.Bios.Types | |
Ord a => Ord (ActionName a) # | |
Defined in HIE.Bios.Types Methods compare :: ActionName a -> ActionName a -> Ordering # (<) :: ActionName a -> ActionName a -> Bool # (<=) :: ActionName a -> ActionName a -> Bool # (>) :: ActionName a -> ActionName a -> Bool # (>=) :: ActionName a -> ActionName a -> Bool # max :: ActionName a -> ActionName a -> ActionName a # min :: ActionName a -> ActionName a -> ActionName a # |
The LoadStyle
instructs a cradle on how to load a given file target.
Constructors
LoadFile | Instruct the cradle to load the given file target. What this entails depends on the cradle. For example, the |
LoadWithContext [FilePath] | Give a cradle additional context for loading a file target. The context instructs the cradle to load the file target, while also loading the given filepaths. This is useful for cradles that support loading multiple code units at once, e.g. cabal cradles can use the 'multi-repl' feature to set up a multiple home unit session in GHC. |
Instances
Show LoadStyle # | |
Eq LoadStyle # | |
Ord LoadStyle # | |
data CradleAction a #
Constructors
CradleAction | |
Fields
|
Instances
Functor CradleAction # | |
Defined in HIE.Bios.Types Methods fmap :: (a -> b) -> CradleAction a -> CradleAction b # (<$) :: a -> CradleAction b -> CradleAction a # | |
Show a => Show (CradleAction a) # | |
Defined in HIE.Bios.Types Methods showsPrec :: Int -> CradleAction a -> ShowS # show :: CradleAction a -> String # showList :: [CradleAction a] -> ShowS # |
data CradleLoadResult r #
Result of an attempt to set up a GHC session for a Cradle
.
This is the go-to error handling mechanism. When possible, this
should be preferred over throwing exceptions.
Constructors
CradleSuccess r | The cradle succeeded and returned these options. |
CradleFail CradleError | We tried to load the cradle and it failed. |
CradleNone | No attempt was made to load the cradle. |
Instances
cradleLoadResult :: c -> (CradleError -> c) -> (r -> c) -> CradleLoadResult r -> c #
newtype CradleLoadResultT (m :: Type -> Type) a #
Constructors
CradleLoadResultT | |
Fields
|
Instances
modCradleError :: Monad m => CradleLoadResultT m a -> (CradleError -> m CradleError) -> CradleLoadResultT m a #
throwCE :: forall (m :: Type -> Type) a. Monad m => CradleError -> CradleLoadResultT m a #
data CradleError #
Constructors
CradleError | |
Fields
|
Instances
Exception CradleError # | |
Defined in HIE.Bios.Types Methods toException :: CradleError -> SomeException # fromException :: SomeException -> Maybe CradleError # displayException :: CradleError -> String # backtraceDesired :: CradleError -> Bool # | |
Show CradleError # | |
Defined in HIE.Bios.Types Methods showsPrec :: Int -> CradleError -> ShowS # show :: CradleError -> String # showList :: [CradleError] -> ShowS # | |
Eq CradleError # | |
Defined in HIE.Bios.Types |
data ComponentOptions #
Option information for GHC
Constructors
ComponentOptions | |
Fields
|
Instances
Show ComponentOptions # | |
Defined in HIE.Bios.Types Methods showsPrec :: Int -> ComponentOptions -> ShowS # show :: ComponentOptions -> String # showList :: [ComponentOptions] -> ShowS # | |
Eq ComponentOptions # | |
Defined in HIE.Bios.Types Methods (==) :: ComponentOptions -> ComponentOptions -> Bool # (/=) :: ComponentOptions -> ComponentOptions -> Bool # | |
Ord ComponentOptions # | |
Defined in HIE.Bios.Types Methods compare :: ComponentOptions -> ComponentOptions -> Ordering # (<) :: ComponentOptions -> ComponentOptions -> Bool # (<=) :: ComponentOptions -> ComponentOptions -> Bool # (>) :: ComponentOptions -> ComponentOptions -> Bool # (>=) :: ComponentOptions -> ComponentOptions -> Bool # max :: ComponentOptions -> ComponentOptions -> ComponentOptions # min :: ComponentOptions -> ComponentOptions -> ComponentOptions # |
prettyCmdSpec :: CmdSpec -> String #
Prettify CmdSpec
, so we can show the command to a user
prettyProcessEnv :: CreateProcess -> [String] #
Pretty print hie-bios's relevant environment variables.