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:
Joey Hess 2013-04-22 20:24:53 -04:00
parent 2a84deb271
commit 8a2d1988d3
19 changed files with 30 additions and 32 deletions

View file

@ -143,7 +143,7 @@ oldlog2key l
-- as the v2 key that it is.
readKey1 :: String -> Key
readKey1 v
| mixup = fromJust $ file2key $ join ":" $ Prelude.tail bits
| mixup = fromJust $ file2key $ intercalate ":" $ Prelude.tail bits
| otherwise = Key
{ keyName = n
, keyBackendName = b
@ -153,7 +153,7 @@ readKey1 v
where
bits = split ":" v
b = Prelude.head bits
n = join ":" $ drop (if wormy then 3 else 1) bits
n = intercalate ":" $ drop (if wormy then 3 else 1) bits
t = if wormy
then Just (Prelude.read (bits !! 1) :: EpochTime)
else Nothing
@ -165,7 +165,7 @@ readKey1 v
showKey1 :: Key -> String
showKey1 Key { keyName = n , keyBackendName = b, keySize = s, keyMtime = t } =
join ":" $ filter (not . null) [b, showifhere t, showifhere s, n]
intercalate ":" $ filter (not . null) [b, showifhere t, showifhere s, n]
where
showifhere Nothing = ""
showifhere (Just v) = show v