rel8-internal
Safe HaskellNone
LanguageHaskell2010

Rel8.Internal.Expr.Bool

Synopsis

Documentation

false :: Expr Bool Source #

The SQL false literal.

true :: Expr Bool Source #

The SQL true literal.

(&&.) :: Expr Bool -> Expr Bool -> Expr Bool infixr 3 Source #

The SQL AND operator.

(||.) :: Expr Bool -> Expr Bool -> Expr Bool infixr 2 Source #

The SQL OR operator.

not_ :: Expr Bool -> Expr Bool Source #

The SQL NOT operator.

and_ :: Foldable f => f (Expr Bool) -> Expr Bool Source #

Fold AND over a collection of expressions.

or_ :: Foldable f => f (Expr Bool) -> Expr Bool Source #

Fold OR over a collection of expressions.

boolExpr :: Expr a -> Expr a -> Expr Bool -> Expr a Source #

Eliminate a boolean-valued expression.

Corresponds to bool.

caseExpr :: [(Expr Bool, Expr a)] -> Expr a -> Expr a Source #

A multi-way ifthenelse statement. The first argument to caseExpr is a list of alternatives. The first alternative that is of the form (true, x) will be returned. If no such alternative is found, a fallback expression is returned.

Corresponds to a CASE expression in SQL.

coalesce :: Expr (Maybe Bool) -> Expr Bool Source #

Convert a Expr (Maybe Bool) to a Expr Bool by treating Nothing as False. This can be useful when combined with where_, which expects a Bool, and produces expressions that optimize better than general case analysis.