Safe Haskell | None |
---|
This module provides mechanism for flexible and typesafe usage of plain data values and fields. The expressions can used in conditions and right part of Update statement. Example:
StringField ==. "abc" &&. NumberField >. (0 :: Int) ||. MaybeField ==. (Nothing :: Maybe String) ||. MaybeField ==. Just "def"
Note that polymorphic values like numbers or Nothing must have a type annotation
- class Expression a v c where
- toExpression :: a -> Expr v c a
- (=.) :: (Expression b v c, FieldLike f (RestrictionHolder v c) a', Unifiable f b) => f -> b -> Update v c
- (&&.) :: Cond v c -> Cond v c -> Cond v c
- (||.) :: Cond v c -> Cond v c -> Cond v c
- (==.) :: (Expression a v c, Expression b v c, Unifiable a b) => a -> b -> Cond v c
- (/=.) :: (Expression a v c, Expression b v c, Unifiable a b) => a -> b -> Cond v c
- (<.) :: (Expression a v c, Expression b v c, Unifiable a b) => a -> b -> Cond v c
- (<=.) :: (Expression a v c, Expression b v c, Unifiable a b) => a -> b -> Cond v c
- (>.) :: (Expression a v c, Expression b v c, Unifiable a b) => a -> b -> Cond v c
- (>=.) :: (Expression a v c, Expression b v c, Unifiable a b) => a -> b -> Cond v c
Documentation
class Expression a v c whereSource
Instances of this type can be converted to Expr
. It is useful for uniform manipulation over fields and plain values
toExpression :: a -> Expr v c aSource
PurePersistField a => Expression a v c | |
(PersistEntity v, Constructor c, FieldLike (u (UniqueMarker v)) (RestrictionHolder v c) a', ~ ((* -> *) -> *) c' (UniqueConstr (Key v' (Unique u))), ~ * v v', IsUniqueKey (Key v' (Unique u)), ~ ((* -> *) -> *) c c') => Expression (u (UniqueMarker v)) v' c' | |
(PersistEntity v, Constructor c, PersistField (Key v' BackendSpecific), FieldLike (AutoKeyField v c) (RestrictionHolder v c) a', ~ * v v', ~ ((* -> *) -> *) c c') => Expression (AutoKeyField v c) v' c' | |
(PersistEntity v, Constructor c, PersistField a, ~ * v v', ~ ((* -> *) -> *) c c') => Expression (Arith v c a) v' c' | |
(PersistEntity v, Constructor c, PersistField a, ~ * v v', ~ ((* -> *) -> *) c c') => Expression (SubField v c a) v' c' | |
(PersistEntity v, Constructor c, PersistField a, ~ * v v', ~ ((* -> *) -> *) c c') => Expression (Field v c a) v' c' |
(=.) :: (Expression b v c, FieldLike f (RestrictionHolder v c) a', Unifiable f b) => f -> b -> Update v cSource
Update field
(==.) :: (Expression a v c, Expression b v c, Unifiable a b) => a -> b -> Cond v cSource
(/=.) :: (Expression a v c, Expression b v c, Unifiable a b) => a -> b -> Cond v cSource
(<.) :: (Expression a v c, Expression b v c, Unifiable a b) => a -> b -> Cond v cSource
(<=.) :: (Expression a v c, Expression b v c, Unifiable a b) => a -> b -> Cond v cSource
(>.) :: (Expression a v c, Expression b v c, Unifiable a b) => a -> b -> Cond v cSource
(>=.) :: (Expression a v c, Expression b v c, Unifiable a b) => a -> b -> Cond v cSource