hie-bios-0.13.1: Set up a GHC API session
Safe HaskellSafe-Inferred
LanguageHaskell2010

HIE.Bios.Types

Synopsis

Documentation

hie_bios_output :: String Source #

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 Source #

Environment variable pointing to the GHC location used by cabal's and stack's GHC wrapper.

If not set, will default to sensible defaults.

hie_bios_ghc_args :: String Source #

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 Source #

Environment variable pointing to the source file location that caused the cradle action to be executed.

hie_bios_deps :: String Source #

Environment variable pointing to a filepath to which dependencies of a cradle can be written to by the cradle action.

data Cradle a Source #

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

Instances

Instances details
Functor Cradle Source # 
Instance details

Defined in HIE.Bios.Types

Methods

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

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

Show a => Show (Cradle a) Source # 
Instance details

Defined in HIE.Bios.Types

Methods

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

show :: Cradle a -> String #

showList :: [Cradle a] -> ShowS #

data ActionName a Source #

Constructors

Stack 
Cabal 
Bios 
Default 
Multi 
Direct 
None 
Other a 

Instances

Instances details
Functor ActionName Source # 
Instance details

Defined in HIE.Bios.Types

Methods

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

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

Show a => Show (ActionName a) Source # 
Instance details

Defined in HIE.Bios.Types

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

Defined in HIE.Bios.Types

Methods

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

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

Ord a => Ord (ActionName a) Source # 
Instance details

Defined in HIE.Bios.Types

data Log Source #

Instances

Instances details
Show Log Source # 
Instance details

Defined in HIE.Bios.Types

Methods

showsPrec :: Int -> Log -> ShowS #

show :: Log -> String #

showList :: [Log] -> ShowS #

Pretty Log Source # 
Instance details

Defined in HIE.Bios.Types

Methods

pretty :: Log -> Doc ann #

prettyList :: [Log] -> Doc ann #

data CradleAction a Source #

Constructors

CradleAction 

Fields

Instances

Instances details
Functor CradleAction Source # 
Instance details

Defined in HIE.Bios.Types

Methods

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

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

Show a => Show (CradleAction a) Source # 
Instance details

Defined in HIE.Bios.Types

data CradleLoadResult r Source #

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

Instances details
Foldable CradleLoadResult Source # 
Instance details

Defined in HIE.Bios.Types

Methods

fold :: Monoid m => CradleLoadResult m -> m #

foldMap :: Monoid m => (a -> m) -> CradleLoadResult a -> m #

foldMap' :: Monoid m => (a -> m) -> CradleLoadResult a -> m #

foldr :: (a -> b -> b) -> b -> CradleLoadResult a -> b #

foldr' :: (a -> b -> b) -> b -> CradleLoadResult a -> b #

foldl :: (b -> a -> b) -> b -> CradleLoadResult a -> b #

foldl' :: (b -> a -> b) -> b -> CradleLoadResult a -> b #

foldr1 :: (a -> a -> a) -> CradleLoadResult a -> a #

foldl1 :: (a -> a -> a) -> CradleLoadResult a -> a #

toList :: CradleLoadResult a -> [a] #

null :: CradleLoadResult a -> Bool #

length :: CradleLoadResult a -> Int #

elem :: Eq a => a -> CradleLoadResult a -> Bool #

maximum :: Ord a => CradleLoadResult a -> a #

minimum :: Ord a => CradleLoadResult a -> a #

sum :: Num a => CradleLoadResult a -> a #

product :: Num a => CradleLoadResult a -> a #

Traversable CradleLoadResult Source # 
Instance details

Defined in HIE.Bios.Types

Methods

traverse :: Applicative f => (a -> f b) -> CradleLoadResult a -> f (CradleLoadResult b) #

sequenceA :: Applicative f => CradleLoadResult (f a) -> f (CradleLoadResult a) #

mapM :: Monad m => (a -> m b) -> CradleLoadResult a -> m (CradleLoadResult b) #

sequence :: Monad m => CradleLoadResult (m a) -> m (CradleLoadResult a) #

Applicative CradleLoadResult Source # 
Instance details

Defined in HIE.Bios.Types

Functor CradleLoadResult Source # 
Instance details

Defined in HIE.Bios.Types

Methods

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

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

Monad CradleLoadResult Source # 
Instance details

Defined in HIE.Bios.Types

Show r => Show (CradleLoadResult r) Source # 
Instance details

Defined in HIE.Bios.Types

Eq r => Eq (CradleLoadResult r) Source # 
Instance details

Defined in HIE.Bios.Types

cradleLoadResult :: c -> (CradleError -> c) -> (r -> c) -> CradleLoadResult r -> c Source #

newtype CradleLoadResultT m a Source #

Instances

Instances details
MonadTrans CradleLoadResultT Source # 
Instance details

Defined in HIE.Bios.Types

Methods

lift :: Monad m => m a -> CradleLoadResultT m a #

MonadFail m => MonadFail (CradleLoadResultT m) Source # 
Instance details

Defined in HIE.Bios.Types

Methods

fail :: String -> CradleLoadResultT m a #

MonadIO m => MonadIO (CradleLoadResultT m) Source # 
Instance details

Defined in HIE.Bios.Types

Methods

liftIO :: IO a -> CradleLoadResultT m a #

(Monad m, Applicative m) => Applicative (CradleLoadResultT m) Source # 
Instance details

Defined in HIE.Bios.Types

Functor f => Functor (CradleLoadResultT f) Source # 
Instance details

Defined in HIE.Bios.Types

Methods

fmap :: (a -> b) -> CradleLoadResultT f a -> CradleLoadResultT f b #

(<$) :: a -> CradleLoadResultT f b -> CradleLoadResultT f a #

Monad m => Monad (CradleLoadResultT m) Source # 
Instance details

Defined in HIE.Bios.Types

data CradleError Source #

Constructors

CradleError 

Fields

data ComponentOptions Source #

Option information for GHC

Constructors

ComponentOptions 

Fields

  • componentOptions :: [String]

    Command line options.

  • componentRoot :: FilePath

    Root directory of the component. All componentOptions are either absolute, or relative to this directory.

  • componentDependencies :: [FilePath]

    Dependencies of a cradle that might change the cradle. Contains both files specified in hie.yaml as well as specified by the build-tool if there is any. FilePaths are expected to be relative to the cradleRootDir to which this CradleAction belongs to. Files returned by this action might not actually exist. This is useful, because, sometimes, adding specific files changes the options that a Cradle may return, thus, needs reload as soon as these files are created.

prettyCmdSpec :: CmdSpec -> String Source #

Prettify CmdSpec, so we can show the command to a user

prettyProcessEnv :: CreateProcess -> [String] Source #

Pretty print hie-bios's relevant environment variables.