on master help sign in
rename ev → sig

ev was first chosen because the data structure used was Control.Concurrent.Event which seemed to be the best fit at the time. sig, short for signal, seems to be more intuitive

commit2e71fbea07da5bd818b0fc7a3b83517c9806d570 authorPatrick Palka <patrick@parcs.ath.cx> dateSat 14 May 2011, 07:55 (15 years ago) parent518128c
1 file changed+11−11
Network/Wai/Handler/DevelServer.hs+11−11
Network/Wai/Handler/DevelServer.hs+11−11
@@ -43,25 +43,25 @@ runNoWatch port modu func extras = do
4343runQuit :: Int -> ModuleName -> FunctionName -> (FilePath -> IO [FilePath])
4444 -> IO ()
4545runQuit port modu func extras = do
46− ev <- newEmptyMVar
47− _ <- forkIO $ run port modu func extras (Just ev)
48− go ev
46+ sig <- newEmptyMVar
47+ _ <- forkIO $ run port modu func extras (Just sig)
48+ go sig
4949 where
50− go ev = do
50+ go sig = do
5151 x <- getLine
5252 case x of
5353 'q':_ -> putStrLn "Quitting, goodbye!"
5454 'r':_ -> do
5555 putStrLn "Forcing reinterpretation"
56− _ <- tryPutMVar ev ()
57− go ev
58− _ -> go ev
56+ _ <- tryPutMVar sig ()
57+ go sig
58+ _ -> go sig
5959
6060run :: Int -> ModuleName -> FunctionName -> (FilePath -> IO [FilePath]) -> Maybe (MVar ())
6161 -> IO ()
62−run port modu func extras mev = do
62+run port modu func extras msig = do
6363 ah <- initAppHolder
64− _ <- forkIO $ fillApp modu func extras ah mev
64+ _ <- forkIO $ fillApp modu func extras ah msig
6565 Warp.run port $ toApp ah
6666
6767{-
@@ -94,11 +94,11 @@ constSE = const
9494
9595fillApp :: String -> String
9696 -> (FilePath -> IO [FilePath]) -> AppHolder -> Maybe (MVar ()) -> IO ()
97−fillApp modu func dirs ah mev =
97+fillApp modu func dirs ah msig =
9898 go Nothing []
9999 where
100100 go prevError prevFiles = do
101− forceReload <- maybe (return False) (fmap isJust . tryTakeMVar) mev
101+ forceReload <- maybe (return False) (fmap isJust . tryTakeMVar) msig
102102 toReload <-
103103 if forceReload || null prevFiles
104104 then return True