darcs

Darcs.Patch.Commute

Synopsis

- fromPrims :: FromPrims p => FL Prim -> p
- modernizePatch :: Patch -> Patch
- merge :: Commute p => (p :\/: p) -> p :/\: p
- elegantMerge :: (Patch :\/: Patch) -> Maybe (Patch :/\: Patch)
- merger :: String -> Patch -> Patch -> Sealed Patch
- unravel :: Patch -> [Sealed (FL Prim)]
- publicUnravel :: Patch -> [Sealed (FL Prim)]
- mangleUnravelled :: [Sealed (FL Prim)] -> Sealed (FL Prim)
- type CommuteFunction = (Patch :< Patch) -> Perhaps (Patch :< Patch)
- data Perhaps a
  - = Unknown
  - | Failed
  - | Succeeded a
- toMaybe :: Perhaps a -> Maybe a

# Documentation

fromPrims :: FromPrims p => FL Prim -> p

modernizePatch :: Patch -> Patch

`modernizePatch` is used during conversion to Darcs 2 format. It does the following:

- removes mergers by linearising them, thus removing the ability to commute them
- drops mv a b ; add b which was introduced by an error in earlier versions of darcs (TODO: check this; identify the versions)

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

elegantMerge :: (Patch :\/: Patch) -> Maybe (Patch :/\: Patch)

merger :: String -> Patch -> Patch -> Sealed Patch

unravel :: Patch -> [Sealed (FL Prim)]

publicUnravel :: Patch -> [Sealed (FL Prim)]

mangleUnravelled :: [Sealed (FL Prim)] -> Sealed (FL Prim)

type CommuteFunction = (Patch :< Patch) -> Perhaps (Patch :< Patch)

data Perhaps a

Constructors

Unknown |
Failed |
Succeeded a |

Instances

Monad Perhaps |
MonadPlus Perhaps |

toMaybe :: Perhaps a -> Maybe a