{-# LANGUAGE NumericUnderscores #-} import Control.Concurrent import Control.Exception import Control.Monad thread :: IO () thread = forever (threadDelay 1_000_000) `finally` putStrLn "finally ran" main :: IO () main = do forkIO thread threadDelay 100_000 putStrLn "main exiting"