diff options
author | 2011-11-08 15:34:10 -0400 | |
---|---|---|
committer | 2011-11-08 16:27:20 -0400 | |
commit | bf460a0a98d7e4c7f4eac525fcf300629db582b6 (patch) | |
tree | bff7cd09529c40fa8cb76fd92428cc41e24ad808 /Git/LsTree.hs | |
parent | 2ff8915365099501382183af9855e739fc234861 (diff) |
reorder repo parameters last
Many functions took the repo as their first parameter. Changing it
consistently to be the last parameter allows doing some useful things with
currying, that reduce boilerplate.
In particular, g <- gitRepo is almost never needed now, instead
use inRepo to run an IO action in the repo, and fromRepo to get
a value from the repo.
This also provides more opportunities to use monadic and applicative
combinators.
Diffstat (limited to 'Git/LsTree.hs')
-rw-r--r-- | Git/LsTree.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Git/LsTree.hs b/Git/LsTree.hs index c072ef5be..1fcdf13ed 100644 --- a/Git/LsTree.hs +++ b/Git/LsTree.hs @@ -29,9 +29,9 @@ data TreeItem = TreeItem } deriving Show {- Lists the contents of a Treeish -} -lsTree :: Repo -> Treeish -> IO [TreeItem] -lsTree repo t = map parseLsTree <$> - pipeNullSplitB repo [Params "ls-tree --full-tree -z -r --", File t] +lsTree :: Treeish -> Repo -> IO [TreeItem] +lsTree t repo = map parseLsTree <$> + pipeNullSplitB [Params "ls-tree --full-tree -z -r --", File t] repo {- Parses a line of ls-tree output. - (The --long format is not currently supported.) -} |