expose Control.Monad.join
I think I've been looking for that function for some time. Ie, I remember wanting to collapse Just Nothing to Nothing.
This commit is contained in:
parent
2a84deb271
commit
8a2d1988d3
19 changed files with 30 additions and 32 deletions
|
@ -156,7 +156,7 @@ url2file url pathdepth = case pathdepth of
|
|||
| otherwise -> error "bad --pathdepth"
|
||||
where
|
||||
fullurl = uriRegName auth ++ uriPath url ++ uriQuery url
|
||||
frombits a = join "/" $ a urlbits
|
||||
frombits a = intercalate "/" $ a urlbits
|
||||
urlbits = map (filesize . escape) $ filter (not . null) $ split "/" fullurl
|
||||
auth = fromMaybe (error $ "bad url " ++ show url) $ uriAuthority url
|
||||
filesize = take 255
|
||||
|
|
|
@ -31,7 +31,7 @@ start [] = do
|
|||
error $ "Specify a name for the remote. " ++
|
||||
if null names
|
||||
then ""
|
||||
else "Either a new name, or one of these existing special remotes: " ++ join " " names
|
||||
else "Either a new name, or one of these existing special remotes: " ++ intercalate " " names
|
||||
start (name:ws) = do
|
||||
(u, c) <- findByName name
|
||||
let fullconfig = config `M.union` c
|
||||
|
|
|
@ -95,7 +95,7 @@ runRequests readh writeh a = do
|
|||
|
||||
sendRequest :: Transfer -> AssociatedFile -> Handle -> IO ()
|
||||
sendRequest t f h = do
|
||||
hPutStr h $ join fieldSep
|
||||
hPutStr h $ intercalate fieldSep
|
||||
[ serialize (transferDirection t)
|
||||
, serialize (transferUUID t)
|
||||
, serialize (transferKey t)
|
||||
|
|
|
@ -27,12 +27,10 @@ start = do
|
|||
showPackageVersion
|
||||
putStrLn $ "local repository version: " ++ fromMaybe "unknown" v
|
||||
putStrLn $ "default repository version: " ++ defaultVersion
|
||||
putStrLn $ "supported repository versions: " ++ vs supportedVersions
|
||||
putStrLn $ "upgrade supported from repository versions: " ++ vs upgradableVersions
|
||||
putStrLn $ "supported repository versions: " ++ unwords supportedVersions
|
||||
putStrLn $ "upgrade supported from repository versions: " ++ unwords upgradableVersions
|
||||
putStrLn $ "build flags: " ++ unwords buildFlags
|
||||
stop
|
||||
where
|
||||
vs = join " "
|
||||
|
||||
showPackageVersion :: IO ()
|
||||
showPackageVersion = putStrLn $ "git-annex version: " ++ SysConfig.packageversion
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue