darcs-2.12.5: a distributed, interactive, smart revision control system

Copyright | 2002-2005 David Roundy
License | GPL
Maintainer | darcs-devel@darcs.net
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell2010

Darcs.Patch.Apply

Description

Synopsis

- class Apply p where
  - type ApplyState p :: (* -> *) -> *
- applyToFilePaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> Maybe [(FilePath, FilePath)] -> [FilePath] -> ([FilePath], [FilePath], [(FilePath, FilePath)])
- applyToTree :: (Apply p, Functor m, Monad 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) => p wX wY -> Tree IO -> IO (Maybe (Tree IO))
- applyToFileMods :: (Apply p, ApplyState p ~ Tree) => p wX wY -> Set FileName -> (Set FileName, [PatchMod FileName])
- effectOnFilePaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> [FilePath] -> [FilePath]

# Documentation

class Apply p where #

Minimal complete definition

apply

Associated Types

type ApplyState p :: (* -> *) -> * #

Methods

apply :: ApplyMonad (ApplyState p) m => p wX wY -> m () #

Instances

Apply DummyPatch # |
Associated Types type ApplyState (DummyPatch :: * -> * -> *) :: (* -> *) -> * # Methods apply :: ApplyMonad (ApplyState DummyPatch) m => DummyPatch wX wY -> m () #
Apply p => Apply (RL p) # |
Associated Types type ApplyState (RL p :: * -> * -> *) :: (* -> *) -> * # Methods apply :: ApplyMonad (ApplyState (RL p)) m => RL p wX wY -> m () #
Apply p => Apply (FL p) # |
Associated Types type ApplyState (FL p :: * -> * -> *) :: (* -> *) -> * # Methods apply :: ApplyMonad (ApplyState (FL p)) m => FL p wX wY -> m () #
Apply p => Apply (Named p) # |
Associated Types type ApplyState (Named p :: * -> * -> *) :: (* -> *) -> * # Methods apply :: ApplyMonad (ApplyState (Named p)) m => Named p wX wY -> m () #
Apply p => Apply (RebaseName p) # |
Associated Types type ApplyState (RebaseName p :: * -> * -> *) :: (* -> *) -> * # Methods apply :: ApplyMonad (ApplyState (RebaseName p)) m => RebaseName p wX wY -> m () #
(PrimPatchBase p, Apply p, (~) ((* -> *) -> *) (ApplyState p) (ApplyState (PrimOf p))) => Apply (RebaseFixup p) # |
Associated Types type ApplyState (RebaseFixup p :: * -> * -> *) :: (* -> *) -> * # Methods apply :: ApplyMonad (ApplyState (RebaseFixup p)) m => RebaseFixup p wX wY -> m () #
Apply p => Apply (Suspended p) # |
Associated Types type ApplyState (Suspended p :: * -> * -> *) :: (* -> *) -> * # Methods apply :: ApplyMonad (ApplyState (Suspended p)) m => Suspended p wX wY -> m () #
PrimPatch prim => Apply (RepoPatchV2 prim) # |
Associated Types type ApplyState (RepoPatchV2 prim :: * -> * -> *) :: (* -> *) -> * # Methods apply :: ApplyMonad (ApplyState (RepoPatchV2 prim)) m => RepoPatchV2 prim wX wY -> m () #
(PrimPatchBase p, Invert p, Apply p, (~) ((* -> *) -> *) (ApplyState p) (ApplyState (PrimOf p))) => Apply (RebaseChange p) # |
Associated Types type ApplyState (RebaseChange p :: * -> * -> *) :: (* -> *) -> * # Methods apply :: ApplyMonad (ApplyState (RebaseChange p)) m => RebaseChange p wX wY -> m () #
(PrimPatchBase p, Invert p, Apply p, (~) ((* -> *) -> *) (ApplyState p) (ApplyState (PrimOf p))) => Apply (RebaseSelect p) # |
Associated Types type ApplyState (RebaseSelect p :: * -> * -> *) :: (* -> *) -> * # Methods apply :: ApplyMonad (ApplyState (RebaseSelect p)) m => RebaseSelect p wX wY -> m () #
Apply p => Apply (WrappedNamed rt p) # |
Associated Types type ApplyState (WrappedNamed rt p :: * -> * -> *) :: (* -> *) -> * # Methods apply :: ApplyMonad (ApplyState (WrappedNamed rt p)) m => WrappedNamed rt p wX wY -> m () #
Apply p => Apply (PatchInfoAnd rt p) # |
Associated Types type ApplyState (PatchInfoAnd rt p :: * -> * -> *) :: (* -> *) -> * # Methods apply :: ApplyMonad (ApplyState (PatchInfoAnd rt p)) m => PatchInfoAnd rt p wX wY -> m () #

applyToFilePaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> Maybe [(FilePath, FilePath)] -> [FilePath] -> ([FilePath], [FilePath], [(FilePath, FilePath)]) #

applyToTree :: (Apply p, Functor m, Monad m, ApplyState p ~ Tree) => p wX wY -> Tree m -> m (Tree m) #

Apply a patch to a `Tree`, yielding a new `Tree`.

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) => p wX wY -> Tree IO -> IO (Maybe (Tree IO)) #

Attempts to apply a given replace patch to a Tree. If the apply fails (if the file the patch applies to already contains the target token), we return Nothing, otherwise we return the updated Tree.

applyToFileMods :: (Apply p, ApplyState p ~ Tree) => p wX wY -> Set FileName -> (Set FileName, [PatchMod FileName]) #

Apply a patch to set of `FileName`s, yielding the new set of `FileName`s and `PatchMod`s

effectOnFilePaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> [FilePath] -> [FilePath] #