Functions for building queries on cabal's setup-config an evaluating them.
- data Selector i o
- selector :: (Version -> ExpG (i -> o)) -> Selector i o
- data Query s a
- query :: Typeable a => Selector s a -> Query s a
- data LocalBuildInfo
- maybeDefault :: (GenExpType a ~ a, GenExp a) => a -> Selector (Maybe a) a
- (>>>=) :: Monad m => Selector a (m b) -> Selector b (m c) -> Selector a (m c)
- (=<<<) :: Monad m => Selector b (m c) -> Selector a (m b) -> Selector a (m c)
- fmapS :: Functor m => Selector a b -> Selector (m a) (m b)
- fmapQ :: (Functor f, Typeable1 f) => Query s a -> Query (f s) (f a)
- on :: Selector i o -> Query o r -> Query i r
- runQuery :: Query LocalBuildInfo a -> FilePath -> IO a
- runRawQuery :: Typeable a => String -> FilePath -> IO a
- getCabalVersion :: FilePath -> IO Version
Build a selector. The expression the selector generates can depend on the cabal version.
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.
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.
A Selector to get something out of a Maybe if you supply a default value.
The same as (=<<<), but flipped.
Compose two selectors, monadically.
Lift a selector to work on functorial inputs and outputs.
Lift a query to work over functors.
Use a selector to run a query in a bigger environment than it was defined in.
Run a query. This will generate the source code for the query and then invoke GHC to run it.
Run a raw query, getting the full source from the first parameter the module must be DynamicCabalQuery and it must have a result declaration