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

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Tue Nov 18 18:59:47 EST 2008


On 2008 Nov 18, at 17:55, Kyongho Min wrote:
> 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.


Consider using a special type of dynamic exception to mean "quit".

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH




More information about the Haskell-Cafe mailing list