Skip to content
Browse files

"-" -> "_"

  • Loading branch information...
1 parent c4ef74f commit 576345afb37dd320b626a8da9cc88bf5e74ca9fa @kazu-yamamoto committed Dec 26, 2011
Showing with 6 additions and 5 deletions.
  1. +6 −5 GenPaths.hs
View
11 GenPaths.hs
@@ -18,22 +18,23 @@ genPaths = do
case mnv of
Nothing -> hPutStrLn stderr "cabal file does not exist"
Just (nm,ver) -> do
- let file = "Paths_" ++ nm ++ ".hs"
+ let file = "Paths_" ++ nm' ++ ".hs"
exist <- doesFileExist file
if exist then
hPutStrLn stderr $ file ++ " already exists"
else do
putStrLn $ "Writing " ++ file ++ "..."
writeFile file $
- "module Paths_" ++ nm ++ " where\n"
+ "module Paths_" ++ nm' ++ " where\n"
++ "import Data.Version\n"
++ "\n"
++ "version :: Version\n"
++ "version = Version [" ++ ver' ++ "] []\n"
where
- ver' = map trans ver
- trans c
- | c == '.' = ','
+ nm' = map (trans '-' '_') nm
+ ver' = map (trans '.' ',') ver
+ trans c1 c2 c
+ | c == c1 = c2
| otherwise = c
getNameVersion :: IO (Maybe (String,String))

0 comments on commit 576345a

Please sign in to comment.
Something went wrong with that request. Please try again.