|
Re: Imperative Object Destruction: msg#00047lang.haskell.general
On Mon, 13 Nov 2000, Ashley Yakeley wrote: > Well, it doesn't solve the problem I'm interested in. The file-handling > is just an example, I'd like to solve it for any kind of object > destruction, so that this kind of error is always caught at compile-time. I don't think it's possible without limiting convenience / usefulness. When an arbitrary IO action may be executed to deal with the object, it can put it into a mutable reference and then used anywhere, or passed to another thread, and you've lost control over it. It can be done in a way similar to the ST monad of GHC and Hugs: tagging objects and actions with type variables and using a special type for running the computation which ensures that reference don't escape the computation (and if they are accessed from elsewhere then they are not usable there anyway). It restricts doable actions to those provided by the ST monad - no mixing with arbitrary IO. -- Marcin 'Qrczak' Kowalczyk |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: Imperative Object Destruction: 00047, Simon Marlow |
|---|---|
| Next by Date: | RE: Hugs and Linux: 00047, Mark P Jones |
| Previous by Thread: | Re: Imperative Object Destructioni: 00047, Ashley Yakeley |
| Next by Thread: | RE: Imperative Object Destruction: 00047, Simon Marlow |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |