diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2015-06-09 23:41:57 +0200 | 
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2015-06-09 23:41:57 +0200 | 
| commit | 4f9f222bc91f4bcd505cb584cbcc874c86b529c8 (patch) | |
| tree | 6c6555f2dbf6086f2a02411cd7cadd0d9f92247d /src | |
| parent | e68fae39b23ef87d354cb82a57243297ee82ea5c (diff) | |
| download | trivmix-4f9f222bc91f4bcd505cb584cbcc874c86b529c8.tar trivmix-4f9f222bc91f4bcd505cb584cbcc874c86b529c8.tar.gz trivmix-4f9f222bc91f4bcd505cb584cbcc874c86b529c8.tar.bz2 trivmix-4f9f222bc91f4bcd505cb584cbcc874c86b529c8.tar.xz trivmix-4f9f222bc91f4bcd505cb584cbcc874c86b529c8.zip | |
Now only looping until fixpoint
Diffstat (limited to 'src')
| -rw-r--r-- | src/Trivmix.hs | 6 | 
1 files changed, 4 insertions, 2 deletions
| diff --git a/src/Trivmix.hs b/src/Trivmix.hs index 69fcea2..425de4a 100644 --- a/src/Trivmix.hs +++ b/src/Trivmix.hs | |||
| @@ -194,8 +194,10 @@ readLevel levelChan current file = catch action handler | |||
| 194 | where | 194 | where | 
| 195 | action = do | 195 | action = do | 
| 196 | level <- readFile file >>= readIO . stripSpace | 196 | level <- readFile file >>= readIO . stripSpace | 
| 197 | writeChan levelChan level | 197 | oldLevel <- readMVar current | 
| 198 | hPutStrLn stderr $ "Detected new level: " ++ (show level) | 198 | when (oldLevel /= level) $ do | 
| 199 | writeChan levelChan level | ||
| 200 | hPutStrLn stderr $ "Detected new level: " ++ (show level) | ||
| 199 | handler e = if isUserError e | 201 | handler e = if isUserError e | 
| 200 | then do | 202 | then do | 
| 201 | hPutStrLn stderr $ "Could not parse new level from ‘" ++ file ++ "’ - overwriting." | 203 | hPutStrLn stderr $ "Could not parse new level from ‘" ++ file ++ "’ - overwriting." | 
