cook -> toTupple.

This commit is contained in:
Kazu Yamamoto 2013-03-03 15:51:41 +09:00
parent aa0b1d709c
commit e14dff7508

View File

@ -69,11 +69,11 @@ cabalDir dir = do
isCabal name = ".cabal" `isSuffixOf` name && length name > 6 isCabal name = ".cabal" `isSuffixOf` name && length name > 6
ghcVersion :: IO (String, Int) ghcVersion :: IO (String, Int)
ghcVersion = ghcVer >>= cook ghcVersion = ghcVer >>= toTupple
where where
ghcVer = programFindVersion ghcProgram silent (programName ghcProgram) ghcVer = programFindVersion ghcProgram silent (programName ghcProgram)
cook Nothing = throwIO $ userError $ "ghc not found" toTupple Nothing = throwIO $ userError $ "ghc not found"
cook (Just v) toTupple (Just v)
| length vs < 2 = return (verstr, 0) | length vs < 2 = return (verstr, 0)
| otherwise = return (verstr, ver) | otherwise = return (verstr, ver)
where where