[Haskell-cafe] Unsafe IO and Wash
jgoerzen at complete.org
Wed Feb 16 09:27:31 EST 2005
On Wed, Feb 16, 2005 at 07:16:50AM +0100, Tomasz Zielonka wrote:
> 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
Yes. What I don't understand is why. If I have a submit button, and it
is passing one value to the next function, and that value is from an
entry form on the screen, why would I care about all the previous state?
That's my confusion. It seems unnecessary.
> 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.
Yeah, that's a neat feature. I'm using it some places, too. It's
probably true that I don't understand fully how to exploit it yet. (I wish
that I could return something other than () from a screen too.) I just
want a way to pass only what I need. Passing lots of stuff is going to
make my applications painful for modem users, which unfortnuately make
up a large part of the user base.
> 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.
More information about the Haskell-Cafe