Donald Bruce Stewart wrote:

Can I ask if just using a `seq` works as well? That was enough (now I
recall) for the watchdog code I posted earlier.

-- Don

In my case this doesn't work

>timeout :: DeepSeq a => Int -> IO a -> IO (Maybe a)
>timeout n t = do res <- par_io timer thr  --timer
>                 return res
>    where thr = do res <- t
>                   return $! Just res
>          timer = do threadDelay $ n * 1000
>                     return Nothing

It's probably because "resolve" function has type
> resolve :: CNF -> (Bool, [(Int,Int)])
So it should be sequenced deeper.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to