Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type EditTree = Map TreeEntry TreePart
- data TreePart
- = PartSha Sha1
- | PartData ByteString
- | PartTree EditTree
- newtype TreeEdit m a = TreeEdit {
- runTreeEdit :: StateT EditTree m a
- loadEditTree :: (MonadGit m, MonadFail m) => Sha1 -> m EditTree
- writeEditTree :: MonadGit m => EditTree -> m Sha1
- don'tEditTree :: MonadGit m => EditTree -> TreeEdit m a -> m EditTree
- editTree :: MonadGit m => EditTree -> TreeEdit m a -> m EditTree
- rm :: Monad m => TreeEntry -> TreeEdit m ()
- cd :: (MonadFail m, MonadGit m) => RawFilePath -> TreeEdit m a -> TreeEdit m a
- cd' :: (MonadFail m, MonadGit m) => [PathComponent] -> TreeEdit m a -> TreeEdit m a
- cd1 :: (MonadFail m, MonadGit m) => PathComponent -> TreeEdit m a -> TreeEdit m a
- create :: Monad m => TreeEntry -> TreePart -> TreeEdit m ()
- mkdir :: MonadFail m => PathComponent -> TreeEdit m ()
- cdCreating :: (MonadFail m, MonadGit m) => RawFilePath -> TreeEdit m a -> TreeEdit m a
- cdCreating' :: (MonadFail m, MonadGit m) => [PathComponent] -> TreeEdit m a -> TreeEdit m a
- createFiles :: Monad m => Map PathComponent ByteString -> TreeEdit m ()
Documentation
The leaves of an EditTree
---either a hash, Blob
data, or a subtree.
A monad for editing EditTree
s.
TreeEdit | |
|
Instances
MonadTrans TreeEdit Source # | |
Defined in Data.Git.EditTree | |
Monad m => MonadState EditTree (TreeEdit m) Source # | |
Monad m => Monad (TreeEdit m) Source # | |
Functor m => Functor (TreeEdit m) Source # | |
MonadFail m => MonadFail (TreeEdit m) Source # | |
Defined in Data.Git.EditTree | |
Monad m => Applicative (TreeEdit m) Source # | |
MonadIO m => MonadIO (TreeEdit m) Source # | |
Defined in Data.Git.EditTree |
loadEditTree :: (MonadGit m, MonadFail m) => Sha1 -> m EditTree Source #
Turn the given treeish Sha1
into an EditTree
whose leaves are all hashes.
writeEditTree :: MonadGit m => EditTree -> m Sha1 Source #
Traverse an EditTree
, writing new objects, and return the Sha1
of the new Tree
.
cd :: (MonadFail m, MonadGit m) => RawFilePath -> TreeEdit m a -> TreeEdit m a Source #
Run a TreeEdit
in the subtree at the given path.
cd' :: (MonadFail m, MonadGit m) => [PathComponent] -> TreeEdit m a -> TreeEdit m a Source #
As cd
, but with a list of path components.
cd1 :: (MonadFail m, MonadGit m) => PathComponent -> TreeEdit m a -> TreeEdit m a Source #
A one-level version of cd
.
create :: Monad m => TreeEntry -> TreePart -> TreeEdit m () Source #
Place a new leaf with the given filename.
mkdir :: MonadFail m => PathComponent -> TreeEdit m () Source #
Create a subtree with the given filename.
cdCreating :: (MonadFail m, MonadGit m) => RawFilePath -> TreeEdit m a -> TreeEdit m a Source #
Create a path into the tree and do some TreeEdit
s in that location.
cdCreating' :: (MonadFail m, MonadGit m) => [PathComponent] -> TreeEdit m a -> TreeEdit m a Source #
As cdCreating
, but with a list of path components.
createFiles :: Monad m => Map PathComponent ByteString -> TreeEdit m () Source #
A shortcut to create a bunch of files at once.