[Haskell-cafe] Unsafe IO and Wash

Tomasz Zielonka tomasz.zielonka at gmail.com
Wed Feb 16 01:16:50 EST 2005


On Wed, Feb 16, 2005 at 04:33:29AM +0000, John Goerzen wrote:
> On a related note, Wash seems to be preserving all sorts of unnecessary
> "state" from previous screens a user visited.

You do know that the current version of WASH rebuilds the continuation
by repeating all the previous steps, don't you? Until WASH can keep the
continuations on the server, it will have to pass all those parameters.
This is necessary.

> I don't understand why it doesn't pass only the parameters to the next
> screen; that should be easily determined to be all that is necessary.

It would be, I there was a server-side continuation store.

Perhaps you don't see the whole power of continuation based approach
to web programming. I will give you an example - when I use WASH, I
often pass first-class functions to from screen to screen, for example
as a way of telling the screen what to do next (a continuation), or as
the most convenient way to do something. It would be quite difficult
to pass those functions as form parameters, so they are being rebuilt
each time from the log.

> On that same topic, I've used Wash's unsafe_io some places with no ill
> effects.

Are you sure your IO actions will always yield the same result? If so,
the you can safely use unsafe_io. Otherwise you should let was save
the result of them in the log by using io.

> (Note that this has no relationship to unsafePerformIO, which
> is a different beast entirely.)  Can anyone tell me why unsafe_io in
> Wash is unsafe, and in which situations it could blow up in my face?

If you I actions can give different results when called for the second,
third, ..., nth time.

Best regards
Tomasz

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


More information about the Haskell-Cafe mailing list