-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A general abstraction for manipulating elements of container data structures -- @package focus @version 0.1.4 module Focus -- | A general modification function for some match. By processing a -- Maybe value it produces some value to emit and a -- Decision to perform on the match. -- -- The interpretation of this function is up to the context APIs. type Strategy a r = Maybe a -> (r, Decision a) -- | A monadic version of Strategy. type StrategyM m a r = Maybe a -> m (r, Decision a) -- | What to do with the focused value. -- -- The interpretation of the commands is up to the context APIs. data Decision a Keep :: Decision a Remove :: Decision a Replace :: a -> Decision a -- | Reproduces the behaviour of Data.Map.adjust. adjust :: (a -> a) -> Strategy a () -- | Reproduces the behaviour of Data.Map.update. update :: (a -> Maybe a) -> Strategy a () -- | Reproduces the behaviour of Data.Map.alter. alter :: (Maybe a -> Maybe a) -> Strategy a () -- | Reproduces the behaviour of Data.Map.insert. insert :: a -> Strategy a () -- | Reproduces the behaviour of Data.Map.delete. delete :: Strategy a () -- | Reproduces the behaviour of Data.Map.lookup. lookup :: Strategy a (Maybe a) -- | A monadic version of adjust. adjustM :: Monad m => (a -> m a) -> StrategyM m a () -- | A monadic version of update. updateM :: Monad m => (a -> m (Maybe a)) -> StrategyM m a () -- | A monadic version of alter. alterM :: Monad m => (Maybe a -> m (Maybe a)) -> StrategyM m a () -- | A monadic version of insert. insertM :: Monad m => a -> StrategyM m a () -- | A monadic version of delete. deleteM :: Monad m => StrategyM m a () -- | A monadic version of lookup. lookupM :: Monad m => StrategyM m a (Maybe a) instance Functor Decision