darcs-2.18.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 :: Type -> Type -> Type) where
  - type ApplyState (p :: Type -> Type -> Type) :: (Type -> Type) -> Type
  - apply :: ApplyMonad (ApplyState p) m => p wX wY -> m ()
  - unapply :: ApplyMonad (ApplyState p) m => p wX wY -> m ()
- type ObjectIdOfPatch (p :: Type -> Type -> Type) = 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 :: (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

class Apply (p :: Type -> Type -> Type) where #

Minimal complete definition

apply

Associated Types

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

Methods

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

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

default unapply :: (ApplyMonad (ApplyState p) m, Invert p) => p wX wY -> m () #

#### Instances

Instances details

Apply Prim # |
Instance details Defined in Darcs.Patch.Prim.FileUUID.Apply Associated Types
type ApplyState Prim |
Instance details Defined in Darcs.Patch.Prim.FileUUID.Apply type ApplyState Prim = ObjectMap
Methods apply :: ApplyMonad (ApplyState Prim) m => Prim wX wY -> m () # unapply :: ApplyMonad (ApplyState Prim) m => Prim wX wY -> m () #
Apply Prim # |
Instance details Defined in Darcs.Patch.Prim.V1.Apply Associated Types
type ApplyState Prim |
Instance details Defined in Darcs.Patch.Prim.V1.Apply type ApplyState Prim = Tree
Methods apply :: ApplyMonad (ApplyState Prim) m => Prim wX wY -> m () # unapply :: ApplyMonad (ApplyState Prim) m => Prim wX wY -> m () #
Apply Prim # |
Instance details Defined in Darcs.Patch.V1.Prim Associated Types
type ApplyState Prim |
Instance details Defined in Darcs.Patch.V1.Prim type ApplyState Prim = ApplyState Prim
Methods apply :: ApplyMonad (ApplyState Prim) m => Prim wX wY -> m () # unapply :: ApplyMonad (ApplyState Prim) m => Prim wX wY -> m () #
Apply Prim # |
Instance details Defined in Darcs.Patch.V2.Prim Associated Types
type ApplyState Prim |
Instance details Defined in Darcs.Patch.V2.Prim type ApplyState Prim = ApplyState Prim
Methods apply :: ApplyMonad (ApplyState Prim) m => Prim wX wY -> m () # unapply :: ApplyMonad (ApplyState Prim) m => Prim wX wY -> m () #
Apply p => Apply (Invertible p) # |
Instance details Defined in Darcs.Patch.Invertible Associated Types
type ApplyState (Invertible p) |
Instance details Defined in Darcs.Patch.Invertible type ApplyState (Invertible p) = ApplyState p
Methods apply :: ApplyMonad (ApplyState (Invertible p)) m => Invertible p wX wY -> m () # unapply :: ApplyMonad (ApplyState (Invertible p)) m => Invertible p wX wY -> m () #
Apply p => Apply (Named p) # |
Instance details Defined in Darcs.Patch.Named Associated Types
type ApplyState (Named p) |
Instance details Defined in Darcs.Patch.Named type ApplyState (Named p) = ApplyState p
Methods apply :: ApplyMonad (ApplyState (Named p)) m => Named p wX wY -> m () # unapply :: ApplyMonad (ApplyState (Named p)) m => Named p wX wY -> m () #
Apply p => Apply (PatchInfoAndG p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Associated Types
type ApplyState (PatchInfoAndG p) |
Instance details Defined in Darcs.Patch.PatchInfoAnd type ApplyState (PatchInfoAndG p) = ApplyState p
Methods apply :: ApplyMonad (ApplyState (PatchInfoAndG p)) m => PatchInfoAndG p wX wY -> m () # unapply :: ApplyMonad (ApplyState (PatchInfoAndG p)) m => PatchInfoAndG p wX wY -> m () #
Apply prim => Apply (RebaseChange prim) # |
Instance details Defined in Darcs.Patch.Rebase.Change Associated Types
type ApplyState (RebaseChange prim) |
Instance details Defined in Darcs.Patch.Rebase.Change type ApplyState (RebaseChange prim) = ApplyState prim
Methods apply :: ApplyMonad (ApplyState (RebaseChange prim)) m => RebaseChange prim wX wY -> m () # unapply :: ApplyMonad (ApplyState (RebaseChange prim)) m => RebaseChange prim wX wY -> m () #
Apply prim => Apply (RebaseFixup prim) # |
Instance details Defined in Darcs.Patch.Rebase.Fixup Associated Types
type ApplyState (RebaseFixup prim) |
Instance details Defined in Darcs.Patch.Rebase.Fixup type ApplyState (RebaseFixup prim) = ApplyState prim
Methods apply :: ApplyMonad (ApplyState (RebaseFixup prim)) m => RebaseFixup prim wX wY -> m () # unapply :: ApplyMonad (ApplyState (RebaseFixup prim)) m => RebaseFixup prim wX wY -> m () #
PrimPatch prim => Apply (RepoPatchV1 prim) # |
Instance details Defined in Darcs.Patch.V1.Apply Associated Types
type ApplyState (RepoPatchV1 prim) |
Instance details Defined in Darcs.Patch.V1.Apply type ApplyState (RepoPatchV1 prim) = ApplyState prim
Methods apply :: ApplyMonad (ApplyState (RepoPatchV1 prim)) m => RepoPatchV1 prim wX wY -> m () # unapply :: ApplyMonad (ApplyState (RepoPatchV1 prim)) m => RepoPatchV1 prim wX wY -> m () #
PrimPatch prim => Apply (RepoPatchV2 prim) # |
Instance details Defined in Darcs.Patch.V2.RepoPatch Associated Types
type ApplyState (RepoPatchV2 prim) |
Instance details Defined in Darcs.Patch.V2.RepoPatch type ApplyState (RepoPatchV2 prim) = ApplyState prim
Methods apply :: ApplyMonad (ApplyState (RepoPatchV2 prim)) m => RepoPatchV2 prim wX wY -> m () # unapply :: ApplyMonad (ApplyState (RepoPatchV2 prim)) m => RepoPatchV2 prim wX wY -> m () #
Apply p => Apply (FL p) # |
Instance details Defined in Darcs.Patch.Apply Associated Types
type ApplyState (FL p) |
Instance details Defined in Darcs.Patch.Apply type ApplyState (FL p) = ApplyState p
Methods apply :: ApplyMonad (ApplyState (FL p)) m => FL p wX wY -> m () # unapply :: ApplyMonad (ApplyState (FL p)) m => FL p wX wY -> m () #
Apply p => Apply (RL p) # |
Instance details Defined in Darcs.Patch.Apply Associated Types
type ApplyState (RL p) |
Instance details Defined in Darcs.Patch.Apply type ApplyState (RL p) = ApplyState p
Methods apply :: ApplyMonad (ApplyState (RL p)) m => RL p wX wY -> m () # unapply :: ApplyMonad (ApplyState (RL p)) m => RL p wX wY -> m () #
Apply p => Apply (PrimWithName name p) # |
Instance details Defined in Darcs.Patch.Prim.WithName Associated Types
type ApplyState (PrimWithName name p) |
Instance details Defined in Darcs.Patch.Prim.WithName type ApplyState (PrimWithName name p) = ApplyState p
Methods apply :: ApplyMonad (ApplyState (PrimWithName name p)) m => PrimWithName name p wX wY -> m () # unapply :: ApplyMonad (ApplyState (PrimWithName name p)) m => PrimWithName name p wX wY -> m () #
PrimPatch prim => Apply (RepoPatchV3 name prim) # |
Instance details Defined in Darcs.Patch.V3.Core Associated Types
type ApplyState (RepoPatchV3 name prim) |
Instance details Defined in Darcs.Patch.V3.Core type ApplyState (RepoPatchV3 name prim) = ApplyState prim
Methods apply :: ApplyMonad (ApplyState (RepoPatchV3 name prim)) m => RepoPatchV3 name prim wX wY -> m () # unapply :: ApplyMonad (ApplyState (RepoPatchV3 name prim)) m => RepoPatchV3 name prim wX wY -> m () #
Apply p => Apply (PatchSeq p) # |
Instance details Defined in Darcs.UI.Commands.Test.Impl Associated Types
type ApplyState (PatchSeq p) |
Instance details Defined in Darcs.UI.Commands.Test.Impl type ApplyState (PatchSeq p) = ApplyState p
Methods apply :: ApplyMonad (ApplyState (PatchSeq p)) m => PatchSeq p wX wY -> m () # unapply :: ApplyMonad (ApplyState (PatchSeq p)) m => PatchSeq p wX wY -> m () #

type ObjectIdOfPatch (p :: Type -> Type -> Type) = 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) #

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

applyToState :: (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)) #

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] #