[Haskell] Programme terminates silently

Thomas Bevan thomas.bevan at gmail.com
Sat May 31 03:53:26 EDT 2008


Hi,

I've written the programme below.

The lircLoop should never terminate. Unfortunately it does. Worse, no error
messages are generated.
Not even the final line "Closing down" is printed.

How is this possible?

Thanks for your help.

import Hmpf.Tree as T
import Control.Concurrent hiding (forkIO)
import Control.Exception
import Prelude hiding (catch)
import Hmpf.Fork
import System.Log.Logger
import System.Log.Handler.Simple
import System.Log.Handler
import System.IO
import Network.MPD
import Control.Monad.Trans (liftIO)



main :: IO ()
main = do
 initializeLogging
 lirc <- newChan
 lcd <- newChan
 startLirc device lirc
 startLCD "localhost" 13666 lcd
 forkIO logger $
  mpdLoop lcd mpd
 catch (lircLoop lirc lcd mpd)
       (\e -> errorM logger "Lirc loop died" >> (errorM logger (show e)))
 putStrLn "Closing down"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell/attachments/20080531/73695231/attachment.htm


More information about the Haskell mailing list