diff options
Diffstat (limited to 'examples/phrasebook/Update.hs')
| -rw-r--r-- | examples/phrasebook/Update.hs | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/examples/phrasebook/Update.hs b/examples/phrasebook/Update.hs deleted file mode 100644 index 3d9232d61..000000000 --- a/examples/phrasebook/Update.hs +++ /dev/null @@ -1,27 +0,0 @@ -import System - -main = do - file:_ <- getArgs - updates <- readFile file >= return . readUpdates - mapM_ (doUpdate file) updates - return () - -type Update = (FilePath, [String]) - -readUpdates :: String -> [Update] -readUpdates s = [] - -doUpdate :: FilePath -> Update -> IO () -doUpdate src (target,ls) = do - s <- readFile target - let beg = dropLastBracket s - let tmp = tmpFile target - writeFile tmp beg - appendFile tmp $ unlines [(line ++ "-- UPDATE FROM " ++ src) | line <- ls] - appendFile tmp "\n}\n" - -tmpFile file = "tmp-update/"++ file - ----- quick and dirty -dropLastBracket = reverse . init . dropWhile (/='}') . reverse - |
