darcs-beta-2.7.99.2: a distributed, interactive, smart revision control system

Safe HaskellSafe-Infered

Darcs.Patch.ApplyMonad

Synopsis

Documentation

class (Functor m, Monad m, Functor (ApplyMonadBase m), Monad (ApplyMonadBase m), ToTree state) => ApplyMonad m state whereSource

Associated Types

type ApplyMonadBase m :: * -> *Source

Methods

nestedApply :: m x -> state (ApplyMonadBase m) -> m (x, state (ApplyMonadBase m))Source

liftApply :: (state (ApplyMonadBase m) -> ApplyMonadBase m x) -> state (ApplyMonadBase m) -> m (x, state (ApplyMonadBase m))Source

getApplyState :: m (state (ApplyMonadBase m))Source

putApplyState :: state m -> m ()Source

editFile :: state ~ ObjectMap => UUID -> (ByteString -> ByteString) -> m ()Source

editDirectory :: state ~ ObjectMap => UUID -> (DirContent -> DirContent) -> m ()Source

mDoesDirectoryExist :: state ~ Tree => FileName -> m BoolSource

mDoesFileExist :: state ~ Tree => FileName -> m BoolSource

mReadFilePS :: state ~ Tree => FileName -> m ByteStringSource

mReadFilePSs :: state ~ Tree => FileName -> m [ByteString]Source

mCreateDirectory :: state ~ Tree => FileName -> m ()Source

mRemoveDirectory :: state ~ Tree => FileName -> m ()Source

mCreateFile :: state ~ Tree => FileName -> m ()Source

mRemoveFile :: state ~ Tree => FileName -> m ()Source

mRename :: state ~ Tree => FileName -> FileName -> m ()Source

mModifyFilePS :: state ~ Tree => FileName -> (ByteString -> m ByteString) -> m ()Source

mModifyFilePSs :: state ~ Tree => FileName -> ([ByteString] -> m [ByteString]) -> m ()Source

mChangePref :: state ~ Tree => String -> String -> String -> m ()Source

Instances

ApplyMonad IO Tree 
ApplyMonad RestrictedApply Tree 
ApplyMonad FilePathMonad Tree 
ApplyMonad AnnotatedM Tree 
ApplyMonad SilentIO Tree 
ApplyMonad TolerantIO Tree 
(Functor m, Monad m) => ApplyMonad (TreeMonad m) Tree 
ApplyMonad (HashedIO p) Tree 
(Functor m, Monad m) => ApplyMonad (StateT (ObjectMap m) m) ObjectMap 

class (Functor m, Monad m, ApplyMonad (ApplyMonadOver m state) state) => ApplyMonadTrans m state whereSource

Associated Types

type ApplyMonadOver m state :: * -> *Source

Methods

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

withFileNames :: Maybe [OrigFileNameOf] -> [FileName] -> FilePathMonad a -> FilePathMonadStateSource

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.

withFiles :: [(FileName, ByteString)] -> RestrictedApply a -> [(FileName, ByteString)]Source

class ToTree s whereSource

Methods

toTree :: s m -> Tree mSource