[Haskell-cafe] IO and Wash

Tomasz Zielonka tomasz.zielonka at gmail.com
Wed Feb 16 10:30:46 EST 2005

On Wed, Feb 16, 2005 at 08:30:29AM -0600, John Goerzen wrote:
> Ahh, I think I understand what you're saying...  table_io is not
> supposed to be unsafe; that is, it should work without saving data in
> the log even if the input would be different on a different session.
> But yes, if the validation fails, there would be no way to do that save
> re-reading the input.

It seems to be the case.

> It sounds like, in my case, unsafe_io would be better.  My input should
> never change across a single session.

You can do this, but it's fragile.

> The next question is this: the I/O really only needs to be done once.
> Once the user has selected an item, that's enough.  If my understanding
> is correct, on each subsequent screen in my application, Wash will
> follow through the entire call history, and will run the I/O again even
> if not needed.

Unless you use once or io, which put the result of an IO action in the
log, so there is no need to fire the action again. But they increase the

> Is that correct?  Or does the unsafe_io prevent that?

unsafe_io is unsafe in that it can make WASH go out of sync. You should
rather use io, when it's possible.

> Thanks for all your help.  I appreciate it and apologize for being so
> dense about Wash.

You're welcome.

Best regards

Szukamy programisty C++ i Haskell'a: http://tinyurl.com/5mw4e

More information about the Haskell-Cafe mailing list