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

Safe Haskell | None
Language | Haskell2010

Darcs.Patch.ApplyMonad

Synopsis

- class (Functor m, Monad m, Functor (ApplyMonadBase m), Monad (ApplyMonadBase m), ApplyMonadStateOperations state m, ToTree state) => ApplyMonad state m where
  - type ApplyMonadBase m :: * -> *
- class (Functor m, Monad m, ApplyMonad state (ApplyMonadOver state m)) => ApplyMonadTrans state m where
  - type ApplyMonadOver state m :: * -> *
- class ApplyMonadState state where
  - type ApplyMonadStateOperations state :: (* -> *) -> Constraint
- withFileNames :: Maybe [OrigFileNameOf] -> [FileName] -> FilePathMonad a -> FilePathMonadState
- withFiles :: [(FileName, ByteString)] -> RestrictedApply a -> [(FileName, ByteString)]
- class ToTree s where
- class (Functor m, Monad m) => ApplyMonadTree m where

# Documentation

class (Functor m, Monad m, Functor (ApplyMonadBase m), Monad (ApplyMonadBase m), ApplyMonadStateOperations state m, ToTree state) => ApplyMonad state m where #

Minimal complete definition

nestedApply, liftApply, getApplyState

Associated Types

type ApplyMonadBase m :: * -> * #

Methods

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

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

getApplyState :: m (state (ApplyMonadBase m)) #

Instances

ApplyMonad Tree FileModMonad # |
Associated Types type ApplyMonadBase (FileModMonad :: * -> *) :: * -> * # Methods nestedApply :: FileModMonad x -> Tree (ApplyMonadBase FileModMonad) -> FileModMonad (x, Tree (ApplyMonadBase FileModMonad)) # liftApply :: (Tree (ApplyMonadBase FileModMonad) -> ApplyMonadBase FileModMonad x) -> Tree (ApplyMonadBase FileModMonad) -> FileModMonad (x, Tree (ApplyMonadBase FileModMonad)) # getApplyState :: FileModMonad (Tree (ApplyMonadBase FileModMonad)) #
ApplyMonad Tree DefaultIO # |
Associated Types type ApplyMonadBase (DefaultIO :: * -> *) :: * -> * # Methods nestedApply :: DefaultIO x -> Tree (ApplyMonadBase DefaultIO) -> DefaultIO (x, Tree (ApplyMonadBase DefaultIO)) # liftApply :: (Tree (ApplyMonadBase DefaultIO) -> ApplyMonadBase DefaultIO x) -> Tree (ApplyMonadBase DefaultIO) -> DefaultIO (x, Tree (ApplyMonadBase DefaultIO)) # getApplyState :: DefaultIO (Tree (ApplyMonadBase DefaultIO)) #
(Functor m, Monad m) => ApplyMonad Tree (TreeMonad m) # |
Associated Types type ApplyMonadBase (TreeMonad m :: * -> *) :: * -> * # Methods nestedApply :: TreeMonad m x -> Tree (ApplyMonadBase (TreeMonad m)) -> TreeMonad m (x, Tree (ApplyMonadBase (TreeMonad m))) # liftApply :: (Tree (ApplyMonadBase (TreeMonad m)) -> ApplyMonadBase (TreeMonad m) x) -> Tree (ApplyMonadBase (TreeMonad m)) -> TreeMonad m (x, Tree (ApplyMonadBase (TreeMonad m))) # getApplyState :: TreeMonad m (Tree (ApplyMonadBase (TreeMonad m))) #
ApplyMonad Tree (HashedIO p) # |
Associated Types type ApplyMonadBase (HashedIO p :: * -> *) :: * -> * # Methods nestedApply :: HashedIO p x -> Tree (ApplyMonadBase (HashedIO p)) -> HashedIO p (x, Tree (ApplyMonadBase (HashedIO p))) # liftApply :: (Tree (ApplyMonadBase (HashedIO p)) -> ApplyMonadBase (HashedIO p) x) -> Tree (ApplyMonadBase (HashedIO p)) -> HashedIO p (x, Tree (ApplyMonadBase (HashedIO p))) # getApplyState :: HashedIO p (Tree (ApplyMonadBase (HashedIO p))) #

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

Minimal complete definition

runApplyMonad

Associated Types

type ApplyMonadOver state m :: * -> * #

Methods

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

Instances

(Functor m, Monad m) => ApplyMonadTrans Tree m # |
Associated Types type ApplyMonadOver (Tree :: (* -> *) -> *) (m :: * -> *) :: * -> * # Methods runApplyMonad :: ApplyMonadOver Tree m x -> Tree m -> m (x, Tree m) #

class ApplyMonadState state #

Associated Types

type ApplyMonadStateOperations state :: (* -> *) -> Constraint #

Instances

ApplyMonadState Tree # |
Associated Types type ApplyMonadStateOperations (Tree :: (* -> *) -> *) :: (* -> *) -> Constraint #

withFileNames :: Maybe [OrigFileNameOf] -> [FileName] -> 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.

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

class ToTree s where #

Minimal complete definition

toTree

Methods

toTree :: s m -> Tree m #

Instances

ToTree Tree # |
Methods toTree :: Tree m -> Tree m #

class (Functor m, Monad m) => ApplyMonadTree m where #

Minimal complete definition

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

Methods

mDoesDirectoryExist :: FileName -> m Bool #

mDoesFileExist :: FileName -> m Bool #

mReadFilePS :: FileName -> m ByteString #

mReadFilePSs :: FileName -> m [ByteString] #

mCreateDirectory :: FileName -> m () #

mRemoveDirectory :: FileName -> m () #

mCreateFile :: FileName -> m () #

mRemoveFile :: FileName -> m () #

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

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

mModifyFilePSs :: FileName -> ([ByteString] -> m [ByteString]) -> m () #

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

Instances

ApplyMonadTree FileModMonad # |
Methods mDoesDirectoryExist :: FileName -> FileModMonad Bool # mDoesFileExist :: FileName -> FileModMonad Bool # mReadFilePS :: FileName -> FileModMonad ByteString # mReadFilePSs :: FileName -> FileModMonad [ByteString] # mCreateDirectory :: FileName -> FileModMonad () # mRemoveDirectory :: FileName -> FileModMonad () # mCreateFile :: FileName -> FileModMonad () # mRemoveFile :: FileName -> FileModMonad () # mRename :: FileName -> FileName -> FileModMonad () # mModifyFilePS :: FileName -> (ByteString -> FileModMonad ByteString) -> FileModMonad () # mModifyFilePSs :: FileName -> ([ByteString] -> FileModMonad [ByteString]) -> FileModMonad () # mChangePref :: String -> String -> String -> FileModMonad () #
ApplyMonadTree DefaultIO # |
Methods mDoesDirectoryExist :: FileName -> DefaultIO Bool # mDoesFileExist :: FileName -> DefaultIO Bool # mReadFilePS :: FileName -> DefaultIO ByteString # mReadFilePSs :: FileName -> DefaultIO [ByteString] # mCreateDirectory :: FileName -> DefaultIO () # mRemoveDirectory :: FileName -> DefaultIO () # mCreateFile :: FileName -> DefaultIO () # mRemoveFile :: FileName -> DefaultIO () # mRename :: FileName -> FileName -> DefaultIO () # mModifyFilePS :: FileName -> (ByteString -> DefaultIO ByteString) -> DefaultIO () # mModifyFilePSs :: FileName -> ([ByteString] -> DefaultIO [ByteString]) -> DefaultIO () # mChangePref :: String -> String -> String -> DefaultIO () #
(Functor m, Monad m) => ApplyMonadTree (TreeMonad m) # |
Methods mDoesDirectoryExist :: FileName -> TreeMonad m Bool # mDoesFileExist :: FileName -> TreeMonad m Bool # mReadFilePS :: FileName -> TreeMonad m ByteString # mReadFilePSs :: FileName -> TreeMonad m [ByteString] # mCreateDirectory :: FileName -> TreeMonad m () # mRemoveDirectory :: FileName -> TreeMonad m () # mCreateFile :: FileName -> TreeMonad m () # mRemoveFile :: FileName -> TreeMonad m () # mRename :: FileName -> FileName -> TreeMonad m () # mModifyFilePS :: FileName -> (ByteString -> TreeMonad m ByteString) -> TreeMonad m () # mModifyFilePSs :: FileName -> ([ByteString] -> TreeMonad m [ByteString]) -> TreeMonad m () # mChangePref :: String -> String -> String -> TreeMonad m () #
ApplyMonadTree (HashedIO p) # |
Methods mDoesDirectoryExist :: FileName -> HashedIO p Bool # mDoesFileExist :: FileName -> HashedIO p Bool # mReadFilePS :: FileName -> HashedIO p ByteString # mReadFilePSs :: FileName -> HashedIO p [ByteString] # mCreateDirectory :: FileName -> HashedIO p () # mRemoveDirectory :: FileName -> HashedIO p () # mCreateFile :: FileName -> HashedIO p () # mRemoveFile :: FileName -> HashedIO p () # mRename :: FileName -> FileName -> HashedIO p () # mModifyFilePS :: FileName -> (ByteString -> HashedIO p ByteString) -> HashedIO p () # mModifyFilePSs :: FileName -> ([ByteString] -> HashedIO p [ByteString]) -> HashedIO p () # mChangePref :: String -> String -> String -> HashedIO p () #