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

Darcs.Patch.Patchy

Synopsis

- class (Apply p, Commute p, ShowPatch p, ReadPatch p, Invert p) => Patchy p
- class Apply p where
  - apply :: WriteableDirectory m => [DarcsFlag] -> p -> m ()
  - applyAndTryToFix :: WriteableDirectory m => p -> m (Maybe (String, p))
  - applyAndTryToFixFL :: WriteableDirectory m => p -> m (Maybe (String, FL p))
- mapMaybeSnd :: (a -> b) -> Maybe (c, a) -> Maybe (c, b)
- class Commute p where
  - commute :: (p :> p) -> Maybe (p :> p)
  - merge :: (p :\/: p) -> p :/\: p
  - listTouchedFiles :: p -> [FilePath]
  - hunkMatches :: (ByteString -> Bool) -> p -> Bool
- commuteFLorComplain :: Commute p => (p :> FL p) -> Either (Sealed2 p) (FL p :> p)
- commuteRL :: Commute p => (RL p :> p) -> Maybe (p :> RL p)
- commuteFL :: Commute p => (p :> FL p) -> Maybe (FL p :> p)
- commuteRLFL :: Commute p => (RL p :> FL p) -> Maybe (FL p :> RL p)
- mergeFL :: Commute p => (p :\/: FL p) -> FL p :/\: p
- toFwdCommute :: (Commute p, Commute q, Monad m) => ((p :< q) -> m (q :< p)) -> (q :> p) -> m (p :> q)
- toRevCommute :: (Commute p, Commute q, Monad m) => ((p :> q) -> m (q :> p)) -> (q :< p) -> m (p :< q)
- class Commute p => ShowPatch p where
  - showPatch :: p -> Doc
  - showNicely :: p -> Doc
  - showContextPatch :: p -> TreeIO Doc
  - description :: p -> Doc
  - summary :: p -> Doc
  - writePatch :: FilePath -> p -> IO ()
  - gzWritePatch :: FilePath -> p -> IO ()
  - thing :: p -> String
  - things :: p -> String
- class ReadPatch p where
  - readPatch' :: ParserM m => Bool -> m (Maybe (Sealed p))
- bracketedFL :: forall p m. (ReadPatch p, ParserM m) => m (Maybe (Sealed p)) -> Word8 -> Word8 -> m (Maybe (Sealed (FL p)))
- peekfor :: ParserM m => String -> m a -> m a -> m a
- class MyEq p => Invert p where
  - invert :: p -> p
  - identity :: p
  - sloppyIdentity :: p -> EqCheck
- invertFL :: Invert p => FL p -> RL p
- invertRL :: Invert p => RL p -> FL p

# Documentation

class (Apply p, Commute p, ShowPatch p, ReadPatch p, Invert p) => Patchy p

Instances

Patchy Prim |
Patchy Patch |
Patchy RealPatch |
(Conflict p, Patchy p) => Patchy (RL p) |
(Conflict p, Patchy p) => Patchy (FL p) |
(Conflict p, Effect p, Patchy p) => Patchy (Named p) |
RepoPatch p => Patchy (PatchInfoAnd p) |

class Apply p where

Methods

apply :: WriteableDirectory m => [DarcsFlag] -> p -> m ()

applyAndTryToFix :: WriteableDirectory m => p -> m (Maybe (String, p))

applyAndTryToFixFL :: WriteableDirectory m => p -> m (Maybe (String, FL p))

Instances

Apply Prim |
Apply Patch |
Apply RealPatch |
Apply p => Apply (RL p) |
Apply p => Apply (FL p) |
Apply p => Apply (Named p) |
Apply p => Apply (PatchInfoAnd p) |

mapMaybeSnd :: (a -> b) -> Maybe (c, a) -> Maybe (c, b)

class Commute p where

Things that can commute.

Methods

commute :: (p :> p) -> Maybe (p :> p)

merge :: (p :\/: p) -> p :/\: p

listTouchedFiles :: p -> [FilePath]

hunkMatches :: (ByteString -> Bool) -> p -> Bool

Instances

Commute Prim |
Commute Patch |
Commute RealPatch |
Commute p => Commute (RL p) |
Commute p => Commute (FL p) |
Commute p => Commute (Named p) |
Commute p => Commute (PatchInfoAnd p) |
Commute p => Commute (PatchChoice p) |
Commute p => Commute (TaggedPatch p) |

commuteFLorComplain :: Commute p => (p :> FL p) -> Either (Sealed2 p) (FL p :> p)

commuteRL :: Commute p => (RL p :> p) -> Maybe (p :> RL p)

commuteFL :: Commute p => (p :> FL p) -> Maybe (FL p :> p)

commuteRLFL :: Commute p => (RL p :> FL p) -> Maybe (FL p :> RL p)

mergeFL :: Commute p => (p :\/: FL p) -> FL p :/\: p

toFwdCommute :: (Commute p, Commute q, Monad m) => ((p :< q) -> m (q :< p)) -> (q :> p) -> m (p :> q)

Swaps the ordered pair type so that commute can be called directly.

toRevCommute :: (Commute p, Commute q, Monad m) => ((p :> q) -> m (q :> p)) -> (q :< p) -> m (p :< q)

Swaps the ordered pair type from the order expected by commute to the reverse order.

class Commute p => ShowPatch p where

Methods

showPatch :: p -> Doc

showNicely :: p -> Doc

showContextPatch :: p -> TreeIO Doc

description :: p -> Doc

summary :: p -> Doc

writePatch :: FilePath -> p -> IO ()

gzWritePatch :: FilePath -> p -> IO ()

thing :: p -> String

things :: p -> String

Instances

ShowPatch Prim |
ShowPatch Patch |
ShowPatch RealPatch |
(Conflict p, Apply p, ShowPatch p) => ShowPatch (RL p) |
(Conflict p, Apply p, Effect p, ShowPatch p) => ShowPatch (FL p) |
(Conflict p, ShowPatch p) => ShowPatch (Named p) |
(Conflict p, Effect p, ShowPatch p) => ShowPatch (PatchInfoAnd p) |

class ReadPatch p where

Methods

readPatch' :: ParserM m => Bool -> m (Maybe (Sealed p))

Instances

ReadPatch Prim |
ReadPatch Patch |
ReadPatch RealPatch |
ReadPatch p => ReadPatch (RL p) |
ReadPatch p => ReadPatch (FL p) |
ReadPatch p => ReadPatch (Named p) |
ReadPatch p => ReadPatch (PatchInfoAnd p) |

bracketedFL :: forall p m. (ReadPatch p, ParserM m) => m (Maybe (Sealed p)) -> Word8 -> Word8 -> m (Maybe (Sealed (FL p)))

peekfor :: ParserM m => String -> m a -> m a -> m a

class MyEq p => Invert p where

Methods

invert :: p -> p

identity :: p

sloppyIdentity :: p -> EqCheck

Instances

Invert Prim |
Invert Patch |
Invert RealPatch |
(Commute p, Invert p) => Invert (RL p) |
(Invert p, Commute p) => Invert (FL p) |
Invert p => Invert (Named p) |
Invert p => Invert (PatchInfoAnd p) |
Invert p => Invert (TaggedPatch p) |

invertFL :: Invert p => FL p -> RL p

invertRL :: Invert p => RL p -> FL p