Copyright | 2002-2005 David Roundy |
---|---|
License | GPL |
Maintainer | darcs-devel@darcs.net |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- class Apply p where
- type ApplyState p :: (* -> *) -> *
- apply :: ApplyMonad (ApplyState p) m => p wX wY -> m ()
- unapply :: ApplyMonad (ApplyState p) m => p wX wY -> m ()
- type ObjectIdOfPatch p = ObjectIdOf (ApplyState p)
- applyToPaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> Maybe [(AnchoredPath, AnchoredPath)] -> [AnchoredPath] -> ([AnchoredPath], [AnchoredPath], [(AnchoredPath, AnchoredPath)])
- applyToTree :: (Apply p, MonadThrow m, ApplyState p ~ Tree) => p wX wY -> Tree m -> m (Tree m)
- applyToState :: forall p m wX wY. (Apply p, ApplyMonadTrans (ApplyState p) m) => p wX wY -> ApplyState p m -> m (ApplyState p m)
- maybeApplyToTree :: (Apply p, ApplyState p ~ Tree, MonadCatch m) => p wX wY -> Tree m -> m (Maybe (Tree m))
- effectOnPaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> [AnchoredPath] -> [AnchoredPath]
Documentation
type ApplyState p :: (* -> *) -> * Source #
apply :: ApplyMonad (ApplyState p) m => p wX wY -> m () Source #
unapply :: ApplyMonad (ApplyState p) m => p wX wY -> m () Source #
default unapply :: (ApplyMonad (ApplyState p) m, Invert p) => p wX wY -> m () Source #
Instances
type ObjectIdOfPatch p = ObjectIdOf (ApplyState p) Source #
applyToPaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> Maybe [(AnchoredPath, AnchoredPath)] -> [AnchoredPath] -> ([AnchoredPath], [AnchoredPath], [(AnchoredPath, AnchoredPath)]) Source #
applyToTree :: (Apply p, MonadThrow m, ApplyState p ~ Tree) => p wX wY -> Tree m -> m (Tree m) Source #
applyToState :: forall p m wX wY. (Apply p, ApplyMonadTrans (ApplyState p) m) => p wX wY -> ApplyState p m -> m (ApplyState p m) Source #
maybeApplyToTree :: (Apply p, ApplyState p ~ Tree, MonadCatch m) => p wX wY -> Tree m -> m (Maybe (Tree m)) Source #
Attempts to apply a given patch to a Tree. If the apply fails, we return Nothing, otherwise we return the updated Tree.
effectOnPaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> [AnchoredPath] -> [AnchoredPath] Source #