[Haskell-cafe] How to make interface IO() to IO a in a command-driven tool

Kyongho Min min at cse.unsw.edu.au
Mon Nov 17 18:28:25 EST 2008


Dear Haskell users,

I am working on a command-driven tool (::IO ()).
If the system invokes itself again, and the system's returned
data type would be 'IO a', say (IO Exp) (Expression).

tool:: a -> IO()

The nested tool invocation returns (IO Exp) to the previous tool.
I am using dynamic error exception handling like (throwDyn exp).

If I use 'forkIO', then it works for this situation (e.g. IO Exp) but it 
is not working for 'quit' command (quit the tool:: thread blocked 
indefinitely) - quit the subtool and return to the previous tool.

Any suggestion would be helpful?

tool = {tool1, tool2, tool3, ...}

tool1:: (IO ())
   invoked  tool2:: (IO a)
      may invoked tool3:: (IO a)

tool2 is working basically on IO() and if I got the Exp (proved), then 
return it to the previous tool (say tool1).

Thanks in advance,

min


More information about the Haskell-Cafe mailing list