## time out a process in haskell

i’m trying to figure out a good way to timeout a process in haskell. i will look later to see if someone actually already did this. the problem i have is that i want to exit the program with a timeout failure which is the opposite of what i have so far:

import Control.Concurrent
import System.Exit

timeout n proc = do
i <- forkIO proc
timer n
putStrLn "timed out!"

main = do
timeout 1 $forever$ putStrLn "bob!"


this is just a sketch of what i worked from. what i think i want to do is fork a timer process and when it ends, i want the entire program to end. i’ve tried adding exitFailure but it only ends that thread, not the entire process.

just kidding

i figured it out. i did something awful like this:

do