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

Safe Haskell | None
Language | Haskell2010

Darcs.Patch.ApplyMonad

Synopsis

- class (Monad m, ApplyMonadOperations state m) => ApplyMonad (state :: (Type -> Type) -> Type) (m :: Type -> Type) | m -> state where
  - readFilePS :: ObjectIdOf state -> m ByteString
- class (Monad m, ApplyMonad state (ApplyMonadOver state m)) => ApplyMonadTrans (state :: (Type -> Type) -> Type) (m :: Type -> Type) where
  - type ApplyMonadOver (state :: (Type -> Type) -> Type) (m :: Type -> Type) :: Type -> Type
  - runApplyMonad :: ApplyMonadOver state m x -> state m -> m (x, state m)
- type family ApplyMonadOperations (state :: (Type -> Type) -> Type) :: (Type -> Type) -> Constraint
- withFileNames :: Maybe [OrigFileNameOf] -> [AnchoredPath] -> FilePathMonad a -> FilePathMonadState
- class MonadThrow m => ApplyMonadTree (m :: Type -> Type) where
  - mDoesDirectoryExist :: AnchoredPath -> m Bool
  - mDoesFileExist :: AnchoredPath -> m Bool
  - mReadFilePS :: AnchoredPath -> m ByteString
  - mCreateDirectory :: AnchoredPath -> m ()
  - mRemoveDirectory :: AnchoredPath -> m ()
  - mCreateFile :: AnchoredPath -> m ()
  - mRemoveFile :: AnchoredPath -> m ()
  - mRename :: AnchoredPath -> AnchoredPath -> m ()
  - mModifyFilePS :: AnchoredPath -> (ByteString -> m ByteString) -> m ()
  - mChangePref :: String -> String -> String -> m ()
- evalApplyMonad :: ApplyMonadTrans state m => ApplyMonadOver state m a -> state m -> m a

# Documentation

class (Monad m, ApplyMonadOperations state m) => ApplyMonad (state :: (Type -> Type) -> Type) (m :: Type -> Type) | m -> state where #

Methods

readFilePS :: ObjectIdOf state -> m ByteString #

#### Instances

Instances details

ApplyMonad Tree DefaultIO # |
Instance details Defined in Darcs.Repository.ApplyPatches Methods readFilePS :: ObjectIdOf Tree -> DefaultIO ByteString #
MonadThrow m => ApplyMonad Tree (TreeMonad m) # |
Instance details Defined in Darcs.Patch.ApplyMonad Methods readFilePS :: ObjectIdOf Tree -> TreeMonad m ByteString #
MonadThrow m => ApplyMonad ObjectMap (StateT (ObjectMap m) m) # |
Instance details Defined in Darcs.Patch.Prim.FileUUID.Apply Methods readFilePS :: ObjectIdOf ObjectMap -> StateT (ObjectMap m) m ByteString #

class (Monad m, ApplyMonad state (ApplyMonadOver state m)) => ApplyMonadTrans (state :: (Type -> Type) -> Type) (m :: Type -> Type) where #

Associated Types

type ApplyMonadOver (state :: (Type -> Type) -> Type) (m :: Type -> Type) :: Type -> Type #

Methods

runApplyMonad :: ApplyMonadOver state m x -> state m -> m (x, state m) #

#### Instances

Instances details

MonadThrow m => ApplyMonadTrans ObjectMap m # |

Instance details

Defined in Darcs.Patch.Prim.FileUUID.Apply

Associated Types

type ApplyMonadOver ObjectMap m |
Instance details Defined in Darcs.Patch.Prim.FileUUID.Apply type ApplyMonadOver ObjectMap m = StateT (ObjectMap m) m

Methods

runApplyMonad :: ApplyMonadOver ObjectMap m x -> ObjectMap m -> m (x, ObjectMap m) #

MonadThrow m => ApplyMonadTrans Tree m # |

Instance details

Defined in Darcs.Patch.ApplyMonad

Associated Types

type ApplyMonadOver Tree m |
Instance details Defined in Darcs.Patch.ApplyMonad type ApplyMonadOver Tree m = TreeMonad m

Methods

runApplyMonad :: ApplyMonadOver Tree m x -> Tree m -> m (x, Tree m) #

type family ApplyMonadOperations (state :: (Type -> Type) -> Type) :: (Type -> Type) -> Constraint #

#### Instances

Instances details

type ApplyMonadOperations ObjectMap # |
Instance details Defined in Darcs.Patch.Prim.FileUUID.Apply type ApplyMonadOperations ObjectMap
type ApplyMonadOperations Tree # |
Instance details Defined in Darcs.Patch.ApplyMonad type ApplyMonadOperations Tree = ApplyMonadTree

withFileNames :: Maybe [OrigFileNameOf] -> [AnchoredPath] -> FilePathMonad a -> FilePathMonadState #

withFileNames takes a maybe list of existing rename-pairs, a list of filenames and an action, and returns the resulting triple of affected files, updated filename list and new rename details. If the rename-pairs are not present, a new list is generated from the filesnames.

class MonadThrow m => ApplyMonadTree (m :: Type -> Type) where #

Minimal complete definition

mDoesDirectoryExist, mDoesFileExist, mReadFilePS, mCreateDirectory, mRemoveDirectory, mCreateFile, mRemoveFile, mRename, mModifyFilePS

Methods

mDoesDirectoryExist :: AnchoredPath -> m Bool #

mDoesFileExist :: AnchoredPath -> m Bool #

mReadFilePS :: AnchoredPath -> m ByteString #

mCreateDirectory :: AnchoredPath -> m () #

mRemoveDirectory :: AnchoredPath -> m () #

mCreateFile :: AnchoredPath -> m () #

mRemoveFile :: AnchoredPath -> m () #

mRename :: AnchoredPath -> AnchoredPath -> m () #

mModifyFilePS :: AnchoredPath -> (ByteString -> m ByteString) -> m () #

mChangePref :: String -> String -> String -> m () #

#### Instances

Instances details

ApplyMonadTree DefaultIO # |

Instance details

Defined in Darcs.Repository.ApplyPatches

Methods

mDoesDirectoryExist :: AnchoredPath -> DefaultIO Bool #

mDoesFileExist :: AnchoredPath -> DefaultIO Bool #

mReadFilePS :: AnchoredPath -> DefaultIO ByteString #

mCreateDirectory :: AnchoredPath -> DefaultIO () #

mRemoveDirectory :: AnchoredPath -> DefaultIO () #

mCreateFile :: AnchoredPath -> DefaultIO () #

mRemoveFile :: AnchoredPath -> DefaultIO () #

mRename :: AnchoredPath -> AnchoredPath -> DefaultIO () #

mModifyFilePS :: AnchoredPath -> (ByteString -> DefaultIO ByteString) -> DefaultIO () #

mChangePref :: String -> String -> String -> DefaultIO () #

MonadThrow m => ApplyMonadTree (TreeMonad m) # |

Instance details

Defined in Darcs.Patch.ApplyMonad

Methods

mDoesDirectoryExist :: AnchoredPath -> TreeMonad m Bool #

mDoesFileExist :: AnchoredPath -> TreeMonad m Bool #

mReadFilePS :: AnchoredPath -> TreeMonad m ByteString #

mCreateDirectory :: AnchoredPath -> TreeMonad m () #

mRemoveDirectory :: AnchoredPath -> TreeMonad m () #

mCreateFile :: AnchoredPath -> TreeMonad m () #

mRemoveFile :: AnchoredPath -> TreeMonad m () #

mRename :: AnchoredPath -> AnchoredPath -> TreeMonad m () #

mModifyFilePS :: AnchoredPath -> (ByteString -> TreeMonad m ByteString) -> TreeMonad m () #

mChangePref :: String -> String -> String -> TreeMonad m () #

evalApplyMonad :: ApplyMonadTrans state m => ApplyMonadOver state m a -> state m -> m a #