mirror of
https://github.com/joshuaclayton/unused.git
synced 2024-09-11 04:45:28 +03:00
Use void
This commit is contained in:
parent
5b69d45caf
commit
ca694df50e
@ -4,6 +4,7 @@ module Unused.CLI.Util
|
|||||||
, module System.Console.ANSI
|
, module System.Console.ANSI
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Control.Monad (void)
|
||||||
import System.Console.ANSI
|
import System.Console.ANSI
|
||||||
import Control.Exception (throwTo)
|
import Control.Exception (throwTo)
|
||||||
import System.Posix.Signals (Handler(Catch), installHandler, keyboardSignal)
|
import System.Posix.Signals (Handler(Catch), installHandler, keyboardSignal)
|
||||||
@ -18,7 +19,7 @@ resetScreen = do
|
|||||||
withInterruptHandler :: IO () -> IO ()
|
withInterruptHandler :: IO () -> IO ()
|
||||||
withInterruptHandler body = do
|
withInterruptHandler body = do
|
||||||
tid <- myThreadId
|
tid <- myThreadId
|
||||||
_ <- installHandler keyboardSignal (Catch (handleInterrupt tid)) Nothing
|
void $ installHandler keyboardSignal (Catch (handleInterrupt tid)) Nothing
|
||||||
body
|
body
|
||||||
|
|
||||||
handleInterrupt :: ThreadId -> IO ()
|
handleInterrupt :: ThreadId -> IO ()
|
||||||
|
Loading…
Reference in New Issue
Block a user