dynamic-cabal-0.3.5: Access the functions from the Cabal library without depending on it

Safe HaskellNone
LanguageHaskell2010

Distribution.Client.Dynamic.Query

Description

Functions for building queries on cabal's setup-config an evaluating them.

Synopsis

Documentation

data Selector i o Source

A selector is a generator for a function of type i -> o.

Instances

selector :: (Version -> ExpG (i -> o)) -> Selector i o Source

Build a selector. The expression the selector generates can depend on the cabal version.

data Query s a Source

A query is like a Selector, but it cannot be composed any futher using a Category instance. It can have a Functor and Applicative instance though. To execute a query, you only need to run GHC once.

Instances

query :: Typeable a => Selector s a -> Query s a Source

Build a query from a selector.

data LocalBuildInfo Source

This is just a dummy type representing a LocalBuildInfo. You don't have to use this type, it is just used to tag queries and make them more type-safe.

maybeDefault :: (GenExpType a ~ a, GenExp a) => a -> Selector (Maybe a) a Source

A Selector to get something out of a Maybe if you supply a default value.

(>>>=) :: Monad m => Selector a (m b) -> Selector b (m c) -> Selector a (m c) Source

The same as (=<<<), but flipped.

(=<<<) :: Monad m => Selector b (m c) -> Selector a (m b) -> Selector a (m c) Source

Compose two selectors, monadically.

fmapS :: Functor m => Selector a b -> Selector (m a) (m b) Source

Lift a selector to work on functorial inputs and outputs.

fmapQ :: (Functor f, Typeable1 f) => Query s a -> Query (f s) (f a) Source

Lift a query to work over functors.

on :: Selector i o -> Query o r -> Query i r Source

Use a selector to run a query in a bigger environment than it was defined in.

runQuery :: Query LocalBuildInfo a -> FilePath -> IO a Source

Run a query. This will generate the source code for the query and then invoke GHC to run it.

runRawQuery :: Typeable a => String -> FilePath -> IO a Source

Run a raw query, getting the full source from the first parameter the module must be DynamicCabalQuery and it must have a result declaration