1module ProjectM36.Notifications where
3import ProjectM36.RelationalExpression
4import Control.Monad.Trans.Reader
5import qualified Data.Map as M
6import Data.Either (isRight)
8-- | Returns the notifications which should be triggered based on the transition from the first 'DatabaseContext' to the second 'DatabaseContext'.
9notificationChanges :: Notifications -> DatabaseContext -> DatabaseContext -> Notifications
10notificationChanges nots context1 context2 = M.filter notificationFilter nots
12 notificationFilter (Notification chExpr _ _) = let oldChangeEval = evalChangeExpr chExpr (RelationalExprStateElems context1)
13 newChangeEval = evalChangeExpr chExpr (RelationalExprStateElems context2) in
14 oldChangeEval /= newChangeEval && isRight oldChangeEval
15 evalChangeExpr chExpr = runReader (evalRelationalExpr chExpr)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list