- lens Nothing (Just p) = False
- lens Nothing Nothing = True
- lens (Just (d1, i1)) (Just (d2, i2)) = d1 == d2 && (i2 == -1 || i1 == i2)
+ notifyPred :: (Maybe (MTaskDevice, Int)) (Maybe (MTaskDevice, Int)) -> Bool
+ // Global watcher looking at a global event
+ notifyPred Nothing Nothing = True
+ // Global watcher looking at a local event
+ notifyPred Nothing (Just _) = False
+ // Local watcher looking at a global event
+ notifyPred (Just _) Nothing = False
+ // Local device watcher looking at a local event
+ notifyPred (Just (d1, -1)) (Just (d2, _)) = d1 == d2
+ // Local share watcher looking at a local share event
+ notifyPred (Just (d1, i1)) (Just (d2, i2)) = d1 == d2 && i1 == i2