Cabal-2.0.1.0: A framework for packaging Haskell software

Safe Haskell | None
Language | Haskell2010

Distribution.Types.Condition

Synopsis

- data Condition c
  - = Var c
  - | Lit Bool
  - | CNot (Condition c)
  - | COr (Condition c) (Condition c)
  - | CAnd (Condition c) (Condition c)
- cNot :: Condition a -> Condition a
- cAnd :: Condition a -> Condition a -> Condition a
- cOr :: Eq v => Condition v -> Condition v -> Condition v
- simplifyCondition :: Condition c -> (c -> Either d Bool) -> (Condition d, [d])

# Documentation

data Condition c #

A boolean expression parameterized over the variable type used.

Constructors

Var c |
Lit Bool |
CNot (Condition c) |
COr (Condition c) (Condition c) |
CAnd (Condition c) (Condition c) |

Instances

Monad Condition # |
Methods (>>=) :: Condition a -> (a -> Condition b) -> Condition b Source # (>>) :: Condition a -> Condition b -> Condition b Source # return :: a -> Condition a Source # fail :: String -> Condition a Source #
Functor Condition # |
Methods fmap :: (a -> b) -> Condition a -> Condition b Source # (<$) :: a -> Condition b -> Condition a Source #
Applicative Condition # |
Methods pure :: a -> Condition a Source # (<*>) :: Condition (a -> b) -> Condition a -> Condition b Source # liftA2 :: (a -> b -> c) -> Condition a -> Condition b -> Condition c Source # (*>) :: Condition a -> Condition b -> Condition b Source # (<*) :: Condition a -> Condition b -> Condition a Source #
Foldable Condition # |

Methods

fold :: Monoid m => Condition m -> m Source #

foldMap :: Monoid m => (a -> m) -> Condition a -> m Source #

foldr :: (a -> b -> b) -> b -> Condition a -> b Source #

foldr' :: (a -> b -> b) -> b -> Condition a -> b Source #

foldl :: (b -> a -> b) -> b -> Condition a -> b Source #

foldl' :: (b -> a -> b) -> b -> Condition a -> b Source #

foldr1 :: (a -> a -> a) -> Condition a -> a Source #

foldl1 :: (a -> a -> a) -> Condition a -> a Source #

toList :: Condition a -> [a] Source #

null :: Condition a -> Bool Source #

length :: Condition a -> Int Source #

elem :: Eq a => a -> Condition a -> Bool Source #

maximum :: Ord a => Condition a -> a Source #

minimum :: Ord a => Condition a -> a Source #

sum :: Num a => Condition a -> a Source #

product :: Num a => Condition a -> a Source #

Traversable Condition # |
Methods traverse :: Applicative f => (a -> f b) -> Condition a -> f (Condition b) Source # sequenceA :: Applicative f => Condition (f a) -> f (Condition a) Source # mapM :: Monad m => (a -> m b) -> Condition a -> m (Condition b) Source # sequence :: Monad m => Condition (m a) -> m (Condition a) Source #
Alternative Condition # |
Methods empty :: Condition a Source # (<|>) :: Condition a -> Condition a -> Condition a Source # some :: Condition a -> Condition [a] Source # many :: Condition a -> Condition [a] Source #
MonadPlus Condition # |
Methods mzero :: Condition a Source # mplus :: Condition a -> Condition a -> Condition a Source #
Eq c => Eq (Condition c) # |
Methods (==) :: Condition c -> Condition c -> Bool # (/=) :: Condition c -> Condition c -> Bool #
Data c => Data (Condition c) # |

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Condition c -> c (Condition c) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Condition c) Source #

toConstr :: Condition c -> Constr Source #

dataTypeOf :: Condition c -> DataType Source #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Condition c)) Source #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Condition c)) Source #

gmapT :: (forall b. Data b => b -> b) -> Condition c -> Condition c Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Condition c -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Condition c -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Condition c -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Condition c -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Condition c -> m (Condition c) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Condition c -> m (Condition c) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Condition c -> m (Condition c) Source #

Show c => Show (Condition c) # |
Methods showsPrec :: Int -> Condition c -> ShowS Source # show :: Condition c -> String Source # showList :: [Condition c] -> ShowS Source #
Generic (Condition c) # |
Associated Types type Rep (Condition c) :: * -> * Source # Methods from :: Condition c -> Rep (Condition c) x Source # to :: Rep (Condition c) x -> Condition c Source #
Semigroup (Condition a) # |
Methods (<>) :: Condition a -> Condition a -> Condition a Source # sconcat :: NonEmpty (Condition a) -> Condition a Source # stimes :: Integral b => b -> Condition a -> Condition a Source #
Monoid (Condition a) # |
Methods mempty :: Condition a Source # mappend :: Condition a -> Condition a -> Condition a Source # mconcat :: [Condition a] -> Condition a Source #
Binary c => Binary (Condition c) # |
Methods put :: Condition c -> Put Source # get :: Get (Condition c) Source # putList :: [Condition c] -> Put Source #
type Rep (Condition c) # |

type Rep (Condition c) = D1 * (MetaData "Condition" "Distribution.Types.Condition" "Cabal-2.0.1.0" False) ((:+:) * ((:+:) * (C1 * (MetaCons "Var" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * c))) (C1 * (MetaCons "Lit" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Bool)))) ((:+:) * (C1 * (MetaCons "CNot" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Condition c)))) ((:+:) * (C1 * (MetaCons "COr" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Condition c))) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Condition c))))) (C1 * (MetaCons "CAnd" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Condition c))) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Condition c))))))))

cNot :: Condition a -> Condition a #

Boolean negation of a `Condition` value.

cAnd :: Condition a -> Condition a -> Condition a #

Boolean AND of two `Condtion` values.

cOr :: Eq v => Condition v -> Condition v -> Condition v #

Boolean OR of two `Condition` values.

simplifyCondition #

Arguments

:: Condition c |
-> (c -> Either d Bool) | (partial) variable assignment
-> (Condition d, [d]) |

Simplify the condition and return its free variables.