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
ApplyMonad Tree DefaultIO # | |
Defined in Darcs.Repository.ApplyPatches Methods readFilePS :: ObjectIdOf Tree -> DefaultIO ByteString # | |
MonadThrow m => ApplyMonad Tree (TreeMonad m) # | |
Defined in Darcs.Patch.ApplyMonad Methods readFilePS :: ObjectIdOf Tree -> TreeMonad m ByteString # | |
MonadThrow m => ApplyMonad ObjectMap (StateT (ObjectMap m) m) # | |
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
MonadThrow m => ApplyMonadTrans ObjectMap m # | |||||
Defined in Darcs.Patch.Prim.FileUUID.Apply Associated Types
Methods runApplyMonad :: ApplyMonadOver ObjectMap m x -> ObjectMap m -> m (x, ObjectMap m) # | |||||
MonadThrow m => ApplyMonadTrans Tree m # | |||||
Defined in Darcs.Patch.ApplyMonad Associated Types
Methods runApplyMonad :: ApplyMonadOver Tree m x -> Tree m -> m (x, Tree m) # |
type family ApplyMonadOperations (state :: (Type -> Type) -> Type) :: (Type -> Type) -> Constraint #
Instances
type ApplyMonadOperations ObjectMap # | |
Defined in Darcs.Patch.Prim.FileUUID.Apply | |
type ApplyMonadOperations Tree # | |
Defined in Darcs.Patch.ApplyMonad |
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
evalApplyMonad :: ApplyMonadTrans state m => ApplyMonadOver state m a -> state m -> m a #