| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Language.Souffle.Analysis
Description
This module provides an Analysis type for combining multiple Datalog
analyses together. Composition of analyses is done via the various
type-classes that are implemented for this type. For a longer explanation
of how the Analysis type works, see this
blogpost.
If you are just starting out using this library, you are probably better of taking a look at the Language.Souffle.Interpreted module instead to start interacting with a single Datalog program.
Synopsis
- data Analysis m a b
- mkAnalysis :: (a -> m ()) -> m () -> m b -> Analysis m a b
- execAnalysis :: Applicative m => Analysis m a b -> a -> m b
Documentation
Data type used to compose multiple Datalog programs. Composition is mainly
done via the various type-classes implemented for this type.
Values of this type can be created using mkAnalysis.
The m type-variable represents the monad the analysis will run in. In
most cases, this will be the SouffleM monad from either
Language.Souffle.Compiled or Language.Souffle.Interpreted.
The a and b type-variables represent respectively the input and output
types of the analysis.
Instances
| (Monad m, Monoid (m ()), Category (Analysis m)) => Arrow (Analysis m) Source # | |
Defined in Language.Souffle.Analysis | |
| (Monad m, Monoid (m ())) => ArrowChoice (Analysis m) Source # | |
Defined in Language.Souffle.Analysis | |
| Applicative m => Choice (Analysis m) Source # | |
| Functor m => Strong (Analysis m) Source # | |
| Functor m => Profunctor (Analysis m) Source # | |
Defined in Language.Souffle.Analysis Methods dimap :: (a -> b) -> (c -> d) -> Analysis m b c -> Analysis m a d lmap :: (a -> b) -> Analysis m b c -> Analysis m a c rmap :: (b -> c) -> Analysis m a b -> Analysis m a c (#.) :: forall a b c q. Coercible c b => q b c -> Analysis m a b -> Analysis m a c (.#) :: forall a b c q. Coercible b a => Analysis m b c -> q a b -> Analysis m a c | |
| (Monoid (m ()), Monad m) => Category (Analysis m :: Type -> Type -> Type) Source # | |
| Functor m => Functor (Analysis m a) Source # | |
| (Monoid (m ()), Applicative m) => Applicative (Analysis m a) Source # | |
Defined in Language.Souffle.Analysis Methods pure :: a0 -> Analysis m a a0 # (<*>) :: Analysis m a (a0 -> b) -> Analysis m a a0 -> Analysis m a b # liftA2 :: (a0 -> b -> c) -> Analysis m a a0 -> Analysis m a b -> Analysis m a c # (*>) :: Analysis m a a0 -> Analysis m a b -> Analysis m a b # (<*) :: Analysis m a a0 -> Analysis m a b -> Analysis m a a0 # | |
| (Semigroup (m ()), Semigroup (m b)) => Semigroup (Analysis m a b) Source # | |
| (Monoid (m ()), Monoid (m b)) => Monoid (Analysis m a b) Source # | |
Arguments
| :: (a -> m ()) | Function for finding facts used by the |
| -> m () | Function for actually running the |
| -> m b | Function for retrieving the |
| -> Analysis m a b |
Creates an Analysis value.
execAnalysis :: Applicative m => Analysis m a b -> a -> m b Source #
Converts an Analysis into an effectful function, so it can be executed.