Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data RecordSet e = RecordSet {
- recordSetLabels :: [RColumnRef ()]
- recordSetItems :: EvalRow e [EvalValue e]
- data EvalContext e = EvalContext {
- evalAliasMap :: Map TableAliasId (RecordSet e)
- evalFromTable :: RTableName Range -> Maybe (RecordSet e)
- evalRow :: Map (RColumnRef ()) (EvalValue e)
- data ContextType
- exprToTable :: Evaluation e => EvalT e ExprContext (EvalMonad e) a -> Map (RColumnRef ()) (EvalValue e) -> EvalT e TableContext (EvalMonad e) a
- tableToExpr :: Evaluation e => EvalT e TableContext (EvalMonad e) a -> EvalT e ExprContext (EvalMonad e) a
- newtype EvalT e (t :: ContextType) m a = EvalT (ReaderT (EvalContext e) (ExceptT String m) a)
- type Eval e t = EvalT e t Identity
- runEval :: Evaluation e => Eval e t a -> (RTableName Range -> Maybe (RecordSet e)) -> Either String a
- runEvalT :: Evaluation e => EvalT e t m a -> (RTableName Range -> Maybe (RecordSet e)) -> m (Either String a)
- class Evaluate e q where
- type EvalResult e q :: *
- introduceAlias :: Evaluation e => Proxy e -> TableAlias () -> RecordSet e -> EvalT e TableContext (EvalMonad e) a -> EvalT e TableContext (EvalMonad e) a
- makeRecordSet :: (Evaluation e, Foldable (EvalRow e)) => Proxy e -> [RColumnRef ()] -> EvalRow e [EvalValue e] -> RecordSet e
- emptyRecordSet :: Evaluation e => Proxy e -> RecordSet e
- class (Monad (EvalRow e), Monad (EvalMonad e), Traversable (EvalRow e)) => Evaluation e where
- appendRecordSets :: Evaluation e => Proxy e -> NonEmpty (RecordSet e) -> EvalT e TableContext (EvalMonad e) (RecordSet e)
- makeRowMap :: [RColumnRef ()] -> [a] -> Map (RColumnRef ()) a
- data Direction a
- = Ascending a
- | Descending a
Documentation
RecordSet | |
|
data EvalContext e Source #
EvalContext | |
|
Monad m => MonadReader (EvalContext e) (EvalT e t m) Source # | |
exprToTable :: Evaluation e => EvalT e ExprContext (EvalMonad e) a -> Map (RColumnRef ()) (EvalValue e) -> EvalT e TableContext (EvalMonad e) a Source #
tableToExpr :: Evaluation e => EvalT e TableContext (EvalMonad e) a -> EvalT e ExprContext (EvalMonad e) a Source #
newtype EvalT e (t :: ContextType) m a Source #
EvalT (ReaderT (EvalContext e) (ExceptT String m) a) |
MonadWriter w m => MonadWriter w (EvalT e t m) Source # | |
MonadState s m => MonadState s (EvalT e t m) Source # | |
Monad m => MonadError String (EvalT e t m) Source # | |
Monad m => MonadReader (EvalContext e) (EvalT e t m) Source # | |
Monad m => Monad (EvalT e t m) Source # | |
Functor m => Functor (EvalT e t m) Source # | |
Monad m => Applicative (EvalT e t m) Source # | |
runEval :: Evaluation e => Eval e t a -> (RTableName Range -> Maybe (RecordSet e)) -> Either String a Source #
runEvalT :: Evaluation e => EvalT e t m a -> (RTableName Range -> Maybe (RecordSet e)) -> m (Either String a) Source #
class Evaluate e q where Source #
type EvalResult e q :: * Source #
eval :: Proxy e -> q -> EvalResult e q Source #
introduceAlias :: Evaluation e => Proxy e -> TableAlias () -> RecordSet e -> EvalT e TableContext (EvalMonad e) a -> EvalT e TableContext (EvalMonad e) a Source #
makeRecordSet :: (Evaluation e, Foldable (EvalRow e)) => Proxy e -> [RColumnRef ()] -> EvalRow e [EvalValue e] -> RecordSet e Source #
emptyRecordSet :: Evaluation e => Proxy e -> RecordSet e Source #
class (Monad (EvalRow e), Monad (EvalMonad e), Traversable (EvalRow e)) => Evaluation e where Source #
addItems, removeItems, unionItems, intersectItems, distinctItems, offsetItems, limitItems, filterBy, inList, inSubquery, existsSubquery, atTimeZone, handleConstant, handleCases, handleFunction, handleGroups, handleLike, handleOrder, handleSubquery, handleJoin, handleStructField, handleTypeCast, binop, unop
addItems :: Proxy e -> EvalRow e [EvalValue e] -> EvalRow e [EvalValue e] -> EvalT e TableContext (EvalMonad e) (EvalRow e [EvalValue e]) Source #
removeItems :: Proxy e -> EvalRow e [EvalValue e] -> EvalRow e [EvalValue e] -> EvalT e TableContext (EvalMonad e) (EvalRow e [EvalValue e]) Source #
unionItems :: Proxy e -> EvalRow e [EvalValue e] -> EvalRow e [EvalValue e] -> EvalT e TableContext (EvalMonad e) (EvalRow e [EvalValue e]) Source #
intersectItems :: Proxy e -> EvalRow e [EvalValue e] -> EvalRow e [EvalValue e] -> EvalT e TableContext (EvalMonad e) (EvalRow e [EvalValue e]) Source #
distinctItems :: Proxy e -> EvalRow e [EvalValue e] -> EvalRow e [EvalValue e] Source #
offsetItems :: Proxy e -> Int -> RecordSet e -> RecordSet e Source #
limitItems :: Proxy e -> Int -> RecordSet e -> RecordSet e Source #
filterBy :: Expr ResolvedNames Range -> RecordSet e -> EvalT e TableContext (EvalMonad e) (RecordSet e) Source #
inList :: EvalValue e -> [EvalValue e] -> EvalT e ExprContext (EvalMonad e) (EvalValue e) Source #
inSubquery :: EvalValue e -> EvalRow e [EvalValue e] -> EvalT e ExprContext (EvalMonad e) (EvalValue e) Source #
existsSubquery :: EvalRow e [EvalValue e] -> EvalT e ExprContext (EvalMonad e) (EvalValue e) Source #
atTimeZone :: EvalValue e -> EvalValue e -> EvalT e ExprContext (EvalMonad e) (EvalValue e) Source #
handleConstant :: Proxy e -> Constant a -> EvalT e ExprContext (EvalMonad e) (EvalValue e) Source #
handleCases :: Proxy e -> [(Expr ResolvedNames Range, Expr ResolvedNames Range)] -> Maybe (Expr ResolvedNames Range) -> EvalT e ExprContext (EvalMonad e) (EvalValue e) Source #
handleFunction :: Proxy e -> FunctionName Range -> Distinct -> [Expr ResolvedNames Range] -> [(ParamName Range, Expr ResolvedNames Range)] -> Maybe (Filter ResolvedNames Range) -> Maybe (OverSubExpr ResolvedNames Range) -> EvalT e ExprContext (EvalMonad e) (EvalValue e) Source #
handleGroups :: [RColumnRef ()] -> EvalRow e ([EvalValue e], EvalRow e [EvalValue e]) -> EvalRow e (RecordSet e) Source #
handleLike :: Proxy e -> Operator a -> Maybe (Escape ResolvedNames Range) -> Pattern ResolvedNames Range -> Expr ResolvedNames Range -> EvalT e ExprContext (EvalMonad e) (EvalValue e) Source #
handleOrder :: Proxy e -> [Order ResolvedNames Range] -> RecordSet e -> EvalT e TableContext (EvalMonad e) (RecordSet e) Source #
handleSubquery :: EvalRow e [EvalValue e] -> EvalT e ExprContext (EvalMonad e) (EvalValue e) Source #
handleJoin :: Proxy e -> JoinType a -> JoinCondition ResolvedNames Range -> RecordSet e -> RecordSet e -> EvalT e TableContext (EvalMonad e) (RecordSet e) Source #
handleStructField :: Expr ResolvedNames Range -> StructFieldName a -> EvalT e ExprContext (EvalMonad e) (EvalValue e) Source #
handleTypeCast :: CastFailureAction -> Expr ResolvedNames Range -> DataType a -> EvalT e ExprContext (EvalMonad e) (EvalValue e) Source #
binop :: Proxy e -> Text -> Maybe (EvalValue e -> EvalValue e -> EvalT e ExprContext (EvalMonad e) (EvalValue e)) Source #
unop :: Proxy e -> Text -> Maybe (EvalValue e -> EvalT e ExprContext (EvalMonad e) (EvalValue e)) Source #
appendRecordSets :: Evaluation e => Proxy e -> NonEmpty (RecordSet e) -> EvalT e TableContext (EvalMonad e) (RecordSet e) Source #
makeRowMap :: [RColumnRef ()] -> [a] -> Map (RColumnRef ()) a Source #