I've written a little sample program that shows how you can do continuation-based web programming in Haskell. It currently runs on top of Happstack (it could easily be adapted to other platforms). I am quite interested in your thoughts on this. I've put a self-contained example online at http://gist.github.com/260052
Although there are some limitations to this approach, this is how I would like to write my websites in Haskell. I'm currently investigating other approaches as well (e.g. an arrow-based approach), but just I thought I'd share it.
> I've written a little sample program that shows how you can do > continuation-based web programming in Haskell. It currently runs on > top of Happstack (it could easily be adapted to other platforms). I am > quite interested in your thoughts on this.
I find it not easy to read because of the choice of names. E.g. You call a web continuation a Web. Why not Continuation or WebContinuation? Similarly runWeb. Does this mean runWebContinuation? And runPage for a function that ignores the request. No doubt there's logic in that, but if it were called ignoreRequest, I might find it easier to read the example.
Anyway, it looks very interesting. I might try converting my current effort for an image gallery to that style, and see if it reads easier. -- Colin Adams Preston, Lancashire, ENGLAND
> I've written a little sample program that shows how you can do > continuation-based web programming in Haskell. It currently runs on > top of Happstack (it could easily be adapted to other platforms). I am > quite interested in your thoughts on this. I've put a self-contained > example online at http://gist.github.com/260052
That's really neat. How about a link to this on the happstack.com tutorials page?
> I've written a little sample program that shows how you can do > continuation-based web programming in Haskell. It currently runs on > top of Happstack (it could easily be adapted to other platforms). I am > quite interested in your thoughts on this. I've put a self-contained > example online at http://gist.github.com/260052
> Although there are some limitations to this approach, this is how I > would like to write my websites in Haskell. I'm currently > investigating other approaches as well (e.g. an arrow-based approach), > but just I thought I'd share it.
> -chris
> --
> You received this message because you are subscribed to the Google > Groups "HAppS" group. > To post to this group, send email to happs@googlegroups.com. > To unsubscribe from this group, send email to happs+unsubscribe@googlegroups.com > . > For more options, visit this group at http://groups.google.com/group/happs?hl=en > .
Well, this is different in a couple of ways. First of all, it is unfinished. The basic idea works, but it's impossible to serialize continuations, which is a serious problem, as I'm pretty sure it can't be fixed. So this doesn't scale to multiple servers or run on CGI. Wash works by reconstructing a log for the state, whereas this approach keeps the continuation in an MVar (one per application, which should be one per session).
I think it could be altered and extended to be serializable and work for multiple users. I have some ideas for that which I'll be testing (hopefully somewhere in the next couple of weeks).
I just wanted to share this as inspiration, you should definitely not yet use this for real-world things...
> I have not had time to understand how this works yet. But now that 0.4 > is out, I hopefully can!
> How is it similar to or different from WASH/CGI ?
> - jeremy
> On Dec 19, 2009, at 9:47 AM, Chris Eidhof wrote:
>> Hey Happstackers,
>> I've written a little sample program that shows how you can do >> continuation-based web programming in Haskell. It currently runs on >> top of Happstack (it could easily be adapted to other platforms). I >> am >> quite interested in your thoughts on this. I've put a self-contained >> example online at http://gist.github.com/260052
>> Although there are some limitations to this approach, this is how I >> would like to write my websites in Haskell. I'm currently >> investigating other approaches as well (e.g. an arrow-based >> approach), >> but just I thought I'd share it.
>> -chris
>> --
>> You received this message because you are subscribed to the Google >> Groups "HAppS" group. >> To post to this group, send email to happs@googlegroups.com. >> To unsubscribe from this group, send email to happs+unsubscribe@googlegroups.com >> . >> For more options, visit this group at http://groups.google.com/group/happs?hl=en >> .
> --
> You received this message because you are subscribed to the Google > Groups "HAppS" group. > To post to this group, send email to happs@googlegroups.com. > To unsubscribe from this group, send email to happs+unsubscribe@googlegroups.com > . > For more options, visit this group at http://groups.google.com/group/happs?hl=en > .