From johan.tibell@gmail.com Thu Mar 29 13:47:43 2007 From: Johan Tibell To: web-devel@haskell.org Subject: [web-devel] A light-weight web framework Date: Thu, 29 Mar 2007 19:48:33 +0200 Message-ID: <90889fe70703291048v1e628edbhb16b5d9c360adbc2@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7992092400665784106==" --===============7992092400665784106== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Inspired by the ease with which Joe Gregorio put together a framework in Python using some components [1] I'm inspired to create some components of my own so the same thing can be done in Haskell. I'm aiming for creating some thing /really/ simple and I want to start with writing a templating system or a database wrapper. But first, what has been done in this area already already? I'm aware of at least some template like efforts [2]. For the templating system I don't think I want a DSL like approach (ala Lisp with (body (h1 "Foo")) etc. but rather a solution where code and templates are kept separate. Here's a really simple interface. compileTemplate :: Stringable a =3D> a -> Template renderTemplate :: (Show a, Stringable b) =3D> Template -> Map Stringable a ->= b Or something along those lines. Compiling the template makes subsequent rendering faster and ByteString adds even more speed. With some templating language like so: ...

{{ title }}

'title' is looked up in the Map when the template is rendered. The other option would be inline Haskell code: ...

<% postTitle title %>

Where 'title' is a record data type. There's also a middle ground like with Django's templates that supports restricted inline code. I guess the restriction is unnecessary in Haskell as we can disallow mutation of values quite easily (?). 1. http://bitworking.org/news/Why_so_many_Python_web_frameworks 2. http://blog.moertel.com/articles/2006/10/18/a-type-based-solution-to-the-s= trings-problem --===============7992092400665784106==-- From rich.neswold@gmail.com Thu Mar 29 14:29:32 2007 From: Rich Neswold To: web-devel@haskell.org Subject: Re: [web-devel] A light-weight web framework Date: Thu, 29 Mar 2007 13:30:25 -0500 Message-ID: <14cf844b0703291130r744d09dp800600462bf737f0@mail.gmail.com> In-Reply-To: <90889fe70703291048v1e628edbhb16b5d9c360adbc2@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3136935222041474399==" --===============3136935222041474399== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On 3/29/07, Johan Tibell wrote: > I want to start with writing a templating system or a database wrapper. But= first, what has been done in this area already already? There was recent announcement on the Haskell lists about "Chunks". (http://www.wellquite.org/index.php/chunks/) This sounds like something you described. I've only played with the examples given, so I don't know how well it scales on a larger project. --=20 Rich AIM : rnezzy ICQ : 174908475 Jabber: rich@neswold.homeunix.net --===============3136935222041474399==-- From chris@eidhof.nl Thu Mar 29 23:12:15 2007 From: Chris Eidhof To: web-devel@haskell.org Subject: Re: [web-devel] A light-weight web framework Date: Thu, 29 Mar 2007 20:12:57 -0700 Message-ID: <4EE09B9B-4F23-4895-9E59-A243B19A8B22@eidhof.nl> In-Reply-To: <90889fe70703291048v1e628edbhb16b5d9c360adbc2@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3963130526711494310==" --===============3963130526711494310== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit I'm interested in seeing something like this too. However, I am a big fan of DSL, especially if they're designed correctly. The crux to having a good DSL is thinking: "How do I *really* want to write this?", and starting from there on. I haven't really thought about those things for a web-framework yet. -chris On Mar 29, 2007, at 10:48 AM, Johan Tibell wrote: > Inspired by the ease with which Joe Gregorio put together a framework > in Python using some components [1] I'm inspired to create some > components of my own so the same thing can be done in Haskell. I'm > aiming for creating some thing /really/ simple and I want to start > with writing a templating system or a database wrapper. But first, > what has been done in this area already already? I'm aware of at least > some template like efforts [2]. For the templating system I don't > think I want a DSL like approach (ala Lisp with (body (h1 "Foo")) etc. > but rather a solution where code and templates are kept separate. > Here's a really simple interface. > > compileTemplate :: Stringable a => a -> Template > renderTemplate :: (Show a, Stringable b) => Template -> Map > Stringable a -> b > > Or something along those lines. Compiling the template makes > subsequent rendering faster and ByteString adds even more speed. > > With some templating language like so: > > > ... > >

{{ title }}

> > > > 'title' is looked up in the Map when the template is rendered. The > other option would be inline Haskell code: > > > ... > >

<% postTitle title %>

> > > > Where 'title' is a record data type. There's also a middle ground like > with Django's templates that supports restricted inline code. I guess > the restriction is unnecessary in Haskell as we can disallow mutation > of values quite easily (?). > > 1. http://bitworking.org/news/Why_so_many_Python_web_frameworks > 2. http://blog.moertel.com/articles/2006/10/18/a-type-based- > solution-to-the-strings-problem > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel --===============3963130526711494310==-- From prstanley@ntlworld.com Mon Apr 2 01:41:21 2007 From: PR Stanley To: web-devel@haskell.org Subject: [web-devel] Testing, please do not respond Date: Mon, 02 Apr 2007 06:42:36 +0100 Message-ID: <7.0.1.0.0.20070402064129.01b5b110@ntlworld.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8358138762749755774==" --===============8358138762749755774== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hello This is only a test. Please do not reply to this message. --===============8358138762749755774==-- From prstanley@ntlworld.com Mon Apr 2 01:50:25 2007 From: PR Stanley To: web-devel@haskell.org Subject: [web-devel] testing II Date: Mon, 02 Apr 2007 06:51:44 +0100 Message-ID: <7.0.1.0.0.20070402065124.01b5d090@ntlworld.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2866923097465069986==" --===============2866923097465069986== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit --===============2866923097465069986==-- From wagner.andrew@gmail.com Tue Apr 3 09:35:55 2007 From: Andrew Wagner To: web-devel@haskell.org Subject: [web-devel] Re: [Haskell] The real Monad Transformer Date: Tue, 03 Apr 2007 09:37:03 -0400 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1415485873754056872==" --===============1415485873754056872== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Henning, This link is broken for me... On 4/3/07, Henning Thielemann wrote: > > It was argued that people avoid Haskell because of terms from Category > theory like 'Monad'. This problem can now be solved by a wrapper which > presents all the WWW without monads! Start e.g. at > http://saxophone.jpberlin.de/MonadTransformer?source=3Dhttp%3A%2F%2Fwww%2E= haskell%2Eorg%2Fhaskellwiki%2FCategory%3AMonad&language=3DEnglish > Of course the tool is written in Haskell, that is, Haskell helps solving > problems which only exist because of Haskell. > Bug reports and feature requests can be tracked at > https://sourceforge.net/projects/parallelweb > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > --===============1415485873754056872==-- From asandroq@gmail.com Tue Apr 3 09:41:01 2007 From: Alex Queiroz To: web-devel@haskell.org Subject: Re: [web-devel] Re: [Haskell] The real Monad Transformer Date: Tue, 03 Apr 2007 10:42:10 -0300 Message-ID: <54e12800704030642t7f0818e8w5c0e9d230248d7c8@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6702721483813015715==" --===============6702721483813015715== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hallo, On 4/3/07, Andrew Wagner wrote: > On 4/3/07, Henning Thielemann wrote: > > > > It was argued that people avoid Haskell because of terms from Category > > theory like 'Monad'. This problem can now be solved by a wrapper which > > presents all the WWW without monads! Start e.g. at > > http://saxophone.jpberlin.de/MonadTransformer?source=3Dhttp%3A%2F%2Fwww%= 2Ehaskell%2Eorg%2Fhaskellwiki%2FCategory%3AMonad&language=3DEnglish > > Of course the tool is written in Haskell, that is, Haskell helps solving > > problems which only exist because of Haskell. > > Bug reports and feature requests can be tracked at > > https://sourceforge.net/projects/parallelweb Hahaha, cool! "This tutorial aims to explain the concept of a warm, fuzzy thing and its application to functional programming in a way that is easy to understand and useful to beginning and intermediate Haskell programmers. Familiarity with the Haskell language is assumed, but no prior experience with warm, fuzzy things is required. The tutorial covers a lot of material and the later sections require a thorough understanding of the earlier material. Many code examples are provided along the way to demonstrate warm, fuzzy programming. It is not advisable to attempt to absorb all of the material in a single reading." --=20 -alex --===============6702721483813015715==-- From dmhouse@gmail.com Thu Apr 5 08:49:17 2007 From: David House To: web-devel@haskell.org Subject: Re: [web-devel] A light-weight web framework Date: Thu, 05 Apr 2007 13:50:34 +0100 Message-ID: In-Reply-To: <4EE09B9B-4F23-4895-9E59-A243B19A8B22@eidhof.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4532999050170948687==" --===============4532999050170948687== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 30/03/07, Chris Eidhof wrote: > I'm interested in seeing something like this too. However, I am a big > fan of DSL, especially if they're designed correctly. The crux to > having a good DSL is thinking: "How do I *really* want to write > this?", and starting from there on. I haven't really thought about > those things for a web-framework yet. I'd agree with this. Haskell is astonishingly expressive and can support all kinds of levels of EDSLs. I've been writing forum software in Haskell and came across this decision: do I write my templates in HTML + some code or in Haskell? I couldn't really see any disadvantages to the latter, and the advantages were obviously that I got all the traditional Haskell functions and features, and so on. I still maintain a fairly strict MVC structure within the application; the controllers compute the necessary parameters for the templates and pass them in. For reference, here's one of my templates: -- | The 'V' monad, in which our viewers execute. type V a = WriterT ViewOut (Reader ViewEnv) a type Viewer = V Html -- | View the public profile of a user. vUser :: User -> Viewer vUser u = do tell $ VO { voTitle = usrDisplay u, voBreadcrumbs = singleton indexLink } usr <- asks veUser let hdr = h2 << usrDisplay u dfns = [("Name: ", primHtml $ usrDisplay u), ("Registered at: ", primHtml $ renderCalTime (usrRegistered u)), ("Url: ", toHtml $ hotlink (usrUrl u) << usrUrl u), ("Blurb: ", primHtml $ usrBlurb u)] del = whenPermitted usr RmUser $ hotlink (userUrl u ++ "/delete") << "Delete user" return $ hdr +++ defList dfns +++ cappedOps [del] -- -David House, dmhouse@gmail.com --===============4532999050170948687==-- From joelr1@gmail.com Thu Apr 5 09:00:44 2007 From: Joel Reymont To: web-devel@haskell.org Subject: Re: [web-devel] A light-weight web framework Date: Thu, 05 Apr 2007 14:02:04 +0100 Message-ID: <4E655FB1-0B5C-47C8-A22E-0D0E51816661@gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3199142204068460930==" --===============3199142204068460930== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit David, Why do you want to embed Haskell code in templates? Why not go with an approach like Zope TAL? Thanks, Joel -- http://wagerlabs.com/ --===============3199142204068460930==-- From dmhouse@gmail.com Thu Apr 5 09:50:15 2007 From: David House To: web-devel@haskell.org Subject: Re: [web-devel] A light-weight web framework Date: Thu, 05 Apr 2007 14:51:31 +0100 Message-ID: In-Reply-To: <4E655FB1-0B5C-47C8-A22E-0D0E51816661@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5588614547271022662==" --===============5588614547271022662== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 05/04/07, Joel Reymont wrote: > Why do you want to embed Haskell code in templates? Why add another dependency, force your coders to learn another language, restrict yourself to a language which isn't as expressive as Haskell, reduce your ability to reuse code from different areas of the project and decrease project-wide consistency when you could just write your templates in Haskell to begin with? Haskell is the king of EDSL. Let's take advantage of that. -- -David House, dmhouse@gmail.com --===============5588614547271022662==-- From joelr1@gmail.com Thu Apr 5 10:29:35 2007 From: Joel Reymont To: web-devel@haskell.org Subject: Re: [web-devel] A light-weight web framework Date: Thu, 05 Apr 2007 15:30:53 +0100 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9198533417840177449==" --===============9198533417840177449== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Apr 5, 2007, at 2:51 PM, David House wrote: > Why add another dependency, force your coders to learn another > language, restrict yourself to a language which isn't as expressive as > Haskell, reduce your ability to reuse code from different areas of the > project and decrease project-wide consistency when you could just > write your templates in Haskell to begin with? Embedding code in web templates doesn't work well when you have designers on board. Let me elaborate on my approach as it doesn't reduce or restrict anything! I'm suggesting that you make your templates look like this, which is parseable as XML. Note the "tal:" tags. Please scroll through to the bottom for more thoughts. Page title

Heading

Hello wo rld

Message

  • Hard-coded
  • Dummy

Back to index

The above expands into this: Demo page

Demo page

Hello Bruno

(c) 2006

  • Hard-coded
  • Xavier
  • Damien
  • Jacques
  • Didier
  • Jerome

Back to index

Note how
  • Hard-coded
  • Dummy
is expanded to
  • Hard-coded
  • Xavier
  • Damien
  • Jacques
  • Didier
  • Jerome
This is nice and _very_ clean and allows you to use any Haskell code you want to _process_ the template. You can, in fact, make template processing recursive and have tags produce more tags, i.e. make your components produce HTML instead of data for tags in the template. What do you think? -- http://wagerlabs.com/ --===============9198533417840177449==-- From lemming@henning-thielemann.de Thu Apr 5 11:37:55 2007 From: Henning Thielemann To: web-devel@haskell.org Subject: [web-devel] Parse HTTP headers Date: Thu, 05 Apr 2007 17:23:53 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2184850977083918310==" --===============2184850977083918310== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit First of all, I want to say that I like Network.HTTP.HeaderName being an enumeration like type because of the advantages that are listed in the HTTP module. HeaderName has a Show instance which shows the header name as the HTTP protocoll requires that. I don't find it good, since I like to copy output values in GHCi back to the GHCi prompt. I'm missing a Read instance or a parsing routine to convert String -> HeaderName. I want to do the following: I download HTML pages from the web which may contain META-HTTP-EQUIV tags. I want to merge the HTTP header, that I got from the web server, with the META information of the downloaded HTML page. I like to merge them in terms of HTTP.Header, not in terms of (String,String) and I also like to have a function like HTTP.findHeader to extract some information from this list. (Currently I'm mainly interested in Content-Type and Content-Language.) --===============2184850977083918310==-- From maurice.codik@gmail.com Thu Apr 5 13:15:35 2007 From: Maurice Codik To: web-devel@haskell.org Subject: Re: [web-devel] A light-weight web framework Date: Thu, 05 Apr 2007 10:16:50 -0700 Message-ID: <2927e5d70704051016v75be99b5t9a6d5cc0eb4bf4ad@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2014167226022137156==" --===============2014167226022137156== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > > Embedding code in web templates doesn't work well when you have > designers on board. > That's not necesarily true. Templates where there is mostly markup, but let you embed code into them using special tags (ex, <% code %>) are extremely popular and work fairly well. They also keep the template language simple because there is already a full-powered programming language thats embedded into it. Good examples of this method are ERB templates in Rails, JSPs, Perl Mason templates, etc. In these cases one of two things happen: either the designers learn enough of the programming language to embed the right things in, or they just hand off HTML to the developers, who can then replace the dynamic parts with <% %> tags. If I'm a designer and I have learn a new templating language anyway, I may as well just learn a little bit of Haskell/Ruby/Perl/Java/whatever. The best choice of templating technology really depends who the target audience of the web framework is. Has there been much thought given to that yet? Maurice On 4/5/07, Joel Reymont wrote: > > > On Apr 5, 2007, at 2:51 PM, David House wrote: > > > Why add another dependency, force your coders to learn another > > language, restrict yourself to a language which isn't as expressive as > > Haskell, reduce your ability to reuse code from different areas of the > > project and decrease project-wide consistency when you could just > > write your templates in Haskell to begin with? > > Embedding code in web templates doesn't work well when you have > designers on board. > > Let me elaborate on my approach as it doesn't reduce or restrict > anything! > > I'm suggesting that you make your templates look like this, which is > parseable as XML. Note the "tal:" tags. Please scroll through to the > bottom for more thoughts. > > > > > Page title > > >

Heading

>

> Hello tal:replace="visitor/name">wo > rld >

>

Message

>
    >
  • Hard-coded
  • >
  • tal:content="ite > m/name">Dummy
  • >
>

> Back to > index >

> > > > The above expands into this: > > > > Demo page > > >

Demo page

>

> Hello > Bruno >

>

(c) 2006

>
    >
  • Hard-coded
  • >
  • Xavier
  • >
  • Damien
  • >
  • Jacques
  • >
  • Didier
  • >
  • Jerome
  • >
>

> Back to > index >

> > > > Note how > >
    >
  • Hard-coded
  • >
  • tal:content="ite > m/name">Dummy
  • >
> > is expanded to > >
    >
  • Hard-coded
  • >
  • Xavier
  • >
  • Damien
  • >
  • Jacques
  • >
  • Didier
  • >
  • Jerome
  • >
> > This is nice and _very_ clean and allows you to use any Haskell code > you want to _process_ the template. You can, in fact, make template > processing recursive and have tags produce more tags, i.e. make your > components produce HTML instead of data for tags in the template. > > What do you think? > > -- > http://wagerlabs.com/ > > > > > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > -- http://blog.mauricecodik.com --===============2014167226022137156== Content-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gaHJlZj0iaHR0cDovL2Jsb2cubWF1cmljZWNvZGlrLmNvbSI+aHR0cDovL2Js b2cubWF1cmljZWNvZGlrLmNvbTwvYT4gCg== --===============2014167226022137156==-- From joelr1@gmail.com Thu Apr 5 13:29:58 2007 From: Joel Reymont To: web-devel@haskell.org Subject: Re: [web-devel] A light-weight web framework Date: Thu, 05 Apr 2007 18:31:17 +0100 Message-ID: In-Reply-To: <2927e5d70704051016v75be99b5t9a6d5cc0eb4bf4ad@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7465088057457648768==" --===============7465088057457648768== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Do you see anything wrong with the approach I suggested, though? On Apr 5, 2007, at 6:16 PM, Maurice Codik wrote: > That's not necesarily true. Templates where there is mostly markup, > but let you embed code into them using special tags (ex, <% code % > >) are extremely popular and work fairly well. They also keep the > template language simple because there is already a full-powered > programming language thats embedded into it. Good examples of this > method are ERB templates in Rails, JSPs, Perl Mason templates, etc. -- http://wagerlabs.com/ --===============7465088057457648768==-- From maurice.codik@gmail.com Thu Apr 5 14:16:42 2007 From: Maurice Codik To: web-devel@haskell.org Subject: Re: [web-devel] A light-weight web framework Date: Thu, 05 Apr 2007 11:17:58 -0700 Message-ID: <2927e5d70704051117i14760c62y5aaa7a4ddf7113e@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0914521838759287833==" --===============0914521838759287833== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit A few things, some of which I sort of mentioned in my previous email: - If I'm already going to commit some time to learn a templating language, why dont I just spend that same amount of time learning the little bit of haskell I need to make the template work? If thats too much to ask, I can just spit out HTML, and have the programmer put in the dynamic parts for me. Both of these scenarios seem to be a more efficient use of time. - Who is the target audience? If its a big organization where there are multiple designers and multiple devs, then your approach may work just fine. If its the single developer, then something like what David suggested would work even better. If its a small team (which may or may not include a full-time designer), then something like what I suggested would work best. For a web framework for haskell, I would guess that the latter two are much more likely. - Embedding a real programming language in a template already gives you power to do what ever you need to do. What if you need to implement some logic that the template language doesnt support? In those cases, you're usually out of luck and have to move that logic into a controller, where it doesnt really belong (assuming its actual display logic, not business logic). - It's really just a matter of taste. Any web framework thats worth using should be flexible in its support of view technologies, but come with one thats a sensible default. Maurice On 4/5/07, Joel Reymont wrote: > > Do you see anything wrong with the approach I suggested, though? > > On Apr 5, 2007, at 6:16 PM, Maurice Codik wrote: > > > That's not necesarily true. Templates where there is mostly markup, > > but let you embed code into them using special tags (ex, <% code % > > >) are extremely popular and work fairly well. They also keep the > > template language simple because there is already a full-powered > > programming language thats embedded into it. Good examples of this > > method are ERB templates in Rails, JSPs, Perl Mason templates, etc. > > -- > http://wagerlabs.com/ > > > > > > -- http://blog.mauricecodik.com --===============0914521838759287833== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdj5BIGZldyB0aGluZ3MsJm5ic3A7c29tZSBvZiB3aGljaCBJIHNvcnQgb2YgbWVudGlvbmVk IGluIG15IHByZXZpb3VzIGVtYWlsOjwvZGl2Pgo8ZGl2PiZuYnNwOzwvZGl2Pgo8ZGl2Pi0gSWYg SSYjMzk7bSBhbHJlYWR5IGdvaW5nIHRvIGNvbW1pdCBzb21lIHRpbWUgdG8gbGVhcm4gYSB0ZW1w bGF0aW5nIGxhbmd1YWdlLCB3aHkgZG9udCBJIGp1c3Qgc3BlbmQgdGhhdCBzYW1lIGFtb3VudCBv ZiB0aW1lIGxlYXJuaW5nIHRoZSBsaXR0bGUgYml0IG9mIGhhc2tlbGwgSSBuZWVkIHRvIG1ha2Ug dGhlIHRlbXBsYXRlIHdvcms/IElmIHRoYXRzIHRvbyBtdWNoIHRvIGFzaywgSSBjYW4ganVzdCBz cGl0IG91dCBIVE1MLCBhbmQgaGF2ZSB0aGUgcHJvZ3JhbW1lciBwdXQgaW4gdGhlIGR5bmFtaWMg cGFydHMgZm9yIG1lLiBCb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+PGJyPjxicj48YnI+PGJyPjxicj48YnI+PC9ibG9ja3F1b3RlPjwvZGl2Pjxi cj48YnIgY2xlYXI9ImFsbCI+PGJyPi0tIDxicj48YSBvbmNsaWNrPSJyZXR1cm4gdG9wLmpzLk9w ZW5FeHRMaW5rKHdpbmRvdyxldmVudCx0aGlzKSIgaHJlZj0iaHR0cDovL2Jsb2cubWF1cmljZWNv ZGlrLmNvbS8iIHRhcmdldD0iX2JsYW5rIj4KaHR0cDovL2Jsb2cubWF1cmljZWNvZGlrLmNvbTwv YT4gCg== --===============0914521838759287833==-- From paulrbrown@gmail.com Thu Apr 5 14:37:50 2007 From: Paul Brown To: web-devel@haskell.org Subject: Re: [web-devel] A light-weight web framework Date: Thu, 05 Apr 2007 11:39:07 -0700 Message-ID: <4249453d0704051139h3028fe58vcb7e2504b7e358cb@mail.gmail.com> In-Reply-To: <2927e5d70704051117i14760c62y5aaa7a4ddf7113e@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6227492278921819910==" --===============6227492278921819910== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Let me through Avi Bryant's recent slides into the conversation: http://smallthought.com/avi/etech.pdf Some things that I think, some of which overlap with what Avi's saying: 1) Programmatic generation of content is good. Interaction with designers can be managed simply -- select CSS as the primary means of customizing display, settle on prototype HTML for the designers to work with, generate the HTML programmatically to that prototype as a spec. 2) Templating is ugly. Debugging and testing are difficult. Templating is antipodal to separation of concerns. I'd like us to brainstorm on a couple of topics: A) How do we leverage what is special about Haskell -- laziness, types, purity -- to create an effective and simple web framework? B) What's wrong with existing web frameworks (RoR, straight JSP, PHP, etc.)? For my money, the things that are wrong with RoR and friends is that they let you write really awful software -- even *force* you to do so by the decomposition into templates, controllers, etc. Which brings us back to question A. -- paulrbrown@gmail.com http://mult.ifario.us/ --===============6227492278921819910==-- From alex@alexjacobson.com Mon Apr 9 17:20:15 2007 From: "S. Alexander Jacobson" To: web-devel@haskell.org Subject: Re: [web-devel] A light-weight web framework Date: Mon, 09 Apr 2007 17:20:49 -0400 Message-ID: In-Reply-To: <4249453d0704051139h3028fe58vcb7e2504b7e358cb@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3648884231233825421==" --===============3648884231233825421== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit My priorities: * Make storage and client stuff transparent to server side developer * Use in memory haskell data structures to represent state. + rely on MACID for persistence + no type errors from app/db inconsistency + isolate schema change risk to deserialization from disk + no need for extra mem-cache plumbing! * Atomatic conversion to/from wire format types to haskell data types in my app. Auto-parse/generate JSON/XML/URLEncode. * Scaling should be really really easy * easy integration of multi-protocol services e.g. IRC, SMTP, HTTP in one app. See HPaste and Pass.net. * develop in Haskell. -Alex- On Thu, 5 Apr 2007, Paul Brown wrote: > Let me through Avi Bryant's recent slides into the conversation: > > http://smallthought.com/avi/etech.pdf > > Some things that I think, some of which overlap with what Avi's saying: > > 1) Programmatic generation of content is good. Interaction with > designers can be managed simply -- select CSS as the primary means of > customizing display, settle on prototype HTML for the designers to > work with, generate the HTML programmatically to that prototype as a > spec. > > 2) Templating is ugly. Debugging and testing are difficult. > Templating is antipodal to separation of concerns. > > I'd like us to brainstorm on a couple of topics: > > A) How do we leverage what is special about Haskell -- laziness, > types, purity -- to create an effective and simple web framework? > > B) What's wrong with existing web frameworks (RoR, straight JSP, PHP, etc.)? > > For my money, the things that are wrong with RoR and friends is that > they let you write really awful software -- even *force* you to do so > by the decomposition into templates, controllers, etc. Which brings > us back to question A. > > -- > paulrbrown@gmail.com > http://mult.ifario.us/ > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > --===============3648884231233825421==-- From bringert@cs.chalmers.se Tue Apr 10 10:45:59 2007 From: =?utf-8?q?Bj=C3=B6rn?= Bringert To: web-devel@haskell.org Subject: Re: [web-devel] Parse HTTP headers Date: Tue, 10 Apr 2007 16:49:19 +0200 Message-ID: <461BA3EF.1080402@cs.chalmers.se> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1357771469531687152==" --===============1357771469531687152== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Henning Thielemann wrote: > First of all, I want to say that I like Network.HTTP.HeaderName being an > enumeration like type because of the advantages that are listed in the > HTTP module. HeaderName has a Show instance which shows the header name as > the HTTP protocoll requires that. I don't find it good, since I like to > copy output values in GHCi back to the GHCi prompt. I'm missing a Read > instance or a parsing routine to convert String -> HeaderName. > I want to do the following: I download HTML pages from the web which may > contain META-HTTP-EQUIV tags. I want to merge the HTTP header, that I got > from the web server, with the META information of the downloaded HTML > page. I like to merge them in terms of HTTP.Header, not in terms of > (String,String) and I also like to have a function like HTTP.findHeader to > extract some information from this list. (Currently I'm mainly interested > in Content-Type and Content-Language.) Sounds good. You are welcome to implement it :-) The HTTP library could do with a new maintainer by the way... What happened to the HTTP strike force? /Björn --===============1357771469531687152==-- From list@phaedrusdeinus.org Mon May 7 16:31:04 2007 From: John Melesky To: web-devel@haskell.org Subject: [web-devel] Strange HAppS problem (tutorial) Date: Mon, 07 May 2007 15:33:39 -0500 Message-ID: <97C23120-040A-449F-924B-86C07CF62A11@phaedrusdeinus.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2264885655115481493==" --===============2264885655115481493== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit So, i'm working my way through the HAppS tutorial ( http:// www.haskell.org/haskellwiki/HAppS_tutorial ), and i get to section 3.2. I type in the code, it builds fine, but when i run it, i get the following error: hello: user error (decodeStringM: parsing length field failed @ "") However (and this is the strange part), if i just runghc the .hs file, it all works fine. This is running ghc 6.6, darwinports version, on intel OSX 10.4.9, however i've verified the same behavior on ghc, Audrey Tang's bundle, G4 OSX 10.4.9 (for whatever that's worth). Anyone have any ideas? Anyone run into this before? -johnnnnnnn --===============2264885655115481493==-- From marco-oweber@gmx.de Mon May 7 19:42:13 2007 From: Marc Weber To: web-devel@haskell.org Subject: Re: [web-devel] Strange HAppS problem (tutorial) Date: Tue, 08 May 2007 03:45:16 +0200 Message-ID: <20070508014516.GA11520@gmx.de> In-Reply-To: <97C23120-040A-449F-924B-86C07CF62A11@phaedrusdeinus.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8157498860235740493==" --===============8157498860235740493== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, May 07, 2007 at 03:33:39PM -0500, John Melesky wrote: > So, i'm working my way through the HAppS tutorial ( http:// > www.haskell.org/haskellwiki/HAppS_tutorial ), and i get to section 3.2. > > I type in the code, it builds fine, but when i run it, i get the > following error: > > hello: user error (decodeStringM: parsing length field failed @ "") > > However (and this is the strange part), if i just runghc the .hs > file, it all works fine. > > This is running ghc 6.6, darwinports version, on intel OSX 10.4.9, > however i've verified the same behavior on ghc, Audrey Tang's bundle, > G4 OSX 10.4.9 (for whatever that's worth). > > Anyone have any ideas? Anyone run into this before? > > -johnnnnnnn Hi John. I'm not sure what's happening in your case. The HAppS applications try to read some state when starting. If there is a syntax error (which shouldn't occur because read/ show isntances are fine in most cases).. you'll get a error message like that. You can try investigating wether this is the cause by getting to know which files are actually beeing read and parsed. This can be done by using strace ./yourexecutable &> out and some grepping. This may also help you getting to know wether there are some differences when invoking ghci/ghc.. The last time I did try HAppS those state files where located somewhere near the current directory. Thus I propose moving your executable to /tmp and try again ? You may also try the HAppS mailing list http://groups.google.com/group/happs Marc --===============8157498860235740493==-- From list@phaedrusdeinus.org Mon May 7 20:33:31 2007 From: John Melesky To: web-devel@haskell.org Subject: Re: [web-devel] Strange HAppS problem (tutorial) Date: Mon, 07 May 2007 19:36:05 -0500 Message-ID: <83480431-AEA5-48B9-82E9-354D5CEA5438@phaedrusdeinus.org> In-Reply-To: <20070508014516.GA11520@gmx.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6561376572984214277==" --===============6561376572984214277== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On May 7, 2007, at 8:45 PM, Marc Weber wrote: >> hello: user error (decodeStringM: parsing length field failed >> @ "") > > The HAppS applications try to read some state when starting. If > there is > a syntax error (which shouldn't occur because read/ show isntances are > fine in most cases).. you'll get a error message like that. Marc, thanks. It turns out that removing the directories left over from the prior revision ([app]_state/ and [app]_error.log/) got rid of the error. Why i didn't think of that, i don't know. Thanks again. -johnnnnnnn --===============6561376572984214277==-- From ndmitchell@gmail.com Mon Jun 18 10:05:57 2007 From: Neil Mitchell To: web-devel@haskell.org Subject: [web-devel] Scope of this mailing list Date: Mon, 18 Jun 2007 15:11:15 +0100 Message-ID: <404396ef0706180711g2cc10152of071af7d8e474fd6@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1034215664300359491==" --===============1034215664300359491== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi I've been developing the tagsoup library, which deals with parsing HTML, which is clearly a web-development task. I'm now wanting to use a mailing list to discuss the further development of tagsoup - I can either set up a separate mailing list, or use this one - which seems to overlap. So would the people in this mailing list rather I just set up a separate tagsoup mailing list (I'm not expecting massive amounts of traffic), or use this one? Thanks Neil [1] http://www-users.cs.york.ac.uk/~ndm/tagsoup/ --===============1034215664300359491==-- From johan.tibell@gmail.com Mon Jun 18 10:30:42 2007 From: Johan Tibell To: web-devel@haskell.org Subject: Re: [web-devel] Scope of this mailing list Date: Mon, 18 Jun 2007 16:36:00 +0200 Message-ID: <90889fe70706180736p41a475c0t99f264a3a1ab190c@mail.gmail.com> In-Reply-To: <404396ef0706180711g2cc10152of071af7d8e474fd6@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8846522502490163729==" --===============8846522502490163729== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hey! I wouldn't create yet another list and to me tagsoup is related enough. Was there ever any statement of intent for this list or was it more of a "for us who are interested in web development" statement? I was planning on posting my ideas for templating systems and a (Python) WSGI solution for Haskell here and I assumed discussing actual implementation of those would be okay here. Cheers Johan On 6/18/07, Neil Mitchell wrote: > Hi > > I've been developing the tagsoup library, which deals with parsing > HTML, which is clearly a web-development task. I'm now wanting to use > a mailing list to discuss the further development of tagsoup - I can > either set up a separate mailing list, or use this one - which seems > to overlap. > > So would the people in this mailing list rather I just set up a > separate tagsoup mailing list (I'm not expecting massive amounts of > traffic), or use this one? > > Thanks > > Neil > > [1] http://www-users.cs.york.ac.uk/~ndm/tagsoup/ > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > --===============8846522502490163729==-- From samgoldman@jhu.edu Mon Jun 18 10:43:55 2007 From: Sam Goldman To: web-devel@haskell.org Subject: Re: [web-devel] Scope of this mailing list Date: Mon, 18 Jun 2007 10:46:11 -0400 Message-ID: <46769AB3.2040609@jhu.edu> In-Reply-To: <404396ef0706180711g2cc10152of071af7d8e474fd6@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5792725580313224297==" --===============5792725580313224297== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Neil Mitchell wrote: > Hi > > I've been developing the tagsoup library, which deals with parsing > HTML, which is clearly a web-development task. I'm now wanting to use > a mailing list to discuss the further development of tagsoup - I can > either set up a separate mailing list, or use this one - which seems > to overlap. > > So would the people in this mailing list rather I just set up a > separate tagsoup mailing list (I'm not expecting massive amounts of > traffic), or use this one? > > Thanks > > Neil > > [1] http://www-users.cs.york.ac.uk/~ndm/tagsoup/ > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel Echoing support for any web-development-related discussion on this list. I do web development full time and I joined this list hoping to stumble across any information I can use to give myself an edge. :-) Sam --===============5792725580313224297==-- From prstanley@ntlworld.com Mon Jun 18 10:46:24 2007 From: PR Stanley To: web-devel@haskell.org Subject: Re: [web-devel] Scope of this mailing list Date: Mon, 18 Jun 2007 15:51:40 +0100 Message-ID: <7.0.1.0.0.20070618154746.01b690d0@ntlworld.com> In-Reply-To: <90889fe70706180736p41a475c0t99f264a3a1ab190c@mail.gmail.co> m> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6861119172308408279==" --===============6861119172308408279== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit For any future queries regarding Web-Devel please feel free to drop me a line at prstanley at ntlworld.com Regards Paul (list owner/moderator) --===============6861119172308408279== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGh0bWw+Cjxib2R5Pgo8Zm9udCBzaXplPTM+Rm9yIGFueSBmdXR1cmUgcXVlcmllcyByZWdhcmRp bmcgV2ViLURldmVsIHBsZWFzZSBmZWVsIGZyZWUKdG8gZHJvcCBtZSBhIGxpbmUgYXQgcHJzdGFu bGV5IGF0IG50bHdvcmxkLmNvbTxicj4KUmVnYXJkczxicj4KUGF1bCAobGlzdCBvd25lci9tb2Rl cmF0b3IpPGJyPgo8L2ZvbnQ+PC9ib2R5Pgo8L2h0bWw+Cg== --===============6861119172308408279==-- From marco-oweber@gmx.de Tue Jun 19 05:56:29 2007 From: Marc Weber To: web-devel@haskell.org Subject: Re: [web-devel] Scope of this mailing list / my 2 cents about handling discussion requests Date: Tue, 19 Jun 2007 12:01:47 +0200 Message-ID: <20070619100147.GA962@gmx.de> In-Reply-To: <7.0.1.0.0.20070618154746.01b690d0@ntlworld.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6768291166159709785==" --===============6768291166159709785== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, Jun 18, 2007 at 03:51:40PM +0100, Paul Stanley wrote: > For any future queries regarding Web-Devel please feel free to drop me > a line at prstanley at ntlworld.com > Regards > Paul (list owner/moderator) Hi Neil, Paul I don't know why I've missed this thread until now. Neil. Go on and start your discussion within a new thread. I like your library. (I've already used it as you know). It's a promising alternative to many other approaches. And thanks for joining ;-) Paul: I'd like to discuss issues like this in public. Why? This way the next person asking the same question can lookup the answer using the archive. Much more important is choosing an expressive subject so that everyone can decide in advance wether he wants to read the post or not. If you (Paul and all others) have a different attitute post your opinion so that we may change the topic of this list if it is no longer appropriate. Marc Weber --===============6768291166159709785==-- From prstanley@ntlworld.com Tue Jun 19 06:30:30 2007 From: PR Stanley To: web-devel@haskell.org Subject: Re: [web-devel] Scope of this mailing list / my 2 cents about handling discussion requests Date: Tue, 19 Jun 2007 11:35:55 +0100 Message-ID: <7.0.1.0.0.20070619111844.01b1d198@ntlworld.com> In-Reply-To: <20070619100147.GA962@gmx.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4638882900265364376==" --===============4638882900265364376== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Well, to be fair, very few people bother to scower the archives in these situations. I can appreciate that in theory it's a good idea but I doubt if it'll ever be practically feasable. Moreover, if the topic is suitable for the list it will be discussed publically anyway. So it is imaterial whether or not the initial consultation takes place on the list. I have already contacted Neil and explained that as far as I'm concerned he can go ahead ... etc. Paul At 11:01 19/06/2007, you wrote: >On Mon, Jun 18, 2007 at 03:51:40PM +0100, Paul Stanley wrote: > > For any future queries regarding Web-Devel please feel free to drop me > > a line at prstanley at ntlworld.com > > Regards > > Paul (list owner/moderator) > >Hi Neil, Paul > >I don't know why I've missed this thread until now. > >Neil. Go on and start your discussion within a new thread. >I like your library. (I've already used it as you know). >It's a promising alternative to many other approaches. >And thanks for joining ;-) > >Paul: I'd like to discuss issues like this in public. Why? >This way the next person asking the same question can lookup the answer >using the archive. Much more important is choosing an expressive >subject so that everyone can decide in advance wether he wants to read >the post or not. > >If you (Paul and all others) have a different attitute post your >opinion so that we may change the topic of this list if it is no longer >appropriate. > >Marc Weber >_______________________________________________ >web-devel mailing list >web-devel@haskell.org >http://www.haskell.org/mailman/listinfo/web-devel --===============4638882900265364376== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGh0bWw+Cjxib2R5Pgo8Zm9udCBzaXplP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heSBjaGFuZ2UgdGhlIHRvcGljIG9mIHRoaXMgbGlzdCBpZiBpdCBpcyBubwpsb25n ZXI8YnI+CmFwcHJvcHJpYXRlLjxicj48YnI+Ck1hcmMgV2ViZXI8YnI+Cl9fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fPGJyPgp3ZWItZGV2ZWwgbWFpbGluZyBs aXN0PGJyPgp3ZWItZGV2ZWxAaGFza2VsbC5vcmc8YnI+CjxhIGhyZWY9Imh0dHA6Ly93d3cuaGFz a2VsbC5vcmcvbWFpbG1hbi9saXN0aW5mby93ZWItZGV2ZWwiIGV1ZG9yYT0iYXV0b3VybCI+Cmh0 dHA6Ly93d3cuaGFza2VsbC5vcmcvbWFpbG1hbi9saXN0aW5mby93ZWItZGV2ZWw8L2E+PC9mb250 PjwvYmxvY2txdW90ZT4KPC9ib2R5Pgo8L2h0bWw+Cg== --===============4638882900265364376==-- From marco-oweber@gmx.de Mon Nov 19 02:26:11 2007 From: Marc Weber To: web-devel@haskell.org Subject: [web-devel] [farmand@linagora.com: [Ocsigen] Functional Web Frameworks groups] Date: Mon, 19 Nov 2007 08:29:37 +0100 Message-ID: <20071119072937.GB32152@gmx.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4303419618096021675==" --===============4303419618096021675== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Perhaps you are intersted in this as well. Marc W. ----- Forwarded message from Francois Armand ----- Date: Mon, 19 Nov 2007 07:44:05 +0100 From: Francois Armand To: ocsigen@sympa.pps.jussieu.fr Subject: [Ocsigen] Functional Web Frameworks groups Hi Ocsigen, The world of functional web frameworks seems to be an hot place in these days ! David Pollak of Lift Web (Scala web framework : http://liftweb.net/) has just created a google group to exchange on this topic. It seems to already be some people from Erlyweb (Erlang) and HAppS (Haskel) there, so it really lacks for OCaml advocates ;) Hope to see you there, -- Francois Armand Etudes & Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 ----------- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation ----- End forwarded message ----- --===============4303419618096021675==-- From paulrbrown@gmail.com Fri Jan 4 16:44:59 2008 From: Paul Brown To: web-devel@haskell.org Subject: [web-devel] Fwd: ANN / CFC: minimalistic haskell blogging web application (perpubplat) Date: Fri, 04 Jan 2008 13:51:09 -0800 Message-ID: <4249453d0801041351u4a9a4296k7f573006e92c19d2@mail.gmail.com> In-Reply-To: <4249453d0801041243i2b656ec7y1038e05a6aa44480@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7942121438320696827==" --===============7942121438320696827== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cross-posting from Haskell-Cafe: ---------- Forwarded message ---------- From: Paul Brown Date: Jan 4, 2008 12:43 PM Subject: ANN / CFC: minimalistic haskell blogging web application (perpubplat) To: haskell-cafe All -- I've spent some time on cleaning up my hobby blog publishing software and setting up a darcs repository, so I'll throw it out there for criticism or suggestions: darcs get http://datapr0n.com/repos/perpubplat It's running my blog (http://mult.ifario.us). It's relatively lightweight in that it doesn't use a framework but still weighs in at <1500 LOC with comments, but it does rely on the (Thanks, Bjorn!) FastCGI and XHTML combinator libraries. I have some plans for handling comments and the like, but things I'd like to figure out: - Turn the blog data model into a monad. - An idiomatic approach to handling conditional GET and E-Tag, i.e., send a 304 response if things aren't modified. Thanks in advance. -- paulrbrown@gmail.com http://mult.ifario.us/ -- paulrbrown@gmail.com http://mult.ifario.us/ --===============7942121438320696827==-- From johan.tibell@gmail.com Sun Apr 13 07:55:05 2008 From: Johan Tibell To: web-devel@haskell.org Subject: [web-devel] RFC: A standardized interface between web servers and applications or frameworks (ala WSGI) Date: Sun, 13 Apr 2008 13:59:45 +0200 Message-ID: <90889fe70804130459u25bf182dvf4bec5ca69d6112e@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2596470804955409499==" --===============2596470804955409499== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Good day hackers, The Python community have been successful in standardizing an interface between web server and applications or frameworks resulting in users having more control over their web stack by being able to pick frameworks independently from web servers, and vice versa. I propose we try to do the same for Haskell. I've written half a draft for a Haskell version of Python's PEP 333 [1]. If you're interested in taking part in this effort please read through the Python spec first (as it is way more complete and you can understand this proposal better by reading it, I've skipped some important issues in my first draft) and then go read the Haskell spec [2]. I'm particularly interesting in feedback regarding: * Doing in this way won't work as it violates HTTP/CGI spec part X, Y and Z (the Python spec takes lots of things from the CGI spec including naming and semantics). * My server/framework could never provide/be run under this interface. * This interface has bad performance by design. * Using a different set of data types would work better. The spec needs to be extended to cover all the corners of HTTP. Some parts need to be motivated better. It is easier for me to motivate things if people would tell me what parts are badly motivated. Note: I'm open to a complete rewrite if needed. I'm not wedded to the current design and/or wording. In fact parts of the wording is borrowed from the Python spec. The parts with bad grammar are all mine. 1. http://www.python.org/dev/peps/pep-0333/ 2. http://www.haskell.org/haskellwiki/WebApplicationInterface -- Johan --===============2596470804955409499==-- From dm.maillists@gmail.com Sun Apr 13 21:04:30 2008 From: Daniel McAllansmith To: web-devel@haskell.org Subject: [web-devel] Re: RFC: A standardized interface between web servers and applications or frameworks (ala WSGI) Date: Mon, 14 Apr 2008 13:08:56 +1200 Message-ID: <200804141308.56697.dm.maillists@gmail.com> In-Reply-To: <396556a20804131606h35c0cd75p2076fd20bdd67582@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3464421029892678196==" --===============3464421029892678196== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, 14 Apr 2008 11:06:43 Adam Langley wrote: > On Sun, Apr 13, 2008 at 4:59 AM, Johan Tibell wrote: > > * Using a different set of data types would work better. > > Give that this is Haskell, I'd suggest more types ;) > > HTTP headers aren't just strings and, at the risk of tooting my own > horn, I'll point to the Headers structure in [1]. And it could go further. The use of a given header is often valid only in certain requests or responses. Perhaps sprinkling some phantom types or type classes around could represent that. Daniel --===============3464421029892678196==-- From s.clover@gmail.com Sun Apr 13 22:38:54 2008 From: Sterling Clover To: web-devel@haskell.org Subject: Re: [web-devel] RFC: A standardized interface between web servers and applications or frameworks (ala WSGI) Date: Sun, 13 Apr 2008 22:43:33 -0400 Message-ID: <368E0883-A910-4FFD-937F-A6A1D7F88E42@gmail.com> In-Reply-To: <90889fe70804130459u25bf182dvf4bec5ca69d6112e@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4741989926883630598==" --===============4741989926883630598== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit In a sense, the CGIT interface provided by Network.CGI already is a sort of halfway implementation of what we're discussing, no? I'd be interested in approaching this from the other way -- specifying exactly what CGIT doesn't provide and therefore what folks want to see. As far as I can tell, the main issue with CGIT is that it doesn't handle streaming/resource issues very well. The main innovation I see provided here is the enumerator interface, which is a very nice and flexible approach to I/O and provides a way to handle comet cleanly to boot. Since the application type as proposed is Env -> IO (Code, Headers, ResponseEnumerator), what we're really getting is almost an equiv. (modulo enumerators) of unwrapping CGIT IO CGIResponse with a run function. So what we lose is the ability for all our nicely named record accessors and functions to be shared across frameworks -- i.e. the flexibility a monad transformer *does* provide. So my question is if we can somehow preserve that with an appropriate typeclass. I'd ideally like to see this engineered in two parts -- a "cgit-like" typeclass interface that allows access to the environment but is agnostic as to response type, so that comet-style and other apps that take special advantage of enumerators can be built on top of it as well as apps that simply perform lazy writes; and the lower-level enumerator interface. This ideally would let the higher-level interface be built over any stack at all (i.e. STM-based as well, or even a pure stack), while the lower level interface that calls it is some glue of the given constant type in the IO monad. This would be of great help to hvac. There's also the fact that this could be designed ground-up with greater bytestring use, but that doesn't seem immense to me. Outside of this, I'm not quite sure what else CGIT lacks. I'm with Chris Smith's arguments as to the headers question, and it seems to me that dicts are best done using MVar-style primitives. I'm a bit at sea as to why the queryString is here just represented as a bytestring -- is it seriously an issue that some apps may want to use it other than in the standard parsed way? Is the idea here that lib functions would fill in and be shared among frameworks? On the other hand, seperating GET and POST vars is a good idea, and its a shame that CGIT doesn't allow this. The openness here seems in part based on the desire to keep different forms of file upload handling available. However, the work that oleg did with regards to CGI also seems promising -- i.e., rather than using an enumerator, simply taking advantage of laziness to unpack the input stream into a lazy dictionary. Regards, S. On Apr 13, 2008, at 7:59 AM, Johan Tibell wrote: > Good day hackers, > > The Python community have been successful in standardizing an > interface between web server and applications or frameworks resulting > in users having more control over their web stack by being able to > pick frameworks independently from web servers, and vice versa. I > propose we try to do the same for Haskell. I've written half a draft > for a Haskell version of Python's PEP 333 [1]. If you're interested in > taking part in this effort please read through the Python spec first > (as it is way more complete and you can understand this proposal > better by reading it, I've skipped some important issues in my first > draft) and then go read the Haskell spec [2]. I'm particularly > interesting in feedback regarding: > > * Doing in this way won't work as it violates HTTP/CGI spec part X, Y > and Z (the Python spec takes lots of things from the CGI spec > including naming and semantics). > * My server/framework could never provide/be run under this interface. > * This interface has bad performance by design. > * Using a different set of data types would work better. > > The spec needs to be extended to cover all the corners of HTTP. Some > parts need to be motivated better. It is easier for me to motivate > things if people would tell me what parts are badly motivated. > > Note: I'm open to a complete rewrite if needed. I'm not wedded to the > current design and/or wording. In fact parts of the wording is > borrowed from the Python spec. The parts with bad grammar are all > mine. > > 1. http://www.python.org/dev/peps/pep-0333/ > 2. http://www.haskell.org/haskellwiki/WebApplicationInterface > > -- Johan > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel --===============4741989926883630598==-- From mj@mjclement.com Sun Apr 13 23:27:13 2008 From: Michaeljohn Clement To: web-devel@haskell.org Subject: [web-devel] Re: [Haskell-cafe] RFC: A standardized interface between web servers and applications or frameworks (ala WSGI) Date: Sun, 13 Apr 2008 21:31:54 -0600 Message-ID: <4802D02A.9070203@mjclement.com> In-Reply-To: <90889fe70804130459u25bf182dvf4bec5ca69d6112e@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3403297810640926436==" --===============3403297810640926436== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit I am very interested in this work. One thing missing is support for all HTTP methods, not just those in RFC 2616. As-is, something like WebDAV cannot be implemented. That probably means requestMethod should be a (Byte)String. What about something like sendfile(2) available on some platforms? To allow the server to make use of such optimizations, how about an optional alternative to the enumerator? Perhaps the app can optionally pass a path or an open fd back to the server in place of an enumerator, which allows servers to do any kind of buffering optimizations, etc, that they may know about, as well as using any platform-specific optimizations like sendfile. -- Michaeljohn Clement --===============3403297810640926436==-- From mj@mjclement.com Sun Apr 13 23:46:07 2008 From: Michaeljohn Clement To: web-devel@haskell.org Subject: [web-devel] Re: [Haskell-cafe] Re: RFC: A standardized interface between web servers and applications or frameworks (ala WSGI) Date: Sun, 13 Apr 2008 21:50:48 -0600 Message-ID: <4802D498.7000303@mjclement.com> In-Reply-To: <396556a20804131606h35c0cd75p2076fd20bdd67582@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4441005755603461051==" --===============4441005755603461051== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Adam Langley wrote: > On Sun, Apr 13, 2008 at 4:59 AM, Johan Tibell wrot= e: >> * Using a different set of data types would work better. >=20 > Give that this is Haskell, I'd suggest more types ;) >=20 > HTTP headers aren't just strings and, at the risk of tooting my own > horn, I'll point to the Headers structure in [1]. That is one of the things I don't like about Network.HTTP, which also=20 enumerates header fields. It is inconvenient to have to look up the=20 names in the data type, when the standard field names are already known,=20 and it makes using non-RFC2616 headers less convenient. Automatic parsing of header fields also makes unusual usage inconvenient,=20 (for example the Range header support in [1] is a profile of RFC2616.) I think those kinds of features belong in frameworks; they will be more=20 of an annoyance than a help to anyone that is writing to the WSGI layer. > Likewise, URLs have > lots of structure that should just be handled in one place [2] Yes, I think should be parsed to the level of granularity specified by=20 RFC 2616 (i.e. scheme, host, port, path, query string) and anything=20 more (like parsing query strings) should be handled by frameworks. >=20 > [1] http://darcs.imperialviolet.org/darcsweb.cgi?r=3Dnetwork-minihttp;a=3Dh= eadblob;f=3D/Network/MiniHTTP/Marshal.hs > [2] http://darcs.imperialviolet.org/darcsweb.cgi?r=3Dnetwork-minihttp;a=3Dh= eadblob;f=3D/Network/MiniHTTP/URL.hs >=20 >=20 > AGL >=20 --=20 Michaeljohn Clement --===============4441005755603461051==-- From s.clover@gmail.com Wed Jun 4 14:52:46 2008 From: Sterling Clover To: web-devel@haskell.org Subject: [web-devel] Re: [Haskell-cafe] What is the maturity of Haskell Web Frameworks Date: Wed, 04 Jun 2008 15:00:08 -0400 Message-ID: <84455758-6AD3-4FE9-ABF8-C1FC739FE0ED@gmail.com> In-Reply-To: <4846C559.9020201@complete.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7337685925662024618==" --===============7337685925662024618== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > > hvac sounds interesting but at that time at least it was not clear > whether it was stable or would continue to be maintained. > > xhtml and HStringTemplate were overkill for what I wanted, so I > wound up > just using the FastCGI and CGI toolkits themselves. They are > surprisingly nice, and with a little bit of wrappers around them for > things like validating forms, have worked exceptionally well. > I'm in a position now where I can make a reasonable promise that hvac will not only be maintained but undergoing continued development. I just, for example, hooked in some basic postgresql support yesterday (although the changes are not tested/pushed to the repo yet). (Speaking of which, I noticed that the HDBC postgresql bindings don't set seState on an error -- is this intentional, or something that should be fixed up?) As such though, I also can't promise that hvac as it stands is officially stable, although most work I imagine that will be done on it will consist of extensions rather than API-breaking changes. I've also been working on a lightweight testing API for programs using the CGI monad, integrated with quickcheck. Although this project isn't "final" yet either, there's a working repo at http:// code.haskell.org/~sclv/cgicheck/ if anyone wants to play with it/use it. I plan to use this quite a bit to test hvac, and any applications produced using it. Additionally, the hvac code now has a nice, though also incomplete orm/dsl-type library for database access (also built on top of HDBC). When I feel more confident/polished in the code there, I plan to split it out and hackage it as well. Of course, folks with a little time/inclination who play with these things a bit and put them through the paces are a big help in working out the kinks such that I feel they're closer to "release- quality" (even if that "release" *is* only 0.1). :-) Relatedly, I'd be very interested in developing a single common library for encoding/escaping/decoding/unescaping of common web formats (urls, javascript, basic xss escaping, rss-valid character escapes to html-valid ones, etc.) that uses a lightweight invertible combinator approach as described in Pierce's work on lenses (various papers at http://www.seas.upenn.edu/~harmony/) such that the encode/ decode methods are correct-by-construction bijections. There are various encoding bits scattered among the Haskell web libraries at the moment, each with varying degrees of correctness and conformance. It would be nice to direct energy here to a single centralized project, which would have some upfront architecture, and then, unfortunately, probably no small degree of spec-translation. If anyone else is interested in working on such a thing, I'd be delighted for ideas/collaboration (or better yet, if someone just picked up the idea and ran with it themselves!) (hmm... maybe galois has some internal libraries it wouldn't mind sharing as a partial basis?) Regards, Sterl. --===============7337685925662024618==-- From marco-oweber@gmx.de Fri Sep 12 19:13:08 2008 From: Marc Weber To: web-devel@haskell.org Subject: [web-devel] VXML - validating XHTML library Date: Sat, 13 Sep 2008 01:15:27 +0200 Message-ID: <20080912231527.GB27403@gmx.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6590716370090023546==" --===============6590716370090023546== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi @ll. Those of you reading the haskelcafe mailinglist already know that I've been working on vxml. It's a library letting you write XHTML code validating the result at compilation time against a given dtd. How does it work? Given a doctype like this : results in a set of state transformation rules. A new empty root tag starts with the State1. From that on it's fed with either y or z (using functional dependencies) resulting a new state 1 or 7. If you add an subelement y the state changes to 7 which is not endable forcing you to add another element. etc.. State 1 endable : True y -> St 7 z -> St 1 State2 :7 endable : False y -> St 7 z -> St 1 Use this on a xhtml dtd and you'll get about 500 different states and a lot of instances. Luckily most elements are described this way: (PCDATA|div|form|...)* this means that the sate does not change after an element which should enable you to use foldr functions or such without type hackery (? I have to verify this).. Validation errors are denoted this way: * wrong element (1): "No instance for (Consume State4 (Elem B_T) st')" * more elements expected (1): "No instance for (ElEndable Root_T State4)" * invalid attribute: "No instance for (AttrOk Root_T AAttr_A)" * duplicate attribute: "No instance for (Text.XML.Validated.Types.DuplicateAttribute A_T AAttr_A= )" * missing required attributes: "No instance for (Text.XML.Validated.Types.RequiredAttributesMissing Root_T (HCons (A RootAttr_A) HNil))" Using ghc head you can rebind >>=3D and >> and use a do like notation: #if (__GLASGOW_HASKELL__ > 608) #include "vxmldos.h" tDo $ runHtmlDoc $ vdo head $ title $ text "text" body $ vdo script $ X.type "text/javascript" >> text "document.writeln('hi');" h2 $ text "That's a headline, hello and how do you do?" -- br e eg a
is not allowed here div $ vdo onclick "alert('clicked');" styleA "color:#F79" text "text within the div" div e return "That's nice, isn't it?" resulting in: returned value : "That's nice, isn't it?" xml : text

= That's a headline, hello and how do you do?

text within the div
where vxmldos.h includes some macros rebinding >>=3D, >>, return and lift If you want to jump in, test and give some feedback you're welcome. Grab the code from git://mawercer.de/vxml If you feel there is some documentation missing just ask. Sincerly Marc Weber --===============6590716370090023546==-- From prstanley@ntlworld.com Fri Sep 12 20:02:30 2008 From: "P. R. Stanley" To: web-devel@haskell.org Subject: Re: [web-devel] VXML - validating XHTML library Date: Sat, 13 Sep 2008 01:05:04 +0100 Message-ID: <20080913000452.VPG19289.aamtaout02-winn.ispmail.ntl.com@pine.ntlworld.com> In-Reply-To: <20080912231527.GB27403@gmx.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2710344823284451158==" --===============2710344823284451158== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Just out of interest, why DTD and not XSchema? I would have thought the latter were more complete in many respects. Paul At 00:15 13/09/2008, you wrote: >Hi @ll. > >Those of you reading the haskelcafe mailinglist already know that I've >been working on vxml. It's a library letting you write XHTML code >validating the result at compilation time against a given dtd. > >How does it work? >Given a doctype like this : > > > > > >results in a set of state transformation rules. A new empty root tag >starts with the State1. From that on it's fed with either y or z (using >functional dependencies) resulting a new state 1 or 7. If you add an >subelement y the state changes to 7 which is not endable forcing you to >add another element. etc.. > > State 1 > endable : True > y -> St 7 > z -> St 1 > > State2 :7 > endable : False > y -> St 7 > z -> St 1 > >Use this on a xhtml dtd and you'll get about 500 different states and a >lot of instances. Luckily most elements are described this way: >(PCDATA|div|form|...)* >this means that the sate does not change after an element which should >enable you to use foldr functions or such without type hackery (? I have >to verify this).. > >Validation errors are denoted this way: > > * wrong element (1): > "No instance for (Consume State4 (Elem B_T) st')" > > * more elements expected (1): > "No instance for (ElEndable Root_T State4)" > > * invalid attribute: > "No instance for (AttrOk Root_T AAttr_A)" > > * duplicate attribute: > "No instance for (Text.XML.Validated.Types.DuplicateAttribute > A_T AAttr_A)" > > * missing required attributes: > "No instance for (Text.XML.Validated.Types.RequiredAttributesMissing > Root_T (HCons (A RootAttr_A) HNil))" > > >Using ghc head you can rebind >>= and >> and use a do like notation: > > #if (__GLASGOW_HASKELL__ > 608) > #include "vxmldos.h" > tDo $ runHtmlDoc $ vdo > head $ title $ text "text" > body $ vdo > script $ X.type "text/javascript" >> text "document.writeln('hi');" > h2 $ text "That's a headline, hello and how do you do?" > -- br e eg a
is not allowed here > div $ vdo > onclick "alert('clicked');" > styleA "color:#F79" > text "text within the div" > div e > return "That's nice, isn't it?" > > resulting in: > returned value : "That's nice, isn't it?" > xml : "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > text

That's a > headline, hello and how do you do?

onclick="alert('clicked');" style="color:#F79">text within the > div
> >where vxmldos.h includes some macros rebinding >>=, >>, return and lift > >If you want to jump in, test and give some feedback you're welcome. >Grab the code from git://mawercer.de/vxml >If you feel there is some documentation missing just ask. > >Sincerly > Marc Weber >_______________________________________________ >web-devel mailing list >web-devel@haskell.org >http://www.haskell.org/mailman/listinfo/web-devel --===============2710344823284451158==-- From marco-oweber@gmx.de Sat Sep 13 18:42:35 2008 From: Marc Weber To: web-devel@haskell.org Subject: Re: [web-devel] VXML - validating XHTML library Date: Sun, 14 Sep 2008 00:44:56 +0200 Message-ID: <20080913224456.GA5120@gmx.de> In-Reply-To: <20080913000452.VPG19289.aamtaout02-winn.ispmail.ntl.com@pine.ntlworld.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1602169776767775164==" --===============1602169776767775164== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Sat, Sep 13, 2008 at 01:05:04AM +0100, Paul Stanley wrote: > Just out of interest, why DTD and not XSchema? I would have thought the > latter were more complete in many respects. I didn't kewn about it and I knew XHTML is defined by dtd which I was interested in. Greetings Marc --===============1602169776767775164==-- From prstanley@ntlworld.com Sat Sep 13 22:29:23 2008 From: "P. R. Stanley" To: web-devel@haskell.org Subject: Re: [web-devel] VXML - validating XHTML library Date: Sun, 14 Sep 2008 03:31:45 +0100 Message-ID: <20080914023147.JGKB19289.aamtaout02-winn.ispmail.ntl.com@pine.ntlworld.com> In-Reply-To: <20080913224456.GA5120@gmx.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0816959213920956802==" --===============0816959213920956802== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > > Just out of interest, why DTD and not XSchema? I would have thought the > > latter were more complete in many respects. >I didn't know about it and I knew XHTML is defined by dtd which I was >interested in. The schema syntax is a little verbose but you get clarity in abundance. I'd be interested in more info on your XHTML validator project. I wonder if anyone's thought of creating a Haskell substitute for the Tomcat,(Oracle|MySQL) web data management system, well, at least the bits that deal with XSQL and XML apps. It's a mystery to me that very few have embraced the idea of a neat clean declarative tool for setting up websites. Paul --===============0816959213920956802==-- From lemming@henning-thielemann.de Wed Nov 12 06:49:16 2008 From: Henning Thielemann To: web-devel@haskell.org Subject: [web-devel] The Real Monad Transformer or is Haskell.org hijacked? Date: Wed, 12 Nov 2008 12:54:43 +0100 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2652755924791004012==" --===============2652755924791004012== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Tue, 3 Apr 2007, Henning Thielemann wrote: > It was argued that people avoid Haskell because of terms from Category > theory like 'Monad'. This problem can now be solved by a wrapper which > presents all the WWW without monads! Start e.g. at > http://saxophone.jpberlin.de/MonadTransformer?source=3Dhttp%3A%2F%2Fwww%2Eh= askell%2Eorg%2Fhaskellwiki%2FCategory%3AMonad&language=3DEnglish > Of course the tool is written in Haskell, that is, Haskell helps solving > problems which only exist because of Haskell. > Bug reports and feature requests can be tracked at > https://sourceforge.net/projects/parallelweb The produced content has not changed very much, but the interface is much=20 more friendly now. You can now enter the world of the Real Monad=20 Transformer e.g. at: http://www.haskell.org.monadtransformer.parallelnetz.de/haskellwiki/Categor= y:Monad Good luck! Henning --===============2652755924791004012==-- From DekuDekuplex@Yahoo.com Sun Nov 16 06:49:19 2008 From: "Benjamin L.Russell" To: web-devel@haskell.org Subject: [web-devel] Re: The Real Monad Transformer or is Haskell.org hijacked? Date: Thu, 13 Nov 2008 17:20:16 +0900 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8215518142766686761==" --===============8215518142766686761== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Wed, 12 Nov 2008 12:54:43 +0100 (CET), Henning Thielemann wrote: > >On Tue, 3 Apr 2007, Henning Thielemann wrote: > >> It was argued that people avoid Haskell because of terms from Category >> theory like 'Monad'. This problem can now be solved by a wrapper which >> presents all the WWW without monads! Start e.g. at >> http://saxophone.jpberlin.de/MonadTransformer?source=3Dhttp%3A%2F%2Fwww%2E= haskell%2Eorg%2Fhaskellwiki%2FCategory%3AMonad&language=3DEnglish >> Of course the tool is written in Haskell, that is, Haskell helps solving >> problems which only exist because of Haskell. >> Bug reports and feature requests can be tracked at >> https://sourceforge.net/projects/parallelweb > >The produced content has not changed very much, but the interface is much=20 >more friendly now. You can now enter the world of the Real Monad=20 >Transformer e.g. at: > http://www.haskell.org.monadtransformer.parallelnetz.de/haskellwiki/Catego= ry:Monad This is obviously a pun on the HaskellWiki page on monads: Monad - HaskellWiki http://www.haskell.org/haskellwiki/Monad They also seem to have duplicated at least part of the rest of the HaskellWiki. Compare: Haskell - HaskellWiki [their duplication] http://www.haskell.org.monadtransformer.parallelnetz.de/ Haskell - HaskellWiki http://www.haskell.org/ While this doesn't seem to violate the HaskellWiki license (see http://www.haskell.org/haskellwiki/HaskellWiki:Copyrights), it would seem problematic if users searching the Web confused their content with the real HaskellWiki content. Perhaps a complaint should be filed with their system administrator? -- Benjamin L. Russell --===============8215518142766686761==-- From marco-oweber@gmx.de Tue Nov 18 06:56:41 2008 From: Marc Weber To: web-devel@haskell.org Subject: [web-devel] Ocaml has an ocaml virtual machine in JS now Date: Tue, 18 Nov 2008 13:02:31 +0100 Message-ID: <20081118120231.GC21754@gmx.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1487007378376813892==" --===============1487007378376813892== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable :-) We already have a haskell to javascript compiler.. It's not an interpreter though.. ----- Forwarded message from Vincent Balat ---= -- m: 0 (Mail was not recognized as spam) X-GMX-UID: Y5UUIa4CZDI5lllf82Y2BshxemhmYwEo Status: O Content-Length: 1017 Lines: 27 [Mail from Benjamin Canou redirected to the list] Hi, O'Browser is an implementation of the OCaml virtual machine in=20 JavaScript, designed to run in web browsers. It features a runtime library compatible with OCaml's standard one=20 (including OOP and concurrent threads) and bindings of some JavaScript=20 functions to manipulate the DOM primitives. The distribution is available at [1] and an online version of the=20 tutorial is reachable at [2]. Please note that this is an early version, in particular the DOM=20 interface module is neither pretty nor well typed. However, it can already be used to create little applets or scripts (as=20 in the tutorial [2], the examples of the distribution [3] or my webpage=20 [4]) and we'll be glad to receive your comments or bug reports. Have fun. Benjamin Canou. [1] http://www.pps.jussieu.fr/~canou/obrowser-0.1.tar.bz2 [2] http://www.pps.jussieu.f ----- End forwarded message ----- --===============1487007378376813892==-- From artyom.shalkhakov@gmail.com Thu Nov 20 03:18:08 2008 From: =?utf-8?b?0JDRgNGC0LXQvCDQqNCw0LvRhdCw0LrQvtCy?= To: web-devel@haskell.org Subject: [web-devel] Where do you start? Date: Thu, 20 Nov 2008 14:24:06 +0600 Message-ID: <2076f2f90811200024u7105132ci1d9b23218a3a42b4@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6602074621445163946==" --===============6602074621445163946== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hello, I'm interested in Haskell web programming. Quick googling took me to HAppS, HVAC, WASH and do-it-yourself blog posts. I tried HVAC, which doesn't build on GHC 6.10.1 (if somebody's interested, I'll post some compiler complaints). I really like its approach, though. Then I tried to DIY: wired Haskell to Lighty using FastCGI. This approach works, but leaves very much to desire: XHTML combinators don't really give you compile-time validation, so what is the point of writing it in code? I had thought I'd need some templating, so I tried HStringTemplate to find that it doesn't build on my GHC (BTW, this templating engine has some neat concepts, which I like :-)). Then I turned to HAppS, which is painfully slow to build on my development machine, and I think it is too monolithic. Besides, it looks like it depends on mostly experimental GHC features, and lacks documentation! I'm not a Haskell Jedi, so I think there's no way I can make it to work. I found out that WASH uses CGI, which is sooo retro. Is it just my misunderstanding, maybe? There's also a question regarding which DBC library to use. Hackage has Takusen, HaskellDB, HDBC, HSQL. So which one? I'd be very glad if somebody gave an advice to a noob Haskell web programmer. :) Regards, Artyom. --===============6602074621445163946== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SGVsbG8sPGJyPjxicj5JJiMzOTttIGludGVyZXN0ZWQgaW4gSGFza2VsbCB3ZWIgcHJvZ3JhbW1p bmcuIFF1aWNrIGdvb2dsaW5nIHRvb2sgbWUgdG8gSEFwcFMsIEhWQUMsIFdBU0ggYW5kIGRvLWl0 LXlvdXJzZWxmIGJsb2cgcG9zdHMuPGJyPjxicj5JIHRyaWVkIEhWQUMsIHdoaWNoIGRvZXNuJiMz OTt0IGJ1aWxkIG9uIEdIQyA2LjEwLjEgKGlmIHNvbWVib2R5JiMzOTtzIGludGVyZXN0ZWQsIEkm IzM5O2xsIHBvc3Qgc29tZSBjb21waWxlciBjb21wbGFpbnRzKS4gSSByZWFsbHkgbGlrZS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0dJLCB3aGljaCBpcyBzb29vIHJl dHJvLiBJcyBpdCBqdXN0IG15IG1pc3VuZGVyc3RhbmRpbmcsIG1heWJlPzxicj48YnI+VGhlcmUm IzM5O3MgYWxzbyBhIHF1ZXN0aW9uIHJlZ2FyZGluZyB3aGljaCBEQkMgbGlicmFyeSB0byB1c2Uu IEhhY2thZ2UgaGFzIFRha3VzZW4sIEhhc2tlbGxEQiwgSERCQywgSFNRTC4gU28gd2hpY2ggb25l Pzxicj4KPGJyPkkmIzM5O2QgYmUgdmVyeSBnbGFkIGlmIHNvbWVib2R5IGdhdmUgYW4gYWR2aWNl IHRvIGEgbm9vYiBIYXNrZWxsIHdlYiBwcm9ncmFtbWVyLiA6KTxicj48YnI+UmVnYXJkcyw8YnI+ QXJ0eW9tLjxicj4K --===============6602074621445163946==-- From paulrbrown@gmail.com Thu Nov 20 03:45:56 2008 From: Paul Brown To: web-devel@haskell.org Subject: Re: [web-devel] Where do you start? Date: Thu, 20 Nov 2008 00:51:52 -0800 Message-ID: <5FDDBCED-65AE-472A-A514-4DE19B0A227D@gmail.com> In-Reply-To: <2076f2f90811200024u7105132ci1d9b23218a3a42b4@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3749093334224097712==" --===============3749093334224097712== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Hi, Артем — Some thoughts. (And in the interest of disclosure, I'm one of the D.I.Y. crowd.) > I tried HVAC, which doesn't build on GHC 6.10.1 (if somebody's > interested, I'll post some compiler complaints). I really like its > approach, though. Try the compiler complaints on #haskell or take them straight to the HVAC maintainer/creator. FWIW, I only had to change the base version constraint in my .cabal files to get things building and working on 6.10.1. > Then I tried to DIY: wired Haskell to Lighty using FastCGI. This > approach works, but leaves very much to desire: XHTML combinators > don't really give you compile-time validation, so what is the point > of writing it in code? I had thought I'd need some templating, so I > tried HStringTemplate to find that it doesn't build on my GHC (BTW, > this templating engine has some neat concepts, which I like :-)). Are you looking for an XHTML library that's stricter in terms of compile-time validation? I agree that it can let you do silly things at present (e.g., ...), but I've always found those things to be issues with underlying code (and thus separately testable/excludable). > I found out that WASH uses CGI, which is sooo retro. Is it just my > misunderstanding, maybe? The difference between FastCGI and CGI, from a practical point of view, is that the application process in a FastCGI application is long- lived while the application process in a CGI application lives only for the request. > There's also a question regarding which DBC library to use. Hackage > has Takusen, HaskellDB, HDBC, HSQL. So which one? I've had good luck with HDBC and SQLite3. > I'd be very glad if somebody gave an advice to a noob Haskell web > programmer. :) In realistic terms, there are only noob Haskell web programmers, but we're coming along as a community. You might find some interesting things in the FastCGI-based hpaste version: http://github.com/glguy/hpaste/tree/master BEst. -- Paul --===============3749093334224097712==-- From Alistair.Bayley@invesco.com Thu Nov 20 04:35:09 2008 From: "Bayley, Alistair" To: web-devel@haskell.org Subject: RE: [web-devel] Where do you start? Date: Thu, 20 Nov 2008 09:29:54 +0000 Message-ID: <125EACD0CAE4D24ABDB4D148C4593DA9049E9703@GBLONXMB02.corp.amvescap.net> In-Reply-To: <2076f2f90811200024u7105132ci1d9b23218a3a42b4@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4420273449839148474==" --===============4420273449839148474== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > From: web-devel-bounces@haskell.org > [mailto:web-devel-bounces@haskell.org] On Behalf Of ????? ???????? > > I'm interested in Haskell web programming. Quick googling > took me to HAppS, HVAC, WASH and do-it-yourself blog posts. > > I found out that WASH uses CGI, which is sooo retro. Is it > just my misunderstanding, maybe? I think WASH was integrated with HWS, but that was a while ago and I don't know what the current state is. There is also Hyena, which is very new, but has a lot of promise: http://github.com/tibbe/hyena/tree/master http://www.galois.com/blog/2008/09/12/left-fold-enumerators-a-safe-expre ssive-and-efficient-io-interface-for-haskell/ > There's also a question regarding which DBC library to use. > Hackage has Takusen, HaskellDB, HDBC, HSQL. So which one? (I'm an author and maintainer of Takusen) Takusen is fine if you use Oracle, PostgreSQL, or SQLite3. The ODBC driver still has some bugs which I need to work out. HDBC is the most popular, I think, and integrates with HaskellDB, if you are keen on that. Alistair ***************************************************************** Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. ***************************************************************** --===============4420273449839148474==-- From jgm@berkeley.edu Thu Nov 20 11:41:50 2008 From: John MacFarlane To: web-devel@haskell.org Subject: [web-devel] Re: Where do you start? Date: Thu, 20 Nov 2008 08:47:42 -0800 Message-ID: <20081120164742.GA20410@berkeley.edu> In-Reply-To: <2076f2f90811200024u7105132ci1d9b23218a3a42b4@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7147118373104576751==" --===============7147118373104576751== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable > Then I turned to HAppS, which is painfully slow to build on my developme= nt > machine, and I think it is too monolithic. Besides, it looks like it > depends on mostly experimental GHC features, and lacks documentation! I'm > not a Haskell Jedi, so I think there's no way I can make it to work. HAppS is frustrating at first, and the lack of documentation is maddening, but it's pretty nice once you start to get the hang of it. You might look at my wiki program as an example: http://github.com/jgm/gitit/tree/master/ True, HAppS is monolithic in the sense that it provides server, state, etc. in an integrated package, but you don't have to use everything. You could just use the server, for example. (In my own app, I only use state for users and sessions. The wiki's contents are all stored in a git repository, but you could just as easily use a database.) As for the build speed: if you comment out the bits that include the Facebook module, it will build much faster. I'm hoping the HAppS developers will eventually bundle the Facebook code separately from HAppS-Server. Did you mention Kibro? That's another fastcgi based framework. John --===============7147118373104576751==-- From artyom.shalkhakov@gmail.com Mon Nov 24 03:51:31 2008 From: Artyom Shalkhakov To: web-devel@haskell.org Subject: [web-devel] Where do you start? Date: Mon, 24 Nov 2008 14:57:42 +0600 Message-ID: <2076f2f90811240057k1ea715aata077af701140c448@mail.gmail.com> In-Reply-To: <2076f2f90811232049p62d2071dv7e58a57741185548@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9129618773784660780==" --===============9129618773784660780== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello, I'd like to share some links, gathered with much help from other mailing list subscribers. There seem to be plenty of ways to get the job done for a Haskell web develop= er, aside from using more common languages. :) First, the do-it-yourself way. There are CGI/FCGI [1], [2] bindings, so you can use your binaries with almost any webserver. A very nice templating engine [3] is also available. If you wish to embed (X)HTML in Haskell, you can use either the combinator libraries [4], [5] or [6] (which is highly experimental). Low-level libraries like [7],[8] can be used for database connectivity, while [9] is for those who would like to construct their queries using combinators. You can also take a look at lightweight frameworks like [10], [11]. Finally, in the near future we'll hopefully have a very robust and high-performance HTTP web-server [12] which is going to be very simple to start with. And about the frameworks out there. There are a few all-in-one frameworks ([13], [14]) available for those who can dive into the code, because their documentation is quite lacking. (Of course, you can help out the authors by proposing some!) If you're interested in HAppS, there is a tutorial to help you [15], and you = can take [16] as a reference. I'm very grateful to all the people who responded to my inquiry! Regards, Artyom. [1] CGI, [2] FCGI, [3] HStringTemplate, [4] Text.Html, a combinator library [5] Text.Xhtml, a combinator library [6] VXML [7] Takusen [8] HDBC [9] HaskellDB [10] HVAC (Haskell View and Controller) [11] Kibro [12] Hyena: , [13] HAppS, the Haskell Application Server [14] Turbinado, an early stab at Ruby On Rails [15] Real World HAppS: The Cabalized, self-demoing HAppS Tutorial [16] Gitit, a wiki written using HAppS and git --===============9129618773784660780==-- From marco-oweber@gmx.de Mon Nov 24 04:24:59 2008 From: Marc Weber To: web-devel@haskell.org Subject: Re: [web-devel] Where do you start? Date: Mon, 24 Nov 2008 10:31:08 +0100 Message-ID: <20081124093108.GA3559@gmx.de> In-Reply-To: <2076f2f90811240057k1ea715aata077af701140c448@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6716053711449567156==" --===============6716053711449567156== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > I'm very grateful to all the people who responded to my inquiry! > > Regards, > Artyom. If you have time it would be nice to add this somewhere to the haskell.org wiki :-) Kind regards Marc Weber --===============6716053711449567156==-- From lemming@henning-thielemann.de Thu Nov 27 17:24:17 2008 From: Henning Thielemann To: web-devel@haskell.org Subject: [web-devel] Lazy simpleHTTP Date: Thu, 27 Nov 2008 23:30:38 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7154535096176889536==" --===============7154535096176889536== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit I have HTTP-3001.0.4 and I like to check the HTTP response headers before downloading the entire document. I hesitate to do a HEAD request first and then a separate GET request, because there is a (little, but not zero) chance, that the document changes between both requests. I hoped that simpleHTTP is lazy enough, so that I can check the rspHeaders field of the HTTP response and that only touching rspBody would download the document content. Unfortunately simpleHTTP downloads the entire document before I can access the HTTP header. To be honest, I would also like to fetch the content of the document lazily. Actually, if simpleHTTP would behave lazy, I suspect this requires using unsafeInterleaveIO internally, which is considered a hack. Is this the reason why simpleHTTP is not lazy? Or do I just need a lazy Stream type for this purpose? --===============7154535096176889536==-- From lemming@henning-thielemann.de Fri Nov 28 11:48:23 2008 From: Henning Thielemann To: web-devel@haskell.org Subject: [web-devel] HaskellWiki: Category:Web Date: Fri, 28 Nov 2008 17:54:47 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7782536339624119231==" --===============7782536339624119231== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit I wondered why there was still no category for web applications on the Haskell Wiki, so I have initialized one: http://www.haskell.org/haskellwiki/Category:Web --===============7782536339624119231==-- From lemming@henning-thielemann.de Fri Nov 28 18:20:04 2008 From: Henning Thielemann To: web-devel@haskell.org Subject: [web-devel] Re: Lazy simpleHTTP Date: Sat, 29 Nov 2008 00:26:18 +0100 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8608234504784873827==" --===============8608234504784873827== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Thu, 27 Nov 2008, Henning Thielemann wrote: > I have HTTP-3001.0.4 and I like to check the HTTP response headers before > downloading the entire document. I have tried to solve this on my own. I have written a wrapper to any stream type. It first reads the entire document lazily into a string and then ships its contents when readBlock or readLine is called. However, the program blocks on 'close' now and I don't know why. (See LazyStream.example) When looking at Network.HTTP.sendHTTP I wonder whether it is a good idea, that sendHTTP closes the stream automatically when it finishs (and also when an exception is raised). In general I think it is good, when the one who opens a stream is also responsible for closing it. For a lazy stream, the current implementation of sendHTTP would fail, since when sendHTTP quits, the data is still not read, and when some processes the HTTP response, data will be lazily read from a closed stream. --===============8608234504784873827== Content-Type: text/x-haskell Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="LazyStream.hs" MIME-Version: 1.0 ey0gfApXZSB3YW50IHRvIHJlYWQgYW55IHN0cmVhbSBpbiBhIGxhenkgbWFubmVyLgpXZSBjYW5u b3QganVzdCB3cmFwIHRoZSBzdHJlYW0gaW4KCj4gZGF0YSBMYXp5U3RyZWFtIHN0cmVhbSA9Cj4g ICBMYXp5U3RyZWFtIHtnZXRTdHJlYW0gOjogc3RyZWFtLCBjaHVua1NpemUgOjogSW50fQoKYW5k IGltcGxlbWVudCB0aGUgJ3JlYWRCbG9jaycgYW5kICdyZWFkTGluZScgbWV0aG9kcwp1c2luZyB1 bnNhZmVJbnRlcmxlYXZlSU8sCmJlY2F1c2UgdGhhdCB3YXksIHRoZSB1bmRlcmx5aW5nICdyZWFk QmxvY2snIG1pZ2h0IGJlIGNhbGxlZCBpbiB0aGUgd3Jvbmcgb3JkZXIuClRodXMgd2UgcmVhZCB0 aGUgZW50aXJlIHN0cmVhbSBpbnRvIGEgc3RyaW5nIGxhemlseSwKYW5kIHNoaXAgdGhhdCBvbmUg bGF6aWx5IGluIHR1cm4uCi19Cm1vZHVsZSBMYXp5U3RyZWFtIHdoZXJlCgppbXBvcnQgTmV0d29y ay5TdHJlYW0gKFN0cmVhbShyZWFkTGluZSw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idWZmZXIgcykgW10gPj4KICAgICAgIGNsb3NlIChz dHJlYW0gcykKCgp7LSB8CkRlbW9uc3RyYXRpb24gb2YgbGF6aW5lc3M6CldlIGNhbiBmZXRjaCB0 aGUgSFRUUCByZXNwb25zZSBoZWFkZXIgd2l0aG91dCByZWFkaW5nIHRoZSBlbnRpcmUgcmVzcG9u c2UgYm9keS4KSW4gb3JkZXIgdG8gZGVtb25zdHJhdGUgdGhhdCwgSSByZXF1ZXN0IGFuIENEIElT TyBpbWFnZSBvZiBhcm91bmQgNjAwIE1CLgpUaGUgZGlmZmVyZW5jZSBiZXR3ZWVuIGxvYWRpbmcg dGhlIGVudGlyZSBib2R5IGFuZCBvbWl0dGluZyBpdAppcyBjbGVhcmx5IHBlcmNlaXZhYmxlLgot fQpleGFtcGxlIDo6IElPICgpCmV4YW1wbGUgPQogICBkbyBscyA8LSBvcGVuIDEwMDAgPTw8IFRD UC5vcGVuVENQUG9ydCAiZnRwLnR1LWNoZW1uaXR6LmRlIiA4MAogICAgICB3cml0ZUJsb2NrIGxz ICJHRVQgL3B1Yi9saW51eC9vcGVuc3VzZS9kaXN0cmlidXRpb24vMTEuMC9pc28vY2Qvb3BlblNV U0UtMTEuMC1LREU0LUxpdmVDRC1pMzg2LmlzbyBIVFRQLzEuMVxuIgogICAgICB3cml0ZUJsb2Nr IGxzICJIb3N0OiBmdHAudHUtY2hlbW5pdHouZGVcbiIKICAgICAgd3JpdGVCbG9jayBscyAiXG4i CiAgICAgIGxldCByZWFkTGluZXMgPQogICAgICAgICAgICAgZWl0aGVyIHByaW50CiAgICAgICAg ICAgICAgICAoXGxpbmUgLT4gd2hlbiAobm90ICQgbnVsbCBsaW5lKSAkIHB1dFN0ckxuIGxpbmUg Pj4gcmVhZExpbmVzKQogICAgICAgICAgICAgICAgPTw8IHJlYWRMaW5lIGxzCiAgICAgIHJlYWRM aW5lcwogICAgICBjbG9zZSBscwo= --===============8608234504784873827==-- From marco-oweber@gmx.de Fri Nov 28 18:45:27 2008 From: Marc Weber To: web-devel@haskell.org Subject: Re: [web-devel] Re: Lazy simpleHTTP Date: Sat, 29 Nov 2008 00:51:51 +0100 Message-ID: <20081128235151.GA23971@gmx.de> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8640425970321486979==" --===============8640425970321486979== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Sat, Nov 29, 2008 at 12:26:18AM +0100, Henning Thielemann wrote: > For a lazy stream, the current implementation of sendHTTP would fail, sin= ce=20 > when sendHTTP quits, the data is still not read, and when some processes t= he=20 > HTTP response, data will be lazily read from a closed stream. All I know is that there have been some problems with too many opened connections which haven't been closed in the past. Wether they've been a result of beeing to lazy I can no longer remember Marc --===============8640425970321486979==-- From paulrbrown@gmail.com Fri Nov 28 18:49:04 2008 From: Paul Brown To: web-devel@haskell.org Subject: Re: [web-devel] Re: Lazy simpleHTTP Date: Fri, 28 Nov 2008 15:55:28 -0800 Message-ID: <2A03186B-6759-4149-AD5C-E150DB9B8283@gmail.com> In-Reply-To: <20081128235151.GA23971@gmx.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5407943700725521420==" --===============5407943700725521420== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Nov 28, 2008, at 3:51 PM, Marc Weber wrote: > All I know is that there have been some problems with too many opened > connections which haven't been closed in the past. Wether they've > been a > result of beeing to lazy I can no longer remember That was resolved - the issue was with closing connections in the TCP code. Paul Brown paulrbrown@gmail.com --===============5407943700725521420==-- From conal@conal.net Fri Nov 28 19:52:05 2008 From: Conal Elliott To: web-devel@haskell.org Subject: Re: [web-devel] Re: Lazy simpleHTTP Date: Fri, 28 Nov 2008 16:58:31 -0800 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2846547746437981988==" --===============2846547746437981988== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > > In general I think it is good, when the one who opens a stream is also > responsible for closing it. That policy thwarts modularity, doesn't it? Just as does the policy of whoever allocates memory is responsible for freeing it. Laziness, like garbage collection, is mainly about modularity (as expressed and demonstrated in "Why functional programming matters"). So I'd recommend an automated, GC-based solution. GHC has weak references and finalizers for this sort of thing. I think there's room for improvement of the current implementation of finalizer scheduling for timely resource deallocation. We've had to deal with this problem for managing graphics memory, in order to make functional graphics efficient. - Conal 2008/11/28 Henning Thielemann > > On Thu, 27 Nov 2008, Henning Thielemann wrote: > > I have HTTP-3001.0.4 and I like to check the HTTP response headers before >> downloading the entire document. >> > > I have tried to solve this on my own. I have written a wrapper to any > stream type. It first reads the entire document lazily into a string and > then ships its contents when readBlock or readLine is called. However, the > program blocks on 'close' now and I don't know why. (See LazyStream.example) > > When looking at Network.HTTP.sendHTTP I wonder whether it is a good idea, > that sendHTTP closes the stream automatically when it finishs (and also when > an exception is raised). In general I think it is good, when the one who > opens a stream is also responsible for closing it. > For a lazy stream, the current implementation of sendHTTP would fail, > since when sendHTTP quits, the data is still not read, and when some > processes the HTTP response, data will be lazily read from a closed stream. > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > > --===============2846547746437981988== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJsb2NrcXVvdGUgc3R5bGU9ImJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiKDIwNCwgMjA0LCAy MDQpOyBtYXJnaW46IDBwdCAwcHQgMHB0IDAuOGV4OyBwYWRkaW5nLWxlZnQ6IDFleDsiIGNsYXNz PSJnbWFpbF9xdW90ZSI+SW4gZ2VuZXJhbCBJIHRoaW5rIGl0IGlzIGdvb2QsIHdoZW4gdGhlIG9u ZSB3aG8gb3BlbnMgYSBzdHJlYW0gaXMgYWxzbyByZXNwb25zaWJsZSBmb3IgY2xvc2luZyBpdC48 L2Jsb2NrcXVvdGU+CjxkaXY+PGJyPlRoYXQgcG9saWN5IHRod2FydHMgbW9kdWxhc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iB0YXJnZXQ9Il9ibGFuayI+aHR0cDovL3d3dy5o YXNrZWxsLm9yZy9tYWlsbWFuL2xpc3RpbmZvL3dlYi1kZXZlbDwvYT48YnI+Cjxicj48L2Jsb2Nr cXVvdGU+PC9kaXY+PGJyPgo= --===============2846547746437981988==-- From lemming@henning-thielemann.de Sat Nov 29 10:39:26 2008 From: Henning Thielemann To: web-devel@haskell.org Subject: [web-devel] Re: Lazy simpleHTTP Date: Sat, 29 Nov 2008 16:45:53 +0100 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4189470031095602809==" --===============4189470031095602809== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Sat, 29 Nov 2008, Henning Thielemann wrote: > On Thu, 27 Nov 2008, Henning Thielemann wrote: > >> I have HTTP-3001.0.4 and I like to check the HTTP response headers before = >> downloading the entire document. > > I have tried to solve this on my own. I have written a wrapper to any strea= m=20 > type. It first reads the entire document lazily into a string and then ship= s=20 > its contents when readBlock or readLine is called. However, the program=20 > blocks on 'close' now and I don't know why. (See LazyStream.example) Is anyone else interested in getting HTTP response bodies lazily in=20 general and trying my code in particular? Maybe some of the experts have=20 an idea, why 'close' blocks. --===============4189470031095602809==-- From lemming@henning-thielemann.de Sun Nov 30 17:00:30 2008 From: Henning Thielemann To: web-devel@haskell.org Subject: [web-devel] Re: Lazy simpleHTTP Date: Sun, 30 Nov 2008 23:07:01 +0100 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6380234513205092728==" --===============6380234513205092728== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Sat, 29 Nov 2008, Henning Thielemann wrote: > On Sat, 29 Nov 2008, Henning Thielemann wrote: > >> On Thu, 27 Nov 2008, Henning Thielemann wrote: >>=20 >>> I have HTTP-3001.0.4 and I like to check the HTTP response headers before= =20 >>> downloading the entire document. >>=20 >> I have tried to solve this on my own. I have written a wrapper to any=20 >> stream type. It first reads the entire document lazily into a string and=20 >> then ships its contents when readBlock or readLine is called. However, the= =20 >> program blocks on 'close' now and I don't know why. (See=20 >> LazyStream.example) > > Is anyone else interested in getting HTTP response bodies lazily in general= =20 > and trying my code in particular? Maybe some of the experts have an idea, w= hy=20 > 'close' blocks. I have got an idea by myself. On the one hand 'close' checks with a=20 pattern match whether the buffer is empty, on the other hand 'close'=20 checks whether the connection is active or closed. Both of these check=20 will certainly force the lazy read to be completed. But maybe the first=20 check is even wrong, since it aborts the program, if you close a=20 connection before reading it completely: Network.Stream Network.TCP> s <- openTCPPort "ftp.tu-chemnitz.de" 80 Network.Stream Network.TCP> writeBlock s "GET /pub/linux/opensuse/distributio= n/11.0/iso/cd/openSUSE-11.0-KDE4-LiveCD-i386.iso HTTP/1.1\n" Right () Network.Stream Network.TCP> writeBlock s "Host: ftp.tu-chemnitz.de\n" Right () Network.Stream Network.TCP> writeBlock s "\n" Right () Network.Stream Network.TCP> readLine s Right "HTTP/1.1 200 OK\r\n" Network.Stream Network.TCP> readLine s Right "Date: Sun, 30 Nov 2008 21:58:43 GMT\r\n" Network.Stream Network.TCP> close s *** Exception: Network/TCP.hs:(166,10)-(172,17): Non-exhaustive patterns in f= unction closeConn This pattern is certainly the [] in closeConn (MkConn sk addr [] _) Is this a bug or a feature? --===============6380234513205092728==-- From lemming@henning-thielemann.de Mon Dec 1 03:33:45 2008 From: Henning Thielemann To: web-devel@haskell.org Subject: [web-devel] Re: Lazy simpleHTTP Date: Mon, 01 Dec 2008 09:40:17 +0100 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5386557429748846627==" --===============5386557429748846627== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Sun, 30 Nov 2008, Henning Thielemann wrote: > On Sat, 29 Nov 2008, Henning Thielemann wrote: > >> On Sat, 29 Nov 2008, Henning Thielemann wrote: >>=20 >>> On Thu, 27 Nov 2008, Henning Thielemann wrote: >>>=20 >>>> I have HTTP-3001.0.4 and I like to check the HTTP response headers befor= e=20 >>>> downloading the entire document. >>>=20 >>> I have tried to solve this on my own. I have written a wrapper to any=20 >>> stream type. It first reads the entire document lazily into a string and = >>> then ships its contents when readBlock or readLine is called. However, th= e=20 >>> program blocks on 'close' now and I don't know why. (See=20 >>> LazyStream.example) >>=20 >> Is anyone else interested in getting HTTP response bodies lazily in genera= l=20 >> and trying my code in particular? Maybe some of the experts have an idea, = >> why 'close' blocks. > > I have got an idea by myself. On the one hand 'close' checks with a pattern= =20 > match whether the buffer is empty, on the other hand 'close' checks whether= =20 > the connection is active or closed. Both of these check will certainly forc= e=20 > the lazy read to be completed. I'll continue my thread ... I think it is best to build the lazy stream on=20 top of Network.Socket, not Network.TCP, since the first one does not=20 buffer and the second one does. Since my lazy stream reads the entire=20 source content into a single String lazily, I already have a buffer. In=20 order to not duplicate code, I'd like to introduce a hidden module=20 Network.TCP.Private with open and close methods, which can then be used by=20 Network.TCP and Network.Stream.Lazy. Alternatively I could add a new=20 public module for unbuffered TCP transfer. I think this would be even=20 cleaner. However, I had to name the new module, say,=20 Network.TCP.Unbuffered and the module names=20 Network.TCP.Unbuffered+Network.TCP are somehow the wrong way round=20 compared to Network.TCP+Network.TCP.Buffered. Maybe I should name them=20 Network.TCP.Unbuffered+Network.TCP.Buffered and re-export the latter one=20 in Network.TCP. Have such changes a chance to get included into HTTP=20 package? --===============5386557429748846627==-- From paulrbrown@gmail.com Tue Dec 2 17:19:05 2008 From: Paul Brown To: web-devel@haskell.org Subject: Re: [web-devel] Re: Lazy simpleHTTP Date: Tue, 02 Dec 2008 14:25:37 -0800 Message-ID: <4BEAF2A6-33F7-43F9-946D-4A0A01790146@gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0348517997671770582==" --===============0348517997671770582== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi, Henning -- > I'll continue my thread ... I think it is best to build the lazy > stream on top of Network.Socket, not Network.TCP, since the first > one does not buffer and the second one does. Since my lazy stream > reads the entire source content into a single String lazily, I > already have a buffer. In order to not duplicate code, I'd like to > introduce a hidden module Network.TCP.Private with open and close > methods, which can then be used by Network.TCP and > Network.Stream.Lazy. Alternatively I could add a new public module > for unbuffered TCP transfer. I think this would be even cleaner. > However, I had to name the new module, say, Network.TCP.Unbuffered > and the module names Network.TCP.Unbuffered+Network.TCP are somehow > the wrong way round compared to Network.TCP+Network.TCP.Buffered. > Maybe I should name them Network.TCP.Unbuffered+Network.TCP.Buffered > and re-export the latter one in Network.TCP. Have such changes a > chance to get included into HTTP package? I'm still a little lost as to why this is necessary and/or desirable. Some (if not all) of your use cases would be achievable via proper use of HTTP protocol features (100 Continue, Conditional GET, etc.), and it is a question of whether those are well supported by the current implementation. For the laziness in handling response bodies, I think you'd actually want to expose an iteration semantic implemented on top of HTTP chunked encoding and ranged requests, and that would live at a higher level in the stack than the TCP layer. Just $0.02 for you. Paul Brown paulrbrown@gmail.com --===============0348517997671770582==-- From lemming@henning-thielemann.de Fri Dec 5 02:10:58 2008 From: Henning Thielemann To: web-devel@haskell.org Subject: [web-devel] Network.Browser.splitMany - bug? Date: Fri, 05 Dec 2008 08:17:31 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8882810385573314559==" --===============8882810385573314559== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit I don't know whether this is a bug or a feature: *Network.Browser> splitMany ',' "abc,def,ghj" ["abc",",def,gh"] According to the name and the comment "Removes delimiters" I propose: *Network.Browser> splitMany' ',' "abc,def,ghj" ["abc","def","ghj"] with splitMany' :: Eq a => a -> [a] -> [[a]] splitMany' delim = uncurry (:) . foldr (\c ~(str,rest) -> if c==delim then ([], str:rest) else (c:str, rest)) ([],[]) --===============8882810385573314559==-- From lemming@henning-thielemann.de Sun Dec 14 16:16:44 2008 From: Henning Thielemann To: web-devel@haskell.org Subject: Re: [web-devel] Lazy simpleHTTP Date: Sun, 14 Dec 2008 22:23:58 +0100 Message-ID: In-Reply-To: <4BEAF2A6-33F7-43F9-946D-4A0A01790146@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8907262901391337868==" --===============8907262901391337868== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Tue, 2 Dec 2008, Paul Brown wrote: > I'm still a little lost as to why this is necessary and/or desirable. Some= =20 > (if not all) of your use cases would be achievable via proper use of HTTP=20 > protocol features (100 Continue, Conditional GET, etc.), and it is a questi= on=20 > of whether those are well supported by the current implementation. I do not know, how '100 Continue' would help, since this is for=20 conditionally sending the body of the HTTP request, not conditionally=20 receiving the body of the HTTP response, right? However, you are right, in=20 principle it would help me to use HTTP features, like the Accept header.=20 Using it, I could tell, that I only want certain types of data to be send.=20 However, e.g. the original HWS ignores the Accept header and when I=20 checked other web servers, they do so, as well. So it still seems to be=20 the best, to get the header via a GET request and cancel the transfer,=20 once I have seen enough of the header. > For the laziness in handling response bodies, I think you'd actually=20 > want to expose an iteration semantic implemented on top of HTTP chunked=20 > encoding and ranged requests, and that would live at a higher level in=20 > the stack than the TCP layer. Yes, I also want lazy download of the body. Certainly an iteratee=20 implementation could be cleaner, but probably considerably different from=20 the current implementation. I'm afraid 'Range' is supported as bad as=20 'Accept' - and what about dynamically generated (maybe even infinite)=20 content? So I think I should not bother the web server with the way I want=20 to download its content, but just mimic a stupid browser. My current state can be found here: http://code.haskell.org/~thielema/http/ I do not want to fork and I hope the patches are accepted somewhen and=20 nobody adds conflicting patches in the meantime, since this would mean I=20 have to re-record all my changes in order to avoid the dreaded exponential=20 time darcs conflict resolution. However, currently there are only changes=20 behind the scenes and no new visible features. I'm now using monad=20 transformers from my explicit-exception package, which simplified a lot of=20 the manual exception handling before. I removed some 'reverse's, which are=20 a laziness killer, but I'm still not at the end. Chunked transfer is=20 particularly difficult with respect to laziness, although I do not know=20 why. I have added a Monad which further abstracts the Stream concept. It=20 allows us to do HTTP communication in absence of IO, which is perfect for=20 unit testing and allows lazy processing without unsafeInterleaveIO - you=20 only need the unsafeInterleaveIO hidden in hGetContents. --===============8907262901391337868==-- From marco-oweber@gmx.de Mon Jan 26 06:47:54 2009 From: Marc Weber To: web-devel@haskell.org Subject: [web-devel] Re: [Haskell-cafe] Haskell Web Framework Date: Mon, 26 Jan 2009 12:57:20 +0100 Message-ID: <20090126115720.GA23007@gmx.de> In-Reply-To: <29bf512f0901252203k32bb0d09x13e372f07351f936@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0406386526933852946==" --===============0406386526933852946== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Michael Snoyman, Donnie Jone, I don't think cross posting to web-devel and haskel-cafe is a good idea. Maybe do that but then advice people to either reply to cafe or to web-devel. So I suggest that we continue this discussion on web-devel. First of all there have been some attempts already to provide web frameworks for haskell. If you don't konw WASH yet please do have a look at the examples. I find the idea behind WASH pretty neat. It does also solve parts of the strict XHTML problem. you can only add valid tags and attributes. However it doesn't pay attention to order. (I don't think it was possible that time WASH was written). I've tried to make it better and verify that only valid XHTML is generated. The result is a finate state machine implented using functional dependencies. You can get the code from here git://mawercer.de/vxml.. However while doing so I noticed that this starts turning into a typing hell.. Why? There are some tags which require one or more childs (example :
    ). So to distinguish both states (empty ul, ul with at least one element which may be closed) you need two different types. Thus you can no longer do myUl =3D ul $ map (li . show) [1...] My solution was to switch to a weak checking which only allows valid sub tags but does no longer care about order etc. So by now I'd vote for a partial validation only. a total validation isn't worth the effort. But it would be nice to to derive that from some specification (such as XHTML). So maybe have a look at my library and use the weak validation mode. About Ajax: I've developped some Ajax applications beeing written in PHP using MySQL.. In WASH everything is simple: You have one state (it doesn't know about AJAX). From that state you can go on, duplicate it etc. The state is passed to the client using an hidden input. So there is not that much you have to care about. But you can't write that much interaction easily either. When starting to write a web application (say a web shop).. it would be best if the client page keeps a state knowing about the basket and its content as well. And if you start implenting fancy features such as drag and drop I'm no longer sure which is the best way to handle this "client" state. I even don't know wether it can be abstracted on server side (using any language).. I'll watch you, keep posting to this list about your progress. Comments about the blog post (http://blog.snoyman.com/2009/01/25/haskell-web-= framework/) Maybe the first step is writing down differences between existing haskell web frameworks. Probably the haskell wiki would be a good place to start. Another first step might be writing kind of abstraction so that an application can use either HAppS or apache or (fast)-CGI etc.. Encrypted cookies :-) Nice idea.. However this does mean a lot more traffic, doesn't it? It also depends on your storage enginge. If you have once keeping stuff in memory this won't hurt that much. But you're right. I'll think about that option About 13.: We should be able to simply specify the algorithm necessary to calculate an age from a birthday, and the framework will convert this into both client- and server-side code There is already a haskell -> JS converter.. However this will cause a lot more traffic. And if you have many users only loading the front page .. How do you want to utilize the power of existing script frameworks (eg Mootools) ? Should the engine be aware about those? What about CSS abstraction ? I mean ie6 does read some CSS properties quite different.. What about JS automatic compression (maybe even rewriting names to shorter ones)? Sincerly Marc Weber --===============0406386526933852946==-- From gale@sefer.org Mon Jan 26 09:25:37 2009 From: Yitzchak Gale To: web-devel@haskell.org Subject: [web-devel] Re: [Haskell-cafe] Haskell Web Framework Date: Mon, 26 Jan 2009 16:35:06 +0200 Message-ID: <2608b8a80901260635h3fc8ece4jebddfe4703012e2b@mail.gmail.com> In-Reply-To: <20090126115720.GA23007@gmx.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3514403468830172419==" --===============3514403468830172419== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit As per Marc's request, I am continuing the thread on web-devel only. I have CC'ed everyone who has participated in this thread so far. Michael Snoyman wrote: > why bother with the XML at all? > I've experimented both with writing HTML which gets > rendered by code, or writing code that creates the HTML, > and I think the latter is more flexible It doesn't have to be XML, but there are several reasons why you sometimes want a web authoring language that is intentionally limited. You don't always want your web design artists to be responsible for software authoring. They may not have enough programming skills. Even if they have the skills, their interaction with the QA department is much more expensive if they could potentially be affecting more things. Of course, the QA department, the web art department, and the software development department might all consist of just you. In that case, you would want something like Text.XHtml :) Marc Weber wrote: > If you don't konw WASH yet please do have a look > at the examples. I find the idea behind WASH pretty > neat. Yes, a modernized version of WASH would be great. Especially if it supports AJAX semantics as well, but that would obviously be a lot more work. How about an option to compile to PHP, so you could use it on the super-cheap hosting services? :) Regards, Yitz --===============3514403468830172419==-- From fmartini@gmail.com Sat Feb 7 18:03:04 2009 From: Felix Martini To: web-devel@haskell.org Subject: [web-devel] Re: [Haskell-cafe] HSGI: Haskell Server Gateway Interface Date: Sun, 08 Feb 2009 00:13:11 +0100 Message-ID: <6c0416190902071513r8bd6adl86a1ab1aeb65d4dc@mail.gmail.com> In-Reply-To: <498E0295.9090700@libero.it> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6740718705329177923==" --===============6740718705329177923== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit [Original discussion in haskell-cafe: http://www.haskell.org/pipermail/haskell-cafe/2009-February/055270.html] Manlio Perillo: > Here are the problems: > > 1) supported HTTP methods are fixed, since you use a custom data type (Btw. It is not my proposal, Johan Tibell has written it. I'll mail him to notify him about this discussion.) I agree with that. In my own framework prototype i have data HttpMethod = OPTIONS | GET | HEAD | POST | PUT | DELETE | TRACE | CONNECT | Extension String deriving (Eq, Show) > 2) no support for other possible CGI variables > (or simply custom variables: I use the environ dictionary to store > application configuration, and I think it is a great thing). A user dictionary / association list could be useful. A Trie is probably faster than a Map so i am not sure if the Map type should be used. Could also be implemented by the frameworks themselves. > 3) No support for optimized file serving, like with WSGI file_wrapper Would be nice to have provided it is cross-platform. > 4) No support for keeping "complex" state (like database connection) in > the environ. > > I have read some examples with CGI package, where a custom monad > transformer is used. > I'm not sure if this solution is flexible and "scalable". This should be a task for the framework itself. Using a ReaderT or StateT transformer is very common in Haskell. > 5) I can't find documentation about the type of the response. > It is rather clear that it is > (ByteString, [(ByteString, ByteString)], Enumerator) > > but this should be documented somewhere. It's a wiki so feel free to change it or add more documentation. About the enumerator, using it is indeed debatable because it is not immediately obvious how it works, but i haven't seen anything for Haskell that works better. Like other haskellers have said lazy bytestrings with IO is asking for trouble. I have been bitten by it myself and it is hard to debug. Imho lazy bytestrings are only useful when the data generator is a pure function. Regards, Felix --===============6740718705329177923==-- From manlio_perillo@libero.it Sun Feb 8 07:44:43 2009 From: Manlio Perillo To: web-devel@haskell.org Subject: [web-devel] Re: [Haskell-cafe] HSGI: Haskell Server Gateway Interface Date: Sun, 08 Feb 2009 13:54:46 +0100 Message-ID: <498ED616.7080007@libero.it> In-Reply-To: <6c0416190902071513r8bd6adl86a1ab1aeb65d4dc@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4078045272357070629==" --===============4078045272357070629== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Felix Martini ha scritto: > [Original discussion in haskell-cafe: > http://www.haskell.org/pipermail/haskell-cafe/2009-February/055270.html] > > Manlio Perillo: >> Here are the problems: >> >> 1) supported HTTP methods are fixed, since you use a custom data type > > (Btw. It is not my proposal, Johan Tibell has written it. I'll mail > him to notify him about this discussion.) > > I agree with that. In my own framework prototype i have > > data HttpMethod = OPTIONS > | GET > | HEAD > | POST > | PUT > | DELETE > | TRACE > | CONNECT > | Extension String > deriving (Eq, Show) > +1 >> 2) no support for other possible CGI variables >> (or simply custom variables: I use the environ dictionary to store >> application configuration, and I think it is a great thing). > > A user dictionary / association list could be useful. A Trie is > probably faster than a Map so i am not sure if the Map type should be > used. Could also be implemented by the frameworks themselves. > Let the framework handle the configuration data is what most of the Python web framework do. I personally prefer to have the configuration data stored in the environ dictionary. >> 3) No support for optimized file serving, like with WSGI file_wrapper > > Would be nice to have provided it is cross-platform. > It needs not to be cross platform. See how WSGI file_wrapper is implemented. You just need to pass to the server a file Handle (and optionally an offset). If the server does not support sendfile, or memory mapped files, it can just iterate over the file and sends each chunk to the client. >> 4) No support for keeping "complex" state (like database connection) in >> the environ. >> >> I have read some examples with CGI package, where a custom monad >> transformer is used. >> I'm not sure if this solution is flexible and "scalable". > > This should be a task for the framework itself. Using a ReaderT or > StateT transformer is very common in Haskell. > How is this "composable"? Let's assume we have a "big" application. As an example an application with multiple url dispatchers: /a -> /ax -> /ay /b -> /bx -> /by Of course I would like to setup the connection on only one place. Storing the connection in the WAI environment is handy. Of course you still need a ReaderT or StateT transformer, but your state is all in one place. Can you post an example? Thanks. >> 5) I can't find documentation about the type of the response. >> It is rather clear that it is >> (ByteString, [(ByteString, ByteString)], Enumerator) >> >> but this should be documented somewhere. > > It's a wiki so feel free to change it or add more documentation. > > > About the enumerator, using it is indeed debatable because it is not > immediately obvious how it works, but i haven't seen anything for > Haskell that works better. Like other haskellers have said lazy > bytestrings with IO is asking for trouble. I have been bitten by it > myself and it is hard to debug. Imho lazy bytestrings are only useful > when the data generator is a pure function. > Well, I find the enumerator "story" quite strange. It is the best idea available, it is "quite old", however I can't see it largely in use. There is not even a chapter about it in the Real World Haskell. > Regards, > Felix > Regards Manlio --===============4078045272357070629==-- From manlio_perillo@libero.it Sun Feb 8 11:11:41 2009 From: Manlio Perillo To: web-devel@haskell.org Subject: [web-devel] [BUG] in WAI definition Date: Sun, 08 Feb 2009 17:21:37 +0100 Message-ID: <498F0691.5000206@libero.it> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3226646144280391724==" --===============3226646144280391724== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi all. I'm trying to compile the example WAI application, as defined in http://www.haskell.org/haskellwiki/WebApplicationInterface However there are several bugs. 1) The example application returns: return (status, responseHeaders, enumerator) where status is an integer 2) The CgiAdapter expects: (status, reason, respHeaders, output) <- application environ In detail, the type "Application", used in CgiAdapter is never defined. Manlio Perillo --===============3226646144280391724==-- From johan.tibell@gmail.com Thu Feb 19 16:10:31 2009 From: Johan Tibell To: web-devel@haskell.org Subject: Re: [web-devel] [BUG] in WAI definition Date: Thu, 19 Feb 2009 22:21:14 +0100 Message-ID: <90889fe70902191321v38da3e0cy468c0181af8c591f@mail.gmail.com> In-Reply-To: <498F0691.5000206@libero.it> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3800929007572384008==" --===============3800929007572384008== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Manlio, Thanks for reporting the bugs and sorry for the late reply. On Sun, Feb 8, 2009 at 5:21 PM, Manlio Perillo wro= te: > I'm trying to compile the example WAI application, as defined in > http://www.haskell.org/haskellwiki/WebApplicationInterface > > However there are several bugs. I haven't given the WAI specification much attention since I first wrote it. Mostly because I'm caught up in thinking about enumerators and their role in e.g. an HTTP server implementation. I intend to revisit the specification once I have released a first version of Hyena (my web server). Hopefully that will happen soon but I rather get it right than release "just" another web server -- there are plenty out there already. Cheers, Johan --===============3800929007572384008==-- From manlio_perillo@libero.it Thu Feb 19 16:36:30 2009 From: Manlio Perillo To: web-devel@haskell.org Subject: Re: [web-devel] [BUG] in WAI definition Date: Thu, 19 Feb 2009 22:47:09 +0100 Message-ID: <499DD35D.4060409@libero.it> In-Reply-To: <90889fe70902191321v38da3e0cy468c0181af8c591f@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4568704762642174383==" --===============4568704762642174383== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Johan Tibell ha scritto: > Hi Manlio, >=20 > Thanks for reporting the bugs and sorry for the late reply. >=20 Ah, thanks. I was thinking that the web mailing list was dead. > On Sun, Feb 8, 2009 at 5:21 PM, Manlio Perillo w= rote: >> I'm trying to compile the example WAI application, as defined in >> http://www.haskell.org/haskellwiki/WebApplicationInterface >> >> However there are several bugs. >=20 > I haven't given the WAI specification much attention since I first > wrote it. Mostly because I'm caught up in thinking about enumerators > and their role in e.g. an HTTP server implementation.=20 Do you have any result? > I intend to > revisit the specification once I have released a first version of > Hyena (my web server). Hopefully that will happen soon but I rather > get it right than release "just" another web server -- there are > plenty out there already. >=20 Ok, thanks. Manlio Perillo --===============4568704762642174383==-- From johan.tibell@gmail.com Fri Feb 20 07:52:50 2009 From: Johan Tibell To: web-devel@haskell.org Subject: Re: [web-devel] [BUG] in WAI definition Date: Fri, 20 Feb 2009 14:03:37 +0100 Message-ID: <90889fe70902200503j46e0a089u83ae9a51847930ed@mail.gmail.com> In-Reply-To: <499DD35D.4060409@libero.it> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0354869202821482543==" --===============0354869202821482543== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Thu, Feb 19, 2009 at 10:47 PM, Manlio Perillo wrote: > Johan Tibell ha scritto: >> I haven't given the WAI specification much attention since I first >> wrote it. Mostly because I'm caught up in thinking about enumerators >> and their role in e.g. an HTTP server implementation. > > Do you have any result? Yes and no. Hyena used to mix imperative and iteratee style code internally, making the code hard to work with and certain HTTP features hard to implement correctly. It now uses iteratees everywhere. This makes for a more robust and easily extensible implementation. To give you an example I had a hard time implementing pipelining using the old implementation. That should be much easier now. I still don't know iteratees place in the grand scheme of things. I don't even know what's a general, well performing and easily graspable definition would look like! In summary: I have *a* definition of iteratees that works. I just don't know if there's a better one. Cheers, Johan --===============0354869202821482543==-- From manlio_perillo@libero.it Fri Feb 20 08:43:39 2009 From: Manlio Perillo To: web-devel@haskell.org Subject: Re: [web-devel] [BUG] in WAI definition Date: Fri, 20 Feb 2009 14:54:07 +0100 Message-ID: <499EB5FF.60003@libero.it> In-Reply-To: <90889fe70902200503j46e0a089u83ae9a51847930ed@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7996261995711172856==" --===============7996261995711172856== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Johan Tibell ha scritto: > [...] > I still don't know iteratees place in the grand scheme of things. I > don't even know what's a general, well performing and easily graspable > definition would look like! > > In summary: I have *a* definition of iteratees that works. I just > don't know if there's a better one. > I'm not a theorist, so I'm ok with a definition that works :). Instead I'm interested in how code that operates on iteratees can be made reusable and integrated with other code (see ByteString and LazyByteString). The ByteString has a well defined implementation, and an useful set of operations defined. The same with LazyByteString, where we have some functions that allow us to generate a LazyByteString from a generic data structure. Is the same possible with iteratee? It is possible to "convert" a LazyByteString in a iteratee, efficiently? Thanks Manlio Perillo --===============7996261995711172856==-- From manlio_perillo@libero.it Fri Feb 20 09:06:30 2009 From: Manlio Perillo To: web-devel@haskell.org Subject: Re: [web-devel] [BUG] in WAI definition Date: Fri, 20 Feb 2009 15:17:09 +0100 Message-ID: <499EBB65.10206@libero.it> In-Reply-To: <90889fe70902191321v38da3e0cy468c0181af8c591f@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4188501909686116640==" --===============4188501909686116640== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Johan Tibell ha scritto: > Hi Manlio, >=20 > Thanks for reporting the bugs and sorry for the late reply. >=20 > On Sun, Feb 8, 2009 at 5:21 PM, Manlio Perillo w= rote: >> I'm trying to compile the example WAI application, as defined in >> http://www.haskell.org/haskellwiki/WebApplicationInterface >> >> However there are several bugs. >=20 > I haven't given the WAI specification much attention since I first > wrote it.=20 I have noted that there is a WAI module in your Hyena web application=20 server. http://github.com/tibbe/hyena I think that, instead, WAI should be defined in a separate package, that=20 should contain: 1) WAI specification 2) WAI data types (hyena.Network.Wai.hs) 3) Some utility functions (see Python wsgiref module) 4) Standard implementation for CGI Since Haskell is not Python, it is necessary that both gateways and=20 applpications use the same data types. Then, in separate packages, it is possible to implement support for=20 SCGI, FastCGI and a simple HTTP 1.0 server (a full HTTP 1.1 server is=20 not a priority, IMHO). IMHO, the WAI (or a separate) package should also contain support for=20 parsing HTTP headers (to be used my both servers, gateways and=20 applications). If there is a thing I hate, is when every project reinvent the wheel. One last note. I have some doubts about the name WAI. It means "Web application interface", but I think that the word=20 "Gateway" should appear in it. Something like: HSGI ("Haskell Server Gataway Interface", that can also be read as "HTTP=20 Server Gataway Interface"), or simply HGI ("Haskell Gateway Interface"). Manlio --===============4188501909686116640==-- From johan.tibell@gmail.com Sat Feb 21 06:13:10 2009 From: Johan Tibell To: web-devel@haskell.org Subject: Re: [web-devel] [BUG] in WAI definition Date: Sat, 21 Feb 2009 12:23:59 +0100 Message-ID: <90889fe70902210323w51758e66y79b1017c2e12b801@mail.gmail.com> In-Reply-To: <499EBB65.10206@libero.it> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8083914451710872175==" --===============8083914451710872175== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Fri, Feb 20, 2009 at 3:17 PM, Manlio Perillo wrote: > Johan Tibell ha scritto: > I have noted that there is a WAI module in your Hyena web application > server. > > http://github.com/tibbe/hyena > > > I think that, instead, WAI should be defined in a separate package, that > should contain: > > 1) WAI specification > 2) WAI data types (hyena.Network.Wai.hs) > 3) Some utility functions (see Python wsgiref module) > 4) Standard implementation for CGI I agree. This has been my plan all along. I put the definition in the same package as Hyena because I wanted to use Hyena to explore the API and it was more convenient to do so when all the files were in the same package. > One last note. > I have some doubts about the name WAI. > It means "Web application interface", but I think that the word "Gateway" > should appear in it. I don't have a strong attachment to the name. I'm not sure what the word "gateway" means in this context, probably because I haven't studied CGI in depth. > Something like: > HSGI ("Haskell Server Gataway Interface", that can also be read as "HTTP > Server Gataway Interface"), or simply HGI ("Haskell Gateway Interface"). These all sound like reasonable names. Cheers, Johan --===============8083914451710872175==-- From cjs@starling-software.com Sat Feb 21 06:49:45 2009 From: Curt Sampson To: web-devel@haskell.org Subject: [web-devel] CGI Date: Sat, 21 Feb 2009 21:00:33 +0900 Message-ID: <20090221120031.GO12990@lucky.cynic.net> In-Reply-To: <90889fe70902210323w51758e66y79b1017c2e12b801@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2488786193084174710==" --===============2488786193084174710== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 2009-02-21 12:23 +0100 (Sat), Johan Tibell wrote: > On Fri, Feb 20, 2009 at 3:17 PM, Manlio Perillo > wrote: > > > I have some doubts about the name WAI. It means "Web application > > interface", but I think that the word "Gateway" should appear in it. > > I don't have a strong attachment to the name. I'm not sure what the > word "gateway" means in this context, probably because I haven't > studied CGI in depth. It's fairly meaningless. CGI stands for "common gateway interface," and is basically: * a web server invoking another program, * with a specifically defined set of environment variables set to various values related to the request and the program's location in the filesystem, * communicating further information via sending it to the program's stdin, and * receiving a header and body response on the other end of the program's stdout, which it then may process before returning it to the HTTP client. There are some further tricks here: if you want to avoid having the server parse and possibly modify the header you send back, you should start your program's name with "nph-". It's generally not possible to reconstruct the original HTTP request that generated the CGI request because various things in the environment variables change based on the configuration of the server, which the client generally has no way of knowing. Even how the various bits of the request are converted to envrionment variables is not very well defined. All these issues translate to FastCGI and SCGI as well, with the addition that the the "programs" don't always have names, meaning that you can't prefix the name with "nph-" to avoid the headers in your response being parsed and modified. I've spent more time than I care to over the last four or five years dealing with FastCGI on the application (i.e., opposite of web server) side, both as a client of existing libraries and a writer of new ones, and it's caused me much pain. The one real advantage that FastCGI has is that it's supported across a lot of web servers, and some have some nice special features. For example, with lighttpd, you can avoid a lot of shoveling of data around by returning an "x-send-file: /some/path" header and no body; lighttpd will then efficently use sendfile or a similar system call to send that file across the network, avoiding a lot of interprocess I/O for large files. (We use this in our QWeb framework for our "docroot" servlet, which just serves files from disk, and also for servlets where we're sending the cached copy of previously generated content.) But overall, I'd be much happier with a protocol that just handed me the raw HTTP request, and allowed me to send back a raw HTTP response. The issue is, of course, getting the protocol implemented in various web servers. I could, I suppose, design a new protocol and write a C implementation for lighttpd. But then, given that I'd hope to be talking to a Haskell application server anyway, GHC has great support for building efficient, multiprocessing, highly concurrent servers, and Haskell is about a hundred times nicer to program in than C, I think I'd just write a high-performance web server in Haskell. (Except that it's already been done, anyway.) Oh, right, where does "gateway" come in? Nowhere, really. Perhaps the word came from someone steeped in the days of MS-DOS BBSs (I ran one myself in the early '90s), many of which had "doors," which were programs to which control would be handed from the BBS software, with the BBS software doing some tricks to take care of the I/O over the modem, a la RCP/M. (That stood for "Remote CP/M," a system so old that Wikipedia doesn't even have an entry for it.) cjs -- Curt Sampson +81 90 7737 2974 Functional programming in all senses of the word: http://www.starling-software.com --===============2488786193084174710==-- From manlio_perillo@libero.it Sat Feb 21 08:11:19 2009 From: Manlio Perillo To: web-devel@haskell.org Subject: [web-devel] Re: CGI Date: Sat, 21 Feb 2009 14:21:58 +0100 Message-ID: <499FFFF6.5070104@libero.it> In-Reply-To: <20090221120031.GO12990@lucky.cynic.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5857957452227562174==" --===============5857957452227562174== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Curt Sampson ha scritto: > On 2009-02-21 12:23 +0100 (Sat), Johan Tibell wrote: > >> On Fri, Feb 20, 2009 at 3:17 PM, Manlio Perillo >> wrote: >> >>> I have some doubts about the name WAI. It means "Web application >>> interface", but I think that the word "Gateway" should appear in it. >> I don't have a strong attachment to the name. I'm not sure what the >> word "gateway" means in this context, probably because I haven't >> studied CGI in depth. > > It's fairly meaningless. CGI stands for "common gateway interface," and > is basically: > A gateway is basically a program that sits between two other programs that speak different protocols. As an example, Mailman come with a gateway that allow the integration of Mailman with NNTP. > [...] > I've spent more time than I care to over the last four or five years > dealing with FastCGI on the application (i.e., opposite of web server) > side, both as a client of existing libraries and a writer of new > ones, and it's caused me much pain. > > The one real The only one, I would say. :) > advantage that FastCGI has is that it's supported across > a lot of web servers, and some have some nice special features. For > example, with lighttpd, you can avoid a lot of shoveling of data around > by returning an "x-send-file: /some/path" header and no body; This is not a FastCGI exclusive. > [...] > But overall, I'd be much happier with a protocol that just handed me > the raw HTTP request, and allowed me to send back a raw HTTP response. It already exists, and it is called HTTP. FastCGI is an "complex for nothing" protocol that translate a nice text based protocol to a complex binary protocol. SCGI is what you should use, if you don't want to write an HTTP (1.0) server. > The issue is, of course, getting the protocol implemented in various > web servers. I could, I suppose, design a new protocol and write a > C implementation for lighttpd. But then, given that I'd hope to be > talking to a Haskell application server anyway, GHC has great support > for building efficient, multiprocessing, highly concurrent servers, and > Haskell is about a hundred times nicer to program in than C, I think I'd > just write a high-performance web server in Haskell. (Except that it's > already been done, anyway.) > I, instead, think that Haskell is not yet mature for writing an high-performance web server. > [...] Manlio Perillo --===============5857957452227562174==-- From johan.tibell@gmail.com Wed Feb 25 16:56:40 2009 From: Johan Tibell To: web-devel@haskell.org Subject: [web-devel] Re: CGI Date: Wed, 25 Feb 2009 23:07:44 +0100 Message-ID: <90889fe70902251407k9497da8n399377162571fe06@mail.gmail.com> In-Reply-To: <20090221120031.GO12990@lucky.cynic.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0707383102917040469==" --===============0707383102917040469== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Thanks for the explanation Curt! On Sat, Feb 21, 2009 at 1:00 PM, Curt Sampson wro= te: > But overall, I'd be much happier with a protocol that just handed me > the raw HTTP request, and allowed me to send back a raw HTTP response. > The issue is, of course, getting the protocol implemented in various > web servers. I could, I suppose, design a new protocol and write a > C implementation for lighttpd. But then, given that I'd hope to be > talking to a Haskell application server anyway, GHC has great support > for building efficient, multiprocessing, highly concurrent servers, and > Haskell is about a hundred times nicer to program in than C, I think I'd > just write a high-performance web server in Haskell. (Except that it's > already been done, anyway.) I'm currently experimenting with such an HTTP request data type in the context of Hyena, my web application server. I'll post a message to this list once I have something to share. Cheers, Johan --===============0707383102917040469==-- From cjs@starling-software.com Wed Feb 25 18:40:43 2009 From: Curt Sampson To: web-devel@haskell.org Subject: [web-devel] Re: CGI Date: Thu, 26 Feb 2009 08:51:44 +0900 Message-ID: <20090225235141.GA14330@critic.cynic.net> In-Reply-To: <90889fe70902251407k9497da8n399377162571fe06@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1044780911066754454==" --===============1044780911066754454== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 2009-02-25 23:07 +0100 (Wed), Johan Tibell wrote: > Thanks for the explanation Curt! You're very welcome. It's nice to know that my pain over the last few years can help others, too. :-) > I'm currently experimenting with such an HTTP request data type in the > context of Hyena, my web application server. I'll post a message to > this list once I have something to share. Great. I'd love to comment on it. cjs -- Curt Sampson +81 90 7737 2974 Functional programming in all senses of the word: http://www.starling-software.com --===============1044780911066754454==-- From lemming@henning-thielemann.de Fri Feb 27 17:35:13 2009 From: Henning Thielemann To: web-devel@haskell.org Subject: [web-devel] Re: [Haskell-cafe] Samples for http package Date: Fri, 27 Feb 2009 23:46:22 +0100 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6664708388284283119==" --===============6664708388284283119== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Fri, 27 Feb 2009, G=C3=BC?nther Schmidt wrote: > are there any examples on how to use the current version of the http packag= e? test/get.hs --===============6664708388284283119==-- From lemming@henning-thielemann.de Fri Mar 27 21:00:47 2009 From: Henning Thielemann To: web-devel@haskell.org Subject: [web-devel] Haxr doesn't compile from cabal (HTTP > 4000 breaks it) Date: Sat, 28 Mar 2009 02:13:25 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5512799913257655563==" --===============5512799913257655563== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Most breakage caused by new HTTP package is due to the renaming from Response to Response_String and Request to Request_String. I think it was not a good idea to do that. There could have well be two types named Response from different modules, one with a type parameter and the other one without. Or the parametrized variant could have be named ResponseGeneric or so. That would have allowed packages to work both with version 3001 and 4000. --===============5512799913257655563==-- From gour@gour-nitai.com Sun Mar 14 01:49:36 2010 From: Gour To: web-devel@haskell.org Subject: [web-devel] consolidating Haskell's web-framework scene Date: Sun, 14 Mar 2010 08:11:22 +0100 Message-ID: <20100314081122.6af9ddc9@gaura-nitai.no-ip.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1594131701948334034==" --===============1594131701948334034== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hello! I'm (still) Haskell noob learning the language with the help of RWH book and plan to write desktop GUI app (probably with qthaskell). However, there is also need to put together some web sites and I'd be very happy to use Haskell instead of tinkering with Python/Django. You know, once when you get even a small taste for Haskell it's hard to 'go back'. :-) Although it might be great framework, I'll be frank to say that Happstack with all technology that goes along is something which is either too complicated for me, not practical to be run on shared hosting (e.g. Webfaction), not documented properly and it belongs to 'noSQL' which is not for me at the moment. That's why I'm interested to discuss possibility to somehow consolidate Haskell's web frameworks nad provide something which is good for practical development, does not require VPS to be used, nice documentation etc. If we take a look in the Python's neigbourhood, we think something like Django although knowing well that it is quite big community, with lot of docs, books, apps etc., so it's maybe not the best example. However, Alson's yesterday post about leaving Haskell and (probably) leaving Turbinado abandoned (http://www.alsonkemp.com/haskell/reflections-on-leaving-haskell/) made me think to write this post. >From his post it is obvious that he faced some walls during his devlopment which he could not overcome. I'm sad that the Turbinado was not more open so that someone can jump in and offer suggestions. Otoh, it was also not documented - docs were promised for quite some time, but nothing happened. Otherwise, the project had some nice objectives...so, let's learn the lessons. Some time ago, Michael posted about Yesod and I read about WAI initiative. He is very responsive and I've already exchanged several emails with him, but being noob for web-development in Haskell I want to learn more and help, according to my skills, that Haskell gets one decent & practical web-framework. The Haskell language itself was created to consolidate fragmented market of different FP languages. Are we ready to follow our 'ancestors' and in their spirit do the same when it comes to web-framework(s)? * Is it WAI & Yesod good start? What the others think? Any further reference you can provide for someone to learn more about web-programming in Haskell? (RWH is not very extensive here.) * I said frameworks because it seems that Happs is in its own category and if you read the comments in the above referenced URL, you'll see that often Happs is labeled as too complex. Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- --===============1594131701948334034== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuNC4xMCAoR05V L0xpbnV4KQoKaUVZRUFSRUNBQVlGQWt1Y2pCb0FDZ2tRVThlRThmbHY5ZlliNEFDZ2dDMEdMMjls NlF4Y2wwYlFuMlg3WUJvZgpqTEFBbjFHNTlZN1JnMFdyZ0lod3NYUTZLNFlvcTVsMgo9dThUTAot LS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============1594131701948334034==-- From cjs@starling-software.com Sun Mar 14 05:40:04 2010 From: Curt Sampson To: web-devel@haskell.org Subject: Re: [web-devel] consolidating Haskell's web-framework scene Date: Sun, 14 Mar 2010 19:10:34 +0900 Message-ID: <20100314101033.GG8643@analytic.cynic.net> In-Reply-To: <20100314081122.6af9ddc9@gaura-nitai.no-ip.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5381804337021155388==" --===============5381804337021155388== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 2010-03-14 08:11 +0100 (Sun), Gour wrote: > From his post it is obvious that he faced some walls during his > devlopment which he could not overcome. I'm sad that the Turbinado was > not more open so that someone can jump in and offer suggestions. It seems that it's open now, since it's on GitHub. That said, I don't think it's a good starting point due to the design decisions; I commented on this extensively (to the tune of about a thousand words) in a comment I posted to his blog entry, though that comment has yet to appear. cjs -- Curt Sampson +81 90 7737 2974 http://www.starling-software.com The power of accurate observation is commonly called cynicism by those who have not got it. --George Bernard Shaw --===============5381804337021155388==-- From michael@snoyman.com Sun Mar 14 11:04:32 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: [web-devel] Re: consolidating Haskell's web-framework scene Date: Sun, 14 Mar 2010 08:35:03 -0700 Message-ID: <29bf512f1003140835n4d007532q734e5183f0c2ce20@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2581619472275460765==" --===============2581619472275460765== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit I was planning on writing a blog post called "call to arms," which would have been something similar to what you said. I agree that there is far too much fragmentation in the community; I debated starting Yesod at all when there were already a number of frameworks out there (Happs, KIbro, Turbinado). However, none of them hit the spot that I was aiming for, so I created it. At the same time, Jinjing came out with Hack, and I tried to go with that. Unfortunately, there are some inherent flaws with Hack (you can review the Hack-discuss mailing list to see some discussions over there), so I started WAI. So it would seem that so far, I've done more fragmentation than consolidation :(. On the other hard, the other frameworks having had much development, Yesod is still active, and it looks like Happstack will be joining WAI, so not all is lost. I am very interested in trying to continue consolidation, but I think aiming for the One True Haskell Framework is a bad idea. Python- the community known for One Way To Do It- can't even consolidate around a single framework, so Haskell- the language of We Can All Write A Monad Transformers Library- doesn't stand a chance. So where can we consolidate? On libraries. I have purposely released a number of the components of Yesod as separate libraries that are available to any framework author (or even someone *not* using a framework). Here are some in particular to look at: wai wai-extra web-encodings clientsession authenticate data-object, data-object-json and data-object-yaml failure and control-monad-failure hack-handler-webkit Some of these packages have very obvious room for future development, and if someone (like Gour) is looking for somewhere to start contributing to the Haskell web community, I would recommend one of the following: authenticate currently supports OpenId 1 and RPXnow. I would like to have authenticate itself support *all* sites that RPXnow does. The first step in that process would be to get authenticate to use the openid package and determine whether a server support openid 1 or 2. From there, Twitter, Facebook, Windows Live support would all be nice. hack-handler-webkit is, IMO, a really cool idea. It allows you to convert any Hack application into a desktop app. It runs simpleserver and then opens up a Webkit window that connects to it. This is much better than simply running the simpleserver and then opening up a webbrowser, because: 1) The program terminates automatically when the web browser closes. 2) You can control menu bars, title bar, etc completely, making it *feel* like a desktop app. 3) You can ensure that all of the functionality you want is present in webkit. Unfortunately, hack-handler-webkit has two problems: 1) It's written for hack instead of WAI. However, this should take all of 5 minutes to fix. 2) It only works on Linux, and even there I don't have any documentation on setting it up. Yesod is still missing a model layer. This is a project that I will most likely be doing myself, since it will need to be designed to integrate very closely with Yesod, but I'll mention some of the design ideas here. (By the way, Chris Eidhof has a package on Github called Basil which looks very interesting here.) 1) I want to use YAML quasi-quoting to define the models. 2) I don't want a super-complex "object relational mapping"; Haskell is already much closer to the relational level than an OO language. 3) Utilize IO thunks (ie, lazy IO loading) so that we don't need to load everything into memory at the beginning. 4) Not tied down to SQL *or* in-memory databases. It should support both of those, but *also* support a system that is usable even in a CGI setup. I'm contemplating now a database that uses multiple directories/files and uses append-only to avoid concurrency issues. Compile-time checking of templates would be great. The Bravo package looks interesting, but I'm a little dubious about the approach used. I think something based on typeclasses might be a bit more nimble. Once again, tight integration with the model system I theoretically design would be nice. So, in summary of a much-too-long e-mail, let's not bother trying to get everyone to agree on One Framework. Happs has its place, Yesod has its place, and I know others are using Loli and probably Kibro. (I'm not sure if anyone every got started with Turbinado.) However, we can raise the bar for *all* packages simultaneously by making a more solid ecosystem of Haskell web packages available that any framework can cherry-pick from. Michael --===============2581619472275460765== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SSB3YXMgcGxhbm5pbmcgb24gd3JpdGluZyBhIGJsb2cgcG9zdCBjYWxsZWQgJnF1b3Q7Y2FsbCB0 byBhcm1zLCZxdW90OyB3aGljaCB3b3VsZCBoYXZlIGJlZW4gc29tZXRoaW5nIHNpbWlsYXIgdG8g d2hhdCB5b3Ugc2FpZC4gSSBhZ3JlZSB0aGF0IHRoZXJlIGlzIGZhciB0b28gbXVjaCBmcmFnbWVu dGF0aW9uIGluIHRoZSBjb21tdW5pdHk7IEkgZGViYXRlZCBzdGFydGluZyBZZXNvZCBhdCBhbGwg d2hlbiB0aGVyZSB3ZXJlIGFscmVhZHkgYSBudW1iZXIgb2YgZnJhbWV3b3JrcyBvdXQgdGhlcmUg KEhhcHBzLCBLSWJybywgVHVyYmluYWRvKS4gSG93ZXZlciwgbm9uZSBvZiB0aGVtIGhpdCB0aGUg c3BvdCB0aGF0IEkgd2FzIGFpbWluZyBmb3IsIHNvIEkgY3JlYXRlZCBpdC48ZGl2Pgo8YnI+PC9k aXY+PGRpdj5BdCB0aGUgc2FtZSB0aW1lLCBKaW5qaW5nIGNhbWUgb3V0IHdpdGggSGFjaywgYW5k IEkgdHJpZWQgdG8gZ28gd2l0aCB0aGF0LiBVbmZvcnR1bmF0ZWx5LCB0aGVyZSBhcmUgc29tZSBp bmhlcmVudCBmbGF3cyB3aXRoIEhhY2sgKHlvdSBjYW4gcmV2aWV3IHRoZSBIYW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dXQgdGhlIGFwcHJvYWNoIHVzZWQuIEkgdGhpbmsgc29tZXRoaW5nIGJhc2VkIG9uIHR5cGVj bGFzc2VzIG1pZ2h0IGJlIGEgYml0IG1vcmUgbmltYmxlLiBPbmNlIGFnYWluLCB0aWdodCBpbnRl Z3JhdGlvbiB3aXRoIHRoZSBtb2RlbCBzeXN0ZW0gSSB0aGVvcmV0aWNhbGx5IGRlc2lnbiB3b3Vs ZCBiZSBuaWNlLjwvZGl2Pgo8ZGl2Pjxicj48L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PlNvLCBp biBzdW1tYXJ5IG9mIGEgbXVjaC10b28tbG9uZyBlLW1haWwsIGxldCYjMzk7cyBub3QgYm90aGVy IHRyeWluZyB0byBnZXQgZXZlcnlvbmUgdG8gYWdyZWUgb24gT25lIEZyYW1ld29yay4gSGFwcHMg aGFzIGl0cyBwbGFjZSwgWWVzb2QgaGFzIGl0cyBwbGFjZSwgYW5kIEkga25vdyBvdGhlcnMgYXJl IHVzaW5nIExvbGkgYW5kIHByb2JhYmx5IEtpYnJvLiAoSSYjMzk7bSBub3Qgc3VyZSBpZiBhbnlv bmUgZXZlcnkgZ290IHN0YXJ0ZWQgd2l0aCBUdXJiaW5hZG8uKSBIb3dldmVyLCB3ZSBjYW4gcmFp c2UgdGhlIGJhciBmb3IgKmFsbCogcGFja2FnZXMgc2ltdWx0YW5lb3VzbHkgYnkgbWFraW5nIGEg bW9yZSBzb2xpZCBlY29zeXN0ZW0gb2YgSGFza2VsbCB3ZWIgcGFja2FnZXMgYXZhaWxhYmxlIHRo YXQgYW55IGZyYW1ld29yayBjYW4gY2hlcnJ5LXBpY2sgZnJvbS48L2Rpdj4KPGRpdj48YnI+PC9k aXY+PGRpdj5NaWNoYWVsPC9kaXY+Cg== --===============2581619472275460765==-- From michael@snoyman.com Sun Mar 14 11:35:37 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: [web-devel] Re: consolidating Haskell's web-framework scene Date: Sun, 14 Mar 2010 09:06:07 -0700 Message-ID: <29bf512f1003140906m40ba829br64283fa6e4e351e5@mail.gmail.com> In-Reply-To: <29bf512f1003140835n4d007532q734e5183f0c2ce20@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0735810498126136915==" --===============0735810498126136915== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sorry, my other message is being held for review because it was more than 5kb, but I came up with two other ideas of projects to work on: The Gzip middleware in wai-extra is currently a bit of a hack since it converts the Enumerator response body to a lazy bytestring. It would be nice if there were a gzip compression library that consumed and produced Enumerators instead of lazy bytestrings. Another relatively simple task would be porting hack-handler-fastcgi to use WAI. The hack library is just built on top of hack-handler-cgi, so simply dropping in wai-extra and the Network.Wai.Handler.CGI module should be all it takes. Michael --===============0735810498126136915== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 U29ycnksIG15IG90aGVyIG1lc3NhZ2UgaXMgYmVpbmcgaGVsZCBmb3IgcmV2aWV3IGJlY2F1c2Ug aXQgd2FzIG1vcmUgdGhhbiA1a2IsIGJ1dCBJIGNhbWUgdXAgd2l0aCB0d28gb3RoZXIgaWRlYXMg b2YgcHJvamVjdHMgdG8gd29yayBvbjo8ZGl2Pjxicj48L2Rpdj48ZGl2PlRoZSBHemlwIG1pZGRs ZXdhcmUgaW4gd2FpLWV4dHJhIGlzIGN1cnJlbnRseSBhIGJpdCBvZiBhIGhhY2sgc2luY2UgaXQg Y29udmVydHMgdGhlIEVudW1lcmF0b3IgcmVzcG9uc2UgYm9keSB0byBhIGxhenkgYnl0ZXN0cmlu Zy4gSXQgd291bGQgYmUgbmljZSBpZiB0aGVyZSB3ZXJlIGEgZ3ppcCBjb21wcmVzc2lvbiBsaWJy YXJ5IHRoYXQgY29uc3VtZWQgYW5kIHByb2R1Y2VkIEVudW1lcmF0b3JzIGluc3RlYWQgb2YgbGF6 eSBieXRlc3RyaW5ncy48L2Rpdj4KPGRpdj48YnI+PC9kaXY+PGRpdj5Bbm90aGVyIHJlbGF0aXZl bHkgc2ltcGxlIHRhc2sgd291bGQgYmUgcG9ydGluZyBoYWNrLWhhbmRsZXItZmFzdGNnaSB0byB1 c2UgV0FJLiBUaGUgaGFjayBsaWJyYXJ5IGlzIGp1c3QgYnVpbHQgb24gdG9wIG9mIGhhY2staGFu ZGxlci1jZ2ksIHNvIHNpbXBseSBkcm9wcGluZyBpbiB3YWktZXh0cmEgYW5kIHRoZSBOZXR3b3Jr LldhaS5IYW5kbGVyLkNHSSBtb2R1bGUgc2hvdWxkIGJlIGFsbCBpdCB0YWtlcy48L2Rpdj4KPGRp dj48YnI+PC9kaXY+PGRpdj5NaWNoYWVsPC9kaXY+Cg== --===============0735810498126136915==-- From gour@gour-nitai.com Sun Mar 14 12:38:17 2010 From: Gour To: web-devel@haskell.org Subject: [web-devel] Re: consolidating Haskell's web-framework scene Date: Sun, 14 Mar 2010 18:09:57 +0100 Message-ID: <20100314180957.182abed5@gaura-nitai.no-ip.org> In-Reply-To: <20100314101033.GG8643@analytic.cynic.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6432372121710736416==" --===============6432372121710736416== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Sun, 14 Mar 2010 19:10:34 +0900 >>>>>> "Curt" == Curt Sampson wrote: Curt> It seems that it's open now, since it's on GitHub. That said, I Curt> don't think it's a good starting point due to the design Curt> decisions; I commented on this extensively (to the tune of about Curt> a thousand words) in a comment I posted to his blog entry, though Curt> that comment has yet to appear. Interesting post - it just appeared on his blog. I am not thinking that Turbinado is good starting point, but maybe Yesod is a better one? Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- --===============6432372121710736416== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuNC4xMCAoR05V L0xpbnV4KQoKaUVZRUFSRUNBQVlGQWt1ZEdHVUFDZ2tRVThlRThmbHY5ZlpYbUFDZEZUMXNXT1JW L2R2VERNaWJlVjdtRCthZgoxQlVBb0xDNkJQeCtnOFNiZU9Cc3hHUTl4cTRMMFN5aAo9VVN2cAot LS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============6432372121710736416==-- From michael@snoyman.com Mon Mar 15 10:40:01 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Re: consolidating Haskell's web-framework scene Date: Mon, 15 Mar 2010 08:10:35 -0700 Message-ID: <29bf512f1003150810r5e02168eg5bf571a414fbbf0e@mail.gmail.com> In-Reply-To: <20100314180957.182abed5@gaura-nitai.no-ip.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7564872920735649526==" --===============7564872920735649526== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Alright, so web-devel doesn't seem interested in moderating my message, so I'll just break it up into two chunks: I was planning on writing a blog post called "call to arms," which would have been something similar to what you said. I agree that there is far too much fragmentation in the community; I debated starting Yesod at all when there were already a number of frameworks out there (Happs, KIbro, Turbinado). However, none of them hit the spot that I was aiming for, so I created it. At the same time, Jinjing came out with Hack, and I tried to go with that. Unfortunately, there are some inherent flaws with Hack (you can review the Hack-discuss mailing list to see some discussions over there), so I started WAI. So it would seem that so far, I've done more fragmentation than consolidation :(. On the other hard, the other frameworks having had much development, Yesod is still active, and it looks like Happstack will be joining WAI, so not all is lost. I am very interested in trying to continue consolidation, but I think aiming for the One True Haskell Framework is a bad idea. Python- the community known for One Way To Do It- can't even consolidate around a single framework, so Haskell- the language of We Can All Write A Monad Transformers Library- doesn't stand a chance. So where can we consolidate? On libraries. I have purposely released a number of the components of Yesod as separate libraries that are available to any framework author (or even someone *not* using a framework). Here are some in particular to look at: wai wai-extra web-encodings clientsession authenticate data-object, data-object-json and data-object-yaml failure and control-monad-failure hack-handler-webkit Some of these packages have very obvious room for future development, and if someone (like Gour) is looking for somewhere to start contributing to the Haskell web community, I would recommend one of the following: authenticate currently supports OpenId 1 and RPXnow. I would like to have authenticate itself support *all* sites that RPXnow does. The first step in that process would be to get authenticate to use the openid package and determine whether a server support openid 1 or 2. From there, Twitter, Facebook, Windows Live support would all be nice. hack-handler-webkit is, IMO, a really cool idea. It allows you to convert any Hack application into a desktop app. It runs simpleserver and then opens up a Webkit window that connects to it. This is much better than simply running the simpleserver and then opening up a webbrowser, because: 1) The program terminates automatically when the web browser closes. 2) You can control menu bars, title bar, etc completely, making it *feel* like a desktop app. 3) You can ensure that all of the functionality you want is present in webkit. Unfortunately, hack-handler-webkit has two problems: 1) It's written for hack instead of WAI. However, this should take all of 5 minutes to fix. 2) It only works on Linux, and even there I don't have any documentation on setting it up. --===============7564872920735649526== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 QWxyaWdodCwgc28gd2ViLWRldmVsIGRvZXNuJiMzOTt0IHNlZW0gaW50ZXJlc3RlZCBpbiBtb2Rl cmF0aW5nIG15IG1lc3NhZ2UsIHNvIEkmIzM5O2xsIGp1c3QgYnJlYWsgaXQgdXAgaW50byB0d28g Y2h1bmtzOjxkaXY+PGJyPjwvZGl2PjxkaXY+PGRpdj5JIHdhcyBwbGFubmluZyBvbiB3cml0aW5n IGEgYmxvZyBwb3N0IGNhbGxlZCAmcXVvdDtjYWxsIHRvIGFybXMsJnF1b3Q7IHdoaWNoIHdvdWxk IGhhdmUgYmVlbiBzb21ldGhpbmcgc2ltaWxhciB0byB3aGF0IHlvdSBzYWlkLiBJIGFncmVlIHRo YXQgdGhlcmUgaXMgZmFyIHRvbyBtdWNoIGZyYWdtZW50YXRpb24gaW4gdGhlIGNvbW11bml0eTsg SSBkZWJhdGVkIHN0YXJ0aW5nIFllc29kIGF0IGFsbCB3aGVuIHRoZXJlIHdlcmUgYWxyZWFkeSBh IG51bWJlciBvZiBmcmFtZ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FRoaXMg aXMgbXVjaCBiZXR0ZXIgdGhhbiBzaW1wbHkgcnVubmluZyB0aGUgc2ltcGxlc2VydmVyIGFuZCB0 aGVuIG9wZW5pbmcgdXAgYSB3ZWJicm93c2VyLCBiZWNhdXNlOjwvZGl2Pgo8ZGl2Pjxicj48L2Rp dj48ZGl2PjEpIFRoZSBwcm9ncmFtIHRlcm1pbmF0ZXMgYXV0b21hdGljYWxseSB3aGVuIHRoZSB3 ZWIgYnJvd3NlciBjbG9zZXMuPC9kaXY+PGRpdj4yKSBZb3UgY2FuIGNvbnRyb2wgbWVudSBiYXJz LCB0aXRsZSBiYXIsIGV0YyBjb21wbGV0ZWx5LCBtYWtpbmcgaXQgKmZlZWwqIGxpa2UgYSBkZXNr dG9wIGFwcC48L2Rpdj48ZGl2PjMpIFlvdSBjYW4gZW5zdXJlIHRoYXQgYWxsIG9mIHRoZSBmdW5j dGlvbmFsaXR5IHlvdSB3YW50IGlzIHByZXNlbnQgaW4gd2Via2l0LjwvZGl2Pgo8ZGl2Pjxicj48 L2Rpdj48ZGl2PlVuZm9ydHVuYXRlbHksIGhhY2staGFuZGxlci13ZWJraXQgaGFzIHR3byBwcm9i bGVtczo8L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PjEpIEl0JiMzOTtzIHdyaXR0ZW4gZm9yIGhh Y2sgaW5zdGVhZCBvZiBXQUkuIEhvd2V2ZXIsIHRoaXMgc2hvdWxkIHRha2UgYWxsIG9mIDUgbWlu dXRlcyB0byBmaXguPC9kaXY+PGRpdj4yKSBJdCBvbmx5IHdvcmtzIG9uIExpbnV4LCBhbmQgZXZl biB0aGVyZSBJIGRvbiYjMzk7dCBoYXZlIGFueSBkb2N1bWVudGF0aW9uIG9uIHNldHRpbmcgaXQg dXAuPC9kaXY+CjwvZGl2Pgo= --===============7564872920735649526==-- From michael@snoyman.com Mon Mar 15 10:40:41 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Re: consolidating Haskell's web-framework scene Date: Mon, 15 Mar 2010 08:11:14 -0700 Message-ID: <29bf512f1003150811p3f03e54ic9d4e714c4305e09@mail.gmail.com> In-Reply-To: <20100314180957.182abed5@gaura-nitai.no-ip.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0082604302631807383==" --===============0082604302631807383== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit And part 2: Yesod is still missing a model layer. This is a project that I will most likely be doing myself, since it will need to be designed to integrate very closely with Yesod, but I'll mention some of the design ideas here. (By the way, Chris Eidhof has a package on Github called Basil which looks very interesting here.) 1) I want to use YAML quasi-quoting to define the models. 2) I don't want a super-complex "object relational mapping"; Haskell is already much closer to the relational level than an OO language. 3) Utilize IO thunks (ie, lazy IO loading) so that we don't need to load everything into memory at the beginning. 4) Not tied down to SQL *or* in-memory databases. It should support both of those, but *also* support a system that is usable even in a CGI setup. I'm contemplating now a database that uses multiple directories/files and uses append-only to avoid concurrency issues. Compile-time checking of templates would be great. The Bravo package looks interesting, but I'm a little dubious about the approach used. I think something based on typeclasses might be a bit more nimble. Once again, tight integration with the model system I theoretically design would be nice. So, in summary of a much-too-long e-mail, let's not bother trying to get everyone to agree on One Framework. Happs has its place, Yesod has its place, and I know others are using Loli and probably Kibro. (I'm not sure if anyone every got started with Turbinado.) However, we can raise the bar for *all* packages simultaneously by making a more solid ecosystem of Haskell web packages available that any framework can cherry-pick from. --===============0082604302631807383== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 QW5kIHBhcnQgMjo8ZGl2Pjxicj48L2Rpdj48ZGl2PjxkaXY+WWVzb2QgaXMgc3RpbGwgbWlzc2lu ZyBhIG1vZGVsIGxheWVyLiBUaGlzIGlzIGEgcHJvamVjdCB0aGF0IEkgd2lsbCBtb3N0IGxpa2Vs eSBiZSBkb2luZyBteXNlbGYsIHNpbmNlIGl0IHdpbGwgbmVlZCB0byBiZSBkZXNpZ25lZCB0byBp bnRlZ3JhdG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5c3RlbSBvZiBIYXNr ZWxsIHdlYiBwYWNrYWdlcyBhdmFpbGFibGUgdGhhdCBhbnkgZnJhbWV3b3JrIGNhbiBjaGVycnkt cGljayBmcm9tLjwvZGl2Pgo8L2Rpdj4K --===============0082604302631807383==-- From rumata-estor@nm.ru Mon Mar 15 11:36:33 2010 From: Dmitry Belayev To: web-devel@haskell.org Subject: Re: [web-devel] Re: consolidating Haskell's web-framework scene Date: Mon, 15 Mar 2010 19:07:07 +0300 Message-ID: <4B9E5B2B.6070801@nm.ru> In-Reply-To: <29bf512f1003150811p3f03e54ic9d4e714c4305e09@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2335981257428170594==" --===============2335981257428170594== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Compile-type checking can be very helpful and it is Haskell's strong side. But what about hot code swapping? In working web application it is often convenient to update some part of application without disturbing connected users. It's strong side of Erlang, but what about Haskell? Michael Snoyman wrote: > And part 2: > > Yesod is still missing a model layer. This is a project that I will > most likely be doing myself, since it will need to be designed to > integrate very closely with Yesod, but I'll mention some of the design > ideas here. (By the way, Chris Eidhof has a package on Github called > Basil which looks very interesting here.) > > 1) I want to use YAML quasi-quoting to define the models. > 2) I don't want a super-complex "object relational mapping"; Haskell > is already much closer to the relational level than an OO language. > 3) Utilize IO thunks (ie, lazy IO loading) so that we don't need to > load everything into memory at the beginning. > 4) Not tied down to SQL *or* in-memory databases. It should support > both of those, but *also* support a system that is usable even in a > CGI setup. I'm contemplating now a database that uses multiple > directories/files and uses append-only to avoid concurrency issues. > > > Compile-time checking of templates would be great. The Bravo package > looks interesting, but I'm a little dubious about the approach used. I > think something based on typeclasses might be a bit more nimble. Once > again, tight integration with the model system I theoretically design > would be nice. > > > So, in summary of a much-too-long e-mail, let's not bother trying to > get everyone to agree on One Framework. Happs has its place, Yesod has > its place, and I know others are using Loli and probably Kibro. (I'm > not sure if anyone every got started with Turbinado.) However, we can > raise the bar for *all* packages simultaneously by making a more solid > ecosystem of Haskell web packages available that any framework can > cherry-pick from. > ------------------------------------------------------------------------ > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > --===============2335981257428170594==-- From chris@eidhof.nl Mon Mar 15 12:02:38 2010 From: Chris Eidhof To: web-devel@haskell.org Subject: [web-devel] A separation of concerns Date: Mon, 15 Mar 2010 17:33:10 +0100 Message-ID: <7A24642C-D3FF-481E-9B0B-204C5F85DF01@eidhof.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0911146779137011576==" --===============0911146779137011576== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi everyone, I don't believe that there could be one big framework for everybody. Some peo= ple want good HTML abstractions, others only think of the server as data stor= age. Some people want RESTful URLs, other people don't care about RESTfulness= but would benefit heavily from controller abstractions. For certain applicat= ions SQL might be perfect and for others the Happstack-State works great. My point is: we should not try to build one big framework. Instead, I propose= that we build a set of smaller libraries that each do one thing very well. S= ome of these libraries might be designed to work together. I personally think MVC is a perfect fit for the web: model code handles data = storage, view code handles HTML/JSON/XML and the controller coordinates betwe= en these. Instead of building packages that do all of these things, I would l= ike to see model packages, view packages and controller packages. That way we= can achieve maximum reusability and a good separation of concerns. What do you think of this? -chris --===============0911146779137011576==-- From michael@snoyman.com Mon Mar 15 12:22:12 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Re: consolidating Haskell's web-framework scene Date: Mon, 15 Mar 2010 09:52:46 -0700 Message-ID: <29bf512f1003150952q3e7b2172jfac674519929b9fd@mail.gmail.com> In-Reply-To: <4B9E5B2B.6070801@nm.ru> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3961449440014065962==" --===============3961449440014065962== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 15, 2010 at 9:07 AM, Dmitry Belayev wrote: > Compile-type checking can be very helpful and it is Haskell's strong side. > > But what about hot code swapping? In working web application it is often > convenient to update some part of application without disturbing connected > users. It's strong side of Erlang, but what about Haskell? > > That's definitely a good point. My current deployment uses lighttpd/CGI to server the application, along with a development system running on 3000. Here's my workflow: 1) Develop on local system using simple-server. 2) Push changes to development system. Who cares about a little downtime there. 3) When everything works, pull changes into the production repo. 4) Compile everything with -Wall -Werror. 5) Copy templates, static files and CGI binary in one fell swoop to the production directory. So this is really a solution outside of Haskell. I believe Turbinado used some features for dynamically compiling code, but I prefer this kind of approach in general. If I was during a standalone server approach, one possibility for production deployment might be: 1) Run the production server on port 3001 (or anything else). Set up iptables to forward port 80 to port 3001. (I do this already). 2) When I want to make a production change, start a *new* production server on port 3002. 3) Adjust iptables to port forward to 3002. 4) Next time around, switch back to 3001. For the record, I think iptables forwarding is probably the safest way to run an application on a privileged port. Michael Snoyman wrote: > >> And part 2: >> >> Yesod is still missing a model layer. This is a project that I will most >> likely be doing myself, since it will need to be designed to integrate very >> closely with Yesod, but I'll mention some of the design ideas here. (By the >> way, Chris Eidhof has a package on Github called Basil which looks very >> interesting here.) >> >> 1) I want to use YAML quasi-quoting to define the models. >> 2) I don't want a super-complex "object relational mapping"; Haskell is >> already much closer to the relational level than an OO language. >> 3) Utilize IO thunks (ie, lazy IO loading) so that we don't need to load >> everything into memory at the beginning. >> 4) Not tied down to SQL *or* in-memory databases. It should support both >> of those, but *also* support a system that is usable even in a CGI setup. >> I'm contemplating now a database that uses multiple directories/files and >> uses append-only to avoid concurrency issues. >> >> >> Compile-time checking of templates would be great. The Bravo package looks >> interesting, but I'm a little dubious about the approach used. I think >> something based on typeclasses might be a bit more nimble. Once again, tig= ht >> integration with the model system I theoretically design would be nice. >> >> >> So, in summary of a much-too-long e-mail, let's not bother trying to get >> everyone to agree on One Framework. Happs has its place, Yesod has its >> place, and I know others are using Loli and probably Kibro. (I'm not sure = if >> anyone every got started with Turbinado.) However, we can raise the bar for >> *all* packages simultaneously by making a more solid ecosystem of Haskell >> web packages available that any framework can cherry-pick from. >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> web-devel mailing list >> web-devel@haskell.org >> http://www.haskell.org/mailman/listinfo/web-devel >> >> > > --===============3961449440014065962== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxkaXYgY2xhc3M9ImdtYWlsX3F1b3RlIj5PbiBNb24sIE1hciAxNSwgMjAxMCBhdCA5OjA3 IEFNLCBEbWl0cnkgQmVsYXlldiA8c3BhbiBkaXI9Imx0ciI+Jmx0OzxhIGhyZWY9Im1haWx0bzpy dW1hdGEtZXN0b3JAbm0ucnUiPnJ1bWF0YS1lc3RvckBubS5ydTwvYT4mZ3Q7PC9zcGFuPiB3cm90 ZTo8YnI+PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0ibWFyZ2luOjAgMCAw IC44ZXg7Ym9yZGVyLWxlZnQ6MXB4ICNjY2Mgc29saWQ7cGFkZGluZy1sZWZ0OjFleDsiPgpDb21w aWxlLXR5cGUgY2hlY2tpbmcgY2FuIGJlIHZlcnkgaGVscGZ1bCBhbmQgaXQgaXMgSGFza2VsbCYj Mzk7cyBzdHJvbmcgc2lkZS48YnI+Cjxicj4KQnV0IHdoYXQgYWJvdXQgaG90IGNvZGUgc3dhcHBp bmc/IEluIHdvcmtpbmcgd2ViIGFwcGxpY2F0aW9uIGl0IGlzIG9mdGVuIGNvbnZlbmllbnQgdG8g dXBkYXRlIHNvbWUgcGFydCBvZiBhcHBsaWNhdGlvbiB3aXRob3V0IGRpc3R1cmJpbmcgY29ubmVj dGVkIHVzZXJzLiBJdCYjMzk7cyBzdHJvbmcgc2lkZSBvZiBFcmxhbmcsIGJ1dCB3aGF0IGFib3V0 IEhhc2tlbGw/PGJyPgo8YnI+PC9ibG9ja3F1b3RlPjxkaXY+PGJyPjwvZGl2PjxkaXY+VGhhdCYj Mzk7cyBkZWZpbml0ZWx5IGEgZ29vZCBwb2ludC4gTXkgY3VycmVudCBkZXBsb3ltZW50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uZSBldmVyeSBnb3Qgc3RhcnRlZCB3aXRoIFR1cmJpbmFkby4pIEhvd2V2ZXIsIHdlIGNh biByYWlzZSB0aGUgYmFyIGZvciAqYWxsKiBwYWNrYWdlcyBzaW11bHRhbmVvdXNseSBieSBtYWtp bmcgYSBtb3JlIHNvbGlkIGVjb3N5c3RlbSBvZiBIYXNrZWxsIHdlYiBwYWNrYWdlcyBhdmFpbGFi bGUgdGhhdCBhbnkgZnJhbWV3b3JrIGNhbiBjaGVycnktcGljayBmcm9tLjxicj4KPC9kaXY+PC9k aXY+Ci0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLTxicj4KPGJyPgpfX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fXzxicj4Kd2ViLWRldmVsIG1haWxpbmcgbGlzdDxicj4KPGEgaHJl Zj0ibWFpbHRvOndlYi1kZXZlbEBoYXNrZWxsLm9yZyIgdGFyZ2V0PSJfYmxhbmsiPndlYi1kZXZl bEBoYXNrZWxsLm9yZzwvYT48YnI+CjxhIGhyZWY9Imh0dHA6Ly93d3cuaGFza2VsbC5vcmcvbWFp bG1hbi9saXN0aW5mby93ZWItZGV2ZWwiIHRhcmdldD0iX2JsYW5rIj5odHRwOi8vd3d3Lmhhc2tl bGwub3JnL21haWxtYW4vbGlzdGluZm8vd2ViLWRldmVsPC9hPjxicj4KIMKgPGJyPgo8L2Jsb2Nr cXVvdGU+Cjxicj4KPC9ibG9ja3F1b3RlPjwvZGl2Pjxicj4K --===============3961449440014065962==-- From michael@snoyman.com Mon Mar 15 12:23:47 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] A separation of concerns Date: Mon, 15 Mar 2010 09:54:19 -0700 Message-ID: <29bf512f1003150954k723b9b5do22da5d450118cb90@mail.gmail.com> In-Reply-To: <7A24642C-D3FF-481E-9B0B-204C5F85DF01@eidhof.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8032344506505965960==" --===============8032344506505965960== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit +1. I wrote another e-mail just a bit ago listing some library projects that I thought should be attacked. Perhaps we should start a Wiki page with a "web programming wishlist", rank it by difficulty and priority, and try to encourage collaboration that way? On Mon, Mar 15, 2010 at 9:33 AM, Chris Eidhof wrote: > Hi everyone, > > I don't believe that there could be one big framework for everybody. Some > people want good HTML abstractions, others only think of the server as data > storage. Some people want RESTful URLs, other people don't care about > RESTfulness but would benefit heavily from controller abstractions. For > certain applications SQL might be perfect and for others the Happstack-State > works great. > > My point is: we should not try to build one big framework. Instead, I > propose that we build a set of smaller libraries that each do one thing very > well. Some of these libraries might be designed to work together. > > I personally think MVC is a perfect fit for the web: model code handles > data storage, view code handles HTML/JSON/XML and the controller coordinates > between these. Instead of building packages that do all of these things, I > would like to see model packages, view packages and controller packages. > That way we can achieve maximum reusability and a good separation of > concerns. > > What do you think of this? > > -chris > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > --===============8032344506505965960== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 KzEuIEkgd3JvdGUgYW5vdGhlciBlLW1haWwganVzdCBhIGJpdCBhZ28gbGlzdGluZyBzb21lIGxp YnJhcnkgcHJvamVjdHMgdGhhdCBJIHRob3VnaHQgc2hvdWxkIGJlIGF0dGFja2VkLiBQZXJoYXBz IHdlIHNob3VsZCBzdGFydCBhIFdpa2kgcGFnZSB3aXRoIGEgJnF1b3Q7d2ViIHByb2dyYW1taW5n IHdpc2hsaXN0JnF1b3Q7LCByYW5rIGl0IGJ5IGRpZmZpY3VsdHkgYW5kIHByaW9yaXR5LCBhbmQg dHJ5IHRvIGVuY291cmFnZSBjb2xsYWJvcmF0aW9uIHRoYXQgd2F5Pzxicj4KPGJyPjxkaXYgY2xh c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d3cuaGFza2VsbC5vcmcvbWFpbG1h bi9saXN0aW5mby93ZWItZGV2ZWw8L2E+PGJyPgo8L2Jsb2NrcXVvdGU+PC9kaXY+PGJyPgo= --===============8032344506505965960==-- From johan.tibell@gmail.com Mon Mar 15 12:27:41 2010 From: Johan Tibell To: web-devel@haskell.org Subject: Re: [web-devel] A separation of concerns Date: Mon, 15 Mar 2010 17:57:55 +0100 Message-ID: <90889fe71003150957u2b1dfba0u75a8813400f8ca53@mail.gmail.com> In-Reply-To: <7A24642C-D3FF-481E-9B0B-204C5F85DF01@eidhof.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1586755102203189467==" --===============1586755102203189467== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 15, 2010 at 5:33 PM, Chris Eidhof wrote: > Hi everyone, > > I don't believe that there could be one big framework for everybody. Some p= eople want good HTML abstractions, others only think of the server as data st= orage. Some people want RESTful URLs, other people don't care about RESTfulne= ss but would benefit heavily from controller abstractions. For certain applic= ations SQL might be perfect and for others the Happstack-State works great. > > My point is: we should not try to build one big framework. Instead, I propo= se that we build a set of smaller libraries that each do one thing very well.= Some of these libraries might be designed to work together. While I think there is space for frameworks as a way to help developers structure web applications I agree with the call for smaller libraries. In fact, one of the best things that happened to Haskell web development the last few months is in my opinion the 'text' library. Even though it has nothing to do with web development per se it solves an important problem for web development, namely having a space efficient, fast and correct data type for Unicode text. The reason I pick the 'text' library as an example is that I think it exemplifies the kind of libraries we need more of: well-test, high-performance, and well-documented libraries. There are lots of small libraries that are still missing. For example an equivalent of Python's urllib, a really fast and *simple* HTTP server, a high-performance and *full features* database library for working with e.g. MySQL, etc. Cheers, Johan --===============1586755102203189467==-- From michael@snoyman.com Mon Mar 15 12:35:16 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] A separation of concerns Date: Mon, 15 Mar 2010 10:05:49 -0700 Message-ID: <29bf512f1003151005q3d28d5e5lb310761bf5e00bd8@mail.gmail.com> In-Reply-To: <90889fe71003150957u2b1dfba0u75a8813400f8ca53@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1390456089682708296==" --===============1390456089682708296== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, Mar 15, 2010 at 9:57 AM, Johan Tibell wrote: > On Mon, Mar 15, 2010 at 5:33 PM, Chris Eidhof wrote: > > Hi everyone, > > > > I don't believe that there could be one big framework for everybody. Some > people want good HTML abstractions, others only think of the server as data > storage. Some people want RESTful URLs, other people don't care about > RESTfulness but would benefit heavily from controller abstractions. For > certain applications SQL might be perfect and for others the Happstack-State > works great. > > > > My point is: we should not try to build one big framework. Instead, I > propose that we build a set of smaller libraries that each do one thing very > well. Some of these libraries might be designed to work together. > > While I think there is space for frameworks as a way to help > developers structure web applications I agree with the call for > smaller libraries. In fact, one of the best things that happened to > Haskell web development the last few months is in my opinion the > 'text' library. Even though it has nothing to do with web development > per se it solves an important problem for web development, namely > having a space efficient, fast and correct data type for Unicode text. > The reason I pick the 'text' library as an example is that I think it > exemplifies the kind of libraries we need more of: well-test, > high-performance, and well-documented libraries. > > There are lots of small libraries that are still missing. For example > an equivalent of Python's urllib, a really fast and *simple* HTTP > server, a high-performance and *full features* database library for > working with e.g. MySQL, etc. > > Is there a reason you count out Hyena as a good HTTP server? After all, you are the expert on it ;). Michael --===============1390456089682708296== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gTW9uLCBNYXIgMTUsIDIwMTAgYXQg OTo1NyBBTSwgSm9oYW4gVGliZWxsIDxzcGFuIGRpcj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFpbHRv OmpvaGFuLnRpYmVsbEBnbWFpbC5jb20iPmpvaGFuLnRpYmVsbEBnbWFpbC5jb208L2E+Jmd0Ozwv c3Bhbj4gd3JvdGU6PGJyPj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ZWQgbW9yZSBvZjogd2VsbC10ZXN0LDxi cj4KaGlnaC1wZXJmb3JtYW5jZSwgYW5kIHdlbGwtZG9jdW1lbnRlZCBsaWJyYXJpZXMuPGJyPgo8 YnI+ClRoZXJlIGFyZSBsb3RzIG9mIHNtYWxsIGxpYnJhcmllcyB0aGF0IGFyZSBzdGlsbCBtaXNz aW5nLiBGb3IgZXhhbXBsZTxicj4KYW4gZXF1aXZhbGVudCBvZiBQeXRob24mIzM5O3MgdXJsbGli LCBhIHJlYWxseSBmYXN0IGFuZCAqc2ltcGxlKiBIVFRQPGJyPgpzZXJ2ZXIsIGEgaGlnaC1wZXJm b3JtYW5jZSBhbmQgKmZ1bGwgZmVhdHVyZXMqIGRhdGFiYXNlIGxpYnJhcnkgZm9yPGJyPgp3b3Jr aW5nIHdpdGggZS5nLiBNeVNRTCwgZXRjLjxicj48YnI+PC9ibG9ja3F1b3RlPjxkaXY+SXMgdGhl cmUgYSByZWFzb24geW91IGNvdW50IG91dCBIeWVuYSBhcyBhIGdvb2QgSFRUUCBzZXJ2ZXI/IEFm dGVyIGFsbCwgeW91IGFyZSB0aGUgZXhwZXJ0IG9uIGl0IDspLjwvZGl2PjxkaXY+PGJyPjwvZGl2 PjxkaXY+TWljaGFlbDwvZGl2PjwvZGl2Pgo= --===============1390456089682708296==-- From johan.tibell@gmail.com Mon Mar 15 12:42:15 2010 From: Johan Tibell To: web-devel@haskell.org Subject: Re: [web-devel] A separation of concerns Date: Mon, 15 Mar 2010 18:12:23 +0100 Message-ID: <90889fe71003151012g668a9bedxdd690af5f517d8a6@mail.gmail.com> In-Reply-To: <29bf512f1003151005q3d28d5e5lb310761bf5e00bd8@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3610408093616366363==" --===============3610408093616366363== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, Mar 15, 2010 at 6:05 PM, Michael Snoyman wrote: > On Mon, Mar 15, 2010 at 9:57 AM, Johan Tibell > wrote: >> While I think there is space for frameworks as a way to help >> developers structure web applications I agree with the call for >> smaller libraries. In fact, one of the best things that happened to >> Haskell web development the last few months is in my opinion the >> 'text' library. Even though it has nothing to do with web development >> per se it solves an important problem for web development, namely >> having a space efficient, fast and correct data type for Unicode text. >> The reason I pick the 'text' library as an example is that I think it >> exemplifies the kind of libraries we need more of: well-test, >> high-performance, and well-documented libraries. >> >> There are lots of small libraries that are still missing. For example >> an equivalent of Python's urllib, a really fast and *simple* HTTP >> server, a high-performance and *full features* database library for >> working with e.g. MySQL, etc. >> > Is there a reason you count out Hyena as a good HTTP server? After all, you > are the expert on it ;). It's not done! I have a large number of changes on my local machine that I haven't had time to finish up yet. It lacks benchmarks, sufficient test coverage, and documentation (including tutorials). It's simply not polished enough yet and doesn't incorporate what I've learned about Haskell server development the last year or so. I do plan to return to Hyena after finishing up some lower level stuff like the event library -- yes, I'm yak shaving. Cheers, Johan --===============3610408093616366363==-- From michael@snoyman.com Mon Mar 15 12:54:23 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] A separation of concerns Date: Mon, 15 Mar 2010 10:24:57 -0700 Message-ID: <29bf512f1003151024red53da4p2a5f8f04f69eeed2@mail.gmail.com> In-Reply-To: <90889fe71003151012g668a9bedxdd690af5f517d8a6@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7441687195106501039==" --===============7441687195106501039== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, Mar 15, 2010 at 10:12 AM, Johan Tibell wrote: > On Mon, Mar 15, 2010 at 6:05 PM, Michael Snoyman > wrote: > > On Mon, Mar 15, 2010 at 9:57 AM, Johan Tibell > > wrote: > >> While I think there is space for frameworks as a way to help > >> developers structure web applications I agree with the call for > >> smaller libraries. In fact, one of the best things that happened to > >> Haskell web development the last few months is in my opinion the > >> 'text' library. Even though it has nothing to do with web development > >> per se it solves an important problem for web development, namely > >> having a space efficient, fast and correct data type for Unicode text. > >> The reason I pick the 'text' library as an example is that I think it > >> exemplifies the kind of libraries we need more of: well-test, > >> high-performance, and well-documented libraries. > >> > >> There are lots of small libraries that are still missing. For example > >> an equivalent of Python's urllib, a really fast and *simple* HTTP > >> server, a high-performance and *full features* database library for > >> working with e.g. MySQL, etc. > >> > > Is there a reason you count out Hyena as a good HTTP server? After all, > you > > are the expert on it ;). > > It's not done! I have a large number of changes on my local machine > that I haven't had time to finish up yet. It lacks benchmarks, > sufficient test coverage, and documentation (including tutorials). > > It's simply not polished enough yet and doesn't incorporate what I've > learned about Haskell server development the last year or so. > > I do plan to return to Hyena after finishing up some lower level stuff > like the event library -- yes, I'm yak shaving. > > While we're discussing Hyena, is there any possible of it using the wai package? I wouldn't mind doing the grunt work of porting it over (in fact, I already started this). Michael --===============7441687195106501039== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gTW9uLCBNYXIgMTUsIDIwMTAgYXQg MTA6MTIgQU0sIEpvaGFuIFRpYmVsbCA8c3BhbiBkaXI9Imx0ciI+Jmx0OzxhIGhyZWY9Im1haWx0 bzpqb2hhbi50aWJlbGxAZ21haWwuY29tIj5qb2hhbi50aWJlbGxAZ21haWwuY29tPC9hPiZndDs8 L3NwYW4+IHdyb3RlOjxicj48YmxvY2txdW90ZSBjbGFzcz0iZ21haWxfcXVvdGUiIHN0eWxlPSJt YXJnaW46MCAwIDAgLjhleDtib3JkZXItbGVmdDoxcHggI2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6 MWV4OyI+CjxkaXYgY2xhc3M9ImltIj5PbiBNb24sIE1hciAxNSwgMjAxMCBhdCA2OjA1IFBNLCBN aWNoYWVsIFNub3ltYW4gJmx0OzxhIGhyZWY9Im1haWx0bzptaWNoYWVsQHNub3ltYW4uY29tIj5t aWNoYWVsQHNub3ltYW4uY29tPC9hPiZndDsgd3JvdGU6PGJyPgomZ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nN1ZmZp Y2llbnQgdGVzdCBjb3ZlcmFnZSwgYW5kIGRvY3VtZW50YXRpb24gKGluY2x1ZGluZyB0dXRvcmlh bHMpLjxicj4KPGJyPgpJdCYjMzk7cyBzaW1wbHkgbm90IHBvbGlzaGVkIGVub3VnaCB5ZXQgYW5k IGRvZXNuJiMzOTt0IGluY29ycG9yYXRlIHdoYXQgSSYjMzk7dmU8YnI+CmxlYXJuZWQgYWJvdXQg SGFza2VsbCBzZXJ2ZXIgZGV2ZWxvcG1lbnQgdGhlIGxhc3QgeWVhciBvciBzby48YnI+Cjxicj4K SSBkbyBwbGFuIHRvIHJldHVybiB0byBIeWVuYSBhZnRlciBmaW5pc2hpbmcgdXAgc29tZSBsb3dl ciBsZXZlbCBzdHVmZjxicj4KbGlrZSB0aGUgZXZlbnQgbGlicmFyeSAtLSB5ZXMsIEkmIzM5O20g eWFrIHNoYXZpbmcuPGJyPgo8YnI+PC9ibG9ja3F1b3RlPjxkaXY+V2hpbGUgd2UmIzM5O3JlIGRp c2N1c3NpbmcgSHllbmEsIGlzIHRoZXJlIGFueSBwb3NzaWJsZSBvZiBpdCB1c2luZyB0aGUgd2Fp IHBhY2thZ2U/IEkgd291bGRuJiMzOTt0IG1pbmQgZG9pbmcgdGhlIGdydW50IHdvcmsgb2YgcG9y dGluZyBpdCBvdmVyIChpbiBmYWN0LCBJIGFscmVhZHkgc3RhcnRlZCB0aGlzKS48L2Rpdj48ZGl2 Pjxicj48L2Rpdj4KPGRpdj5NaWNoYWVswqA8L2Rpdj48L2Rpdj4K --===============7441687195106501039==-- From cmoore@wamboli.com Mon Mar 15 12:55:43 2010 From: Clint Moore To: web-devel@haskell.org Subject: Re: [web-devel] A separation of concerns Date: Mon, 15 Mar 2010 10:26:18 -0700 Message-ID: <157577bd1003151026t4fa5c78am6b692adaf3b462ff@mail.gmail.com> In-Reply-To: <7A24642C-D3FF-481E-9B0B-204C5F85DF01@eidhof.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2019932218737965027==" --===============2019932218737965027== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 15, 2010 at 9:33 AM, Chris Eidhof wrote: > My point is: we should not try to build one big framework. Instead, I propo= se that we build a set of smaller libraries that each do one thing very well.= Some of these libraries might be designed to work together. I completely agree. For our current project we chose Hack mainly because of its simplicity and the fact that it imposes very little requirements on the code around it which is more in keeping with many of the reasons I love working with Haskell to begin with - flexibility chief among them. In fact, I would go so far as to say that any one-stop web framework for Haskell would have to be comprised of may separate libraries that function well on their own first, and then happen to form a cohesive whole to create a more monolithic, if only in spirit, one size fits all framework. Happstack does this to a certain extent but I think there's a lot of room for improvement. > I personally think MVC is a perfect fit for the web: model code handles dat= a storage, view code handles HTML/JSON/XML and the controller coordinates bet= ween these. Instead of building packages that do all of these things, I would= like to see model packages, view packages and controller packages. That way = we can achieve maximum reusability and a good separation of concerns. Absolutely. --===============2019932218737965027==-- From jeremy@n-heptane.com Mon Mar 15 13:19:32 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] A separation of concerns Date: Mon, 15 Mar 2010 12:50:07 -0500 Message-ID: In-Reply-To: <7A24642C-D3FF-481E-9B0B-204C5F85DF01@eidhof.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7487280201404106954==" --===============7487280201404106954== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit I agree with the small libraries path as well. In some sense, the future of happstack is to not exist at all. The parts of happstack should be further modularized and generalized until they are not happstack specific. Ultimately, though, there is a need for some glue code to bring all the pieces back together. But there should be a wide variety of pieces to pick from. We have already split happstack-server and happstack-state so that neither depends on the other. I have also been wanting to split happstack-server into smaller chunks that could possibly be used independently. The attempt to port happstack-server to happstack-wai is a step in that direction. Happstack itself does not really have any templating libraries. But it supports Text.XHtml, HStringTemplate, HSP, and formlets. And it is trivial to add support for other things as well. In my experience there is usually some glue code that is needed to make the various libraries work together. But at the same time, the libraries themselves do not really need to be happstack specific. For example, the four libraries listed above where all developed independently of happstack. And, I wrote a happstack-facebook library, but the 'happstack' specific portion of it is very small. If I had more time to work on it I would finish refactoring it so that it could be used with non-happstack apps as well. - jeremy On Mon, Mar 15, 2010 at 11:33 AM, Chris Eidhof wrote: > Hi everyone, > > I don't believe that there could be one big framework for everybody. Some > people want good HTML abstractions, others only think of the server as data > storage. Some people want RESTful URLs, other people don't care about > RESTfulness but would benefit heavily from controller abstractions. For > certain applications SQL might be perfect and for others the Happstack-State > works great. > > My point is: we should not try to build one big framework. Instead, I > propose that we build a set of smaller libraries that each do one thing very > well. Some of these libraries might be designed to work together. > > I personally think MVC is a perfect fit for the web: model code handles > data storage, view code handles HTML/JSON/XML and the controller coordinates > between these. Instead of building packages that do all of these things, I > would like to see model packages, view packages and controller packages. > That way we can achieve maximum reusability and a good separation of > concerns. > > What do you think of this? > > -chris > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > --===============7487280201404106954== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdj5JIGFncmVlIHdpdGggdGhlIHNtYWxsIGxpYnJhcmllcyBwYXRoIGFzIHdlbGwuIEluIHNv bWUgc2Vuc2UsIHRoZSBmdXR1cmUgb2YgaGFwcHN0YWNrIGlzIHRvIG5vdCBleGlzdCBhdCBhbGwu IFRoZSBwYXJ0cyBvZiBoYXBwc3RhY2sgc2hvdWxkIGJlIGZ1cnRoZXIgbW9kdWxhcml6ZWQgYW5k IGdlbmVyYWxpemVkIHVudGlsIHRoZXkgYXJlIG5vdCBoYXBwc3RhY2sgc3BlY2lmaWMuIFVsdGlt YXRlbHksIHRob3VnaCwgdGhlcmUgaXMgYSBuZWVkIGZvciBzb21lIGdsdWUgY29kZSB0byBicmlu ZyBhbGwgdGhlIHBpZWNlcyBiYWNrIHRvZ2V0aGVyLiBCdXQgdGhlcmUgc2hvdWxkIGJlIGEgd2lk ZSB2Y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G9mIHRoZXNlIHRoaW5ncywgSSB3b3VsZCBsaWtlIHRvIHNl ZSBtb2RlbCBwYWNrYWdlcywgdmlldyBwYWNrYWdlcyBhbmQgY29udHJvbGxlciBwYWNrYWdlcy4g VGhhdCB3YXkgd2UgY2FuIGFjaGlldmUgbWF4aW11bSByZXVzYWJpbGl0eSBhbmQgYSBnb29kIHNl cGFyYXRpb24gb2YgY29uY2VybnMuPGJyPgoKCjxicj4KV2hhdCBkbyB5b3UgdGhpbmsgb2YgdGhp cz88YnI+Cjxicj4KLWNocmlzPGJyPgo8YnI+Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fPGJyPgp3ZWItZGV2ZWwgbWFpbGluZyBsaXN0PGJyPgo8YSBocmVm PSJtYWlsdG86d2ViLWRldmVsQGhhc2tlbGwub3JnIiB0YXJnZXQ9Il9ibGFuayI+d2ViLWRldmVs QGhhc2tlbGwub3JnPC9hPjxicj4KPGEgaHJlZj0iaHR0cDovL3d3dy5oYXNrZWxsLm9yZy9tYWls bWFuL2xpc3RpbmZvL3dlYi1kZXZlbCIgdGFyZ2V0PSJfYmxhbmsiPmh0dHA6Ly93d3cuaGFza2Vs bC5vcmcvbWFpbG1hbi9saXN0aW5mby93ZWItZGV2ZWw8L2E+PGJyPgo8L2Jsb2NrcXVvdGU+PC9k aXY+PGJyPgo= --===============7487280201404106954==-- From johan.tibell@gmail.com Mon Mar 15 13:26:36 2010 From: Johan Tibell To: web-devel@haskell.org Subject: Re: [web-devel] A separation of concerns Date: Mon, 15 Mar 2010 18:56:51 +0100 Message-ID: <90889fe71003151056g1a97f15cn85e0f7590b697779@mail.gmail.com> In-Reply-To: <29bf512f1003151024red53da4p2a5f8f04f69eeed2@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5165170581419593494==" --===============5165170581419593494== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, Mar 15, 2010 at 6:24 PM, Michael Snoyman wrote: > While we're discussing Hyena, is there any possible of it using the wai > package? I wouldn't mind doing the grunt work of porting it over (in fact, I > already started this). > Michael I appreciate the offer. However, I'd prefer if the WAI was done with a separate compatibility layer on top (in a separate package) for now. The reason is that I have a big uncommited refactoring sitting on my laptop that changes the internals a lot (by using a new definition of iteratees) and changes the API a little bit. By using a compatibility layer you wouldn't have to change much when the next version of Hyena comes out. Cheers, Johan --===============5165170581419593494==-- From gour@gour-nitai.com Mon Mar 15 14:55:43 2010 From: Gour To: web-devel@haskell.org Subject: [web-devel] Re: A separation of concerns Date: Mon, 15 Mar 2010 20:27:31 +0100 Message-ID: <20100315202731.7ff594de@gaura-nitai.no-ip.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0587013654107806716==" --===============0587013654107806716== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, 15 Mar 2010 12:50:07 -0500 >>>>>> "Jeremy" == wrote: Jeremy> I agree with the small libraries path as well. I'm sorry if I was misunderstood as desiring to see one-size-fits-all Haskell web-framework, but I fully agree with stuff like WAI and having bunch of small libs used by several frameworks. However, there is one thing which, iirc, nobody mentioned and I thought about in my original post - that's documentation! It's (lack of) one of things for which Happs(stack) was/is very often criticized, Turbinado was also lacking it, Yesod can improve as well. That's why I consider & hope that some 'consolidation work' on the web scene can bring about better documented web-related projects. Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- --===============0587013654107806716== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuNC4xMCAoR05V L0xpbnV4KQoKaUVZRUFSRUNBQVlGQWt1ZWlpTUFDZ2tRVThlRThmbHY5ZmIzTUFDZEUxRlZ5bnB0 TjRqUUhad2V5YVIrNE04bQppL2NBbjNMMEQ5bWM2OUI0ZFRjNVc3VlJNOWMvQUQrYwo9aWIzSwot LS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============0587013654107806716==-- From chris@eidhof.nl Mon Mar 15 15:30:23 2010 From: Chris Eidhof To: web-devel@haskell.org Subject: Re: [web-devel] A separation of concerns Date: Mon, 15 Mar 2010 21:00:56 +0100 Message-ID: In-Reply-To: <90889fe71003150957u2b1dfba0u75a8813400f8ca53@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2999343595230755503==" --===============2999343595230755503== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On 15 mrt 2010, at 17:57, Johan Tibell wrote: > There are lots of small libraries that are still missing. For example > an equivalent of Python's urllib, a really fast and *simple* HTTP > server, a high-performance and *full features* database library for > working with e.g. MySQL, etc. Ok, so let's try to make a list. Here's some stuff I would like to see. "Low level" stuff - Fast, simple HTTP server with no abstractions - IMAP library Data storage - abstraction of relational databases (something like HaskellDB? based on T= akusen?) - abstraction of nosql databases=20 - purely functional databases (something like Happstack?) Controller abstractions - a good URL routing library (where you can only produce and link to valid = urls) - a serializable continuations-based library (especially the serializable p= art is hard), something like Clean's iTasks. View abstractions=20 - High-performance HTML combinators - generic programming for the web - simplified formlets - abstractions over "web components", e.g. composable components that contai= n HTML, CSS and Javascript. maybe composed using something like FRP. Please add to this list or expand where necessary. Maybe we should put this o= n a wiki page. -chris --===============2999343595230755503==-- From gour@gour-nitai.com Mon Mar 15 15:35:32 2010 From: Gour To: web-devel@haskell.org Subject: [web-devel] Re: consolidating Haskell's web-framework scene Date: Mon, 15 Mar 2010 21:06:32 +0100 Message-ID: <20100315210632.1672df20@gaura-nitai.no-ip.org> In-Reply-To: <29bf512f1003150810r5e02168eg5bf571a414fbbf0e@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2672958613995073452==" --===============2672958613995073452== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, 15 Mar 2010 08:10:35 -0700 >>>>>> "Michael" == wrote: Michael> I am very interested in trying to continue consolidation, but Michael> I think aiming for the One True Haskell Framework is a bad Michael> idea. I didn't think about One True Haskell Framework, but about, at least one, which can run on shared hosting using nginx, cherokee, lighty server, some templating engine, database back-end and decently documented. Michael> Python- the community known for One Way To Do It- can't even Michael> consolidate around a single framework, so Haskell- the Michael> language of We Can All Write A Monad Transformers Library- Michael> doesn't stand a chance. That's true, but Python is much bigger community in comparison and, afaics, Python web frameworks have lot of docs, some even many books written about them. Michael> So where can we consolidate? On libraries. I have purposely Michael> released a number of the components of Yesod as separate Michael> libraries that are available to any framework author (or even Michael> someone *not* using a framework). That's great and I'm very happy seeing that Happstack may become WAI-ready. Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- --===============2672958613995073452== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuNC4xMCAoR05V L0xpbnV4KQoKaUVZRUFSRUNBQVlGQWt1ZWswZ0FDZ2tRVThlRThmbHY5ZlkrMEFDYUE5OStyOE83 amRLMDEwSEdNVUtGM2xXegpmL29BbjE1eUtnM3d1UDdUUHhPUHZqVUczTEVJKzNKUwo9MkdkZwot LS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============2672958613995073452==-- From johan.tibell@gmail.com Mon Mar 15 15:37:09 2010 From: Johan Tibell To: web-devel@haskell.org Subject: Re: [web-devel] A separation of concerns Date: Mon, 15 Mar 2010 21:07:24 +0100 Message-ID: <90889fe71003151307v52d327e3rf1a31a5adbfeeb87@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4988346811579047464==" --===============4988346811579047464== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, Mar 15, 2010 at 9:00 PM, Chris Eidhof wrote: > On 15 mrt 2010, at 17:57, Johan Tibell wrote: > > > There are lots of small libraries that are still missing. For example > > an equivalent of Python's urllib, a really fast and *simple* HTTP > > server, a high-performance and *full features* database library for > > working with e.g. MySQL, etc. > > Ok, so let's try to make a list. Here's some stuff I would like to see. > Good list! > "Low level" stuff > - Fast, simple HTTP server with no abstractions > I plan to take a stab at this after I'm done with the event library. > - IMAP library > Data storage > - abstraction of relational databases (something like HaskellDB? based on > Takusen?) > - abstraction of nosql databases > I'm also interested at writing a client library for Cassandra. > - purely functional databases (something like Happstack?) > Controller abstractions > - a good URL routing library (where you can only produce and link to valid > urls) > - a serializable continuations-based library (especially the serializable > part is hard), something like Clean's iTasks. > View abstractions > - High-performance HTML combinators > I created a GSoC project proposal for this here: http://hackage.haskell.org/trac/summer-of-code/ticket/1580 > - generic programming for the web > - simplified formlets > - abstractions over "web components", e.g. composable components that > contain HTML, CSS and Javascript. maybe composed using something like FRP. > Cheers, Johan --===============4988346811579047464== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBjbGFzcz0iZ21haWxfcXVvdGUiPk9uIE1vbiwgTWFyIDE1LCAyMDEwIGF0IDk6MDAgUE0s IENocmlzIEVpZGhvZiA8c3BhbiBkaXI9Imx0ciI+Jmx0OzxhIGhyZWY9Im1haWx0bzpjaHJpc0Bl aWRob2YubmwiPmNocmlzQGVpZGhvZi5ubDwvYT4mZ3Q7PC9zcGFuPiB3cm90ZTo8YnI+PGJsb2Nr cXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0ibWFyZ2luOjAgMCAwIC44ZXg7Ym9yZGVy LWxlZnQ6MXB4ICNjY2Mgc29saWQ7cGFkZGluZy1sZWZ0OjFleDsiPgoKPGRpdiBjbGFzcz0iaW0i Pk9uIDE1IG1ydCAyMDEwLCBhdCAxNzo1NywgSm9oYW4gVGliZWxsIHdyb3RlOjxicj4KPGJyPgom Z3Q7I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aWdoLXBlcmZvcm1hbmNlIEhUTUwgY29t YmluYXRvcnM8YnI+PC9ibG9ja3F1b3RlPjxkaXY+PGJyPjwvZGl2PjxkaXY+SSBjcmVhdGVkIGEg R1NvQyBwcm9qZWN0IHByb3Bvc2FsIGZvciB0aGlzIGhlcmU6PC9kaXY+PGRpdj48YnI+PC9kaXY+ PGRpdj48YSBocmVmPSJodHRwOi8vaGFja2FnZS5oYXNrZWxsLm9yZy90cmFjL3N1bW1lci1vZi1j b2RlL3RpY2tldC8xNTgwIj5odHRwOi8vaGFja2FnZS5oYXNrZWxsLm9yZy90cmFjL3N1bW1lci1v Zi1jb2RlL3RpY2tldC8xNTgwPC9hPjwvZGl2PgoKPGRpdj6gPC9kaXY+PGJsb2NrcXVvdGUgY2xh c3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0ibWFyZ2luOjAgMCAwIC44ZXg7Ym9yZGVyLWxlZnQ6MXB4 ICNjY2Mgc29saWQ7cGFkZGluZy1sZWZ0OjFleDsiPgqgLSBnZW5lcmljIHByb2dyYW1taW5nIGZv ciB0aGUgd2ViPGJyPgqgLSBzaW1wbGlmaWVkIGZvcm1sZXRzPGJyPgqgLSBhYnN0cmFjdGlvbnMg b3ZlciAmcXVvdDt3ZWIgY29tcG9uZW50cyZxdW90OywgZS5nLiBjb21wb3NhYmxlIGNvbXBvbmVu dHMgdGhhdCBjb250YWluIEhUTUwsIENTUyBhbmQgSmF2YXNjcmlwdC4gbWF5YmUgY29tcG9zZWQg dXNpbmcgc29tZXRoaW5nIGxpa2UgRlJQLjxicj48L2Jsb2NrcXVvdGU+PGRpdj48YnI+PC9kaXY+ PGRpdj5DaGVlcnMsPC9kaXY+PGRpdj5Kb2hhbjwvZGl2PgoKPGRpdj6gPC9kaXY+PC9kaXY+PGJy Pgo= --===============4988346811579047464==-- From jeremy@n-heptane.com Mon Mar 15 15:55:44 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] A separation of concerns Date: Mon, 15 Mar 2010 15:26:20 -0500 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0082920668421962960==" --===============0082920668421962960== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, Mar 15, 2010 at 3:00 PM, Chris Eidhof wrote: > On 15 mrt 2010, at 17:57, Johan Tibell wrote: > > > There are lots of small libraries that are still missing. For example > > an equivalent of Python's urllib, a really fast and *simple* HTTP > > server, a high-performance and *full features* database library for > > working with e.g. MySQL, etc. > > Ok, so let's try to make a list. Here's some stuff I would like to see. > > Controller abstractions > - a good URL routing library (where you can only produce and link to valid > urls) > I have a library like that: http://src.seereason.com/urlt/ documented here: http://src.seereason.com/~jeremy/SimpleSite1.html View abstractions > - abstractions over "web components", e.g. composable components that > contain HTML, CSS and Javascript. maybe composed using something like FRP. > I have been experimenting with some web component widgets recently. It's very experimental at the moment. Hope to release something soon.. - jeremy --===============0082920668421962960== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gTW9uLCBNYXIgMTUsIDIwMTAgYXQgMzowMCBQTSwgQ2hyaXMgRWlkaG9mIDxzcGFuIGRpcj0i bHRyIj4mbHQ7PGEgaHJlZj0ibWFpbHRvOmNocmlzQGVpZGhvZi5ubCI+Y2hyaXNAZWlkaG9mLm5s PC9hPiZndDs8L3NwYW4+IHdyb3RlOjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+PGJsb2Nr cXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0ibWFyZ2luOjAgMCAwIC44ZXg7Ym9yZGVy LWxlZnQ6MXB4ICNjY2Mgc29saWQ7cGFkZGluZy1sZWZ0OjFleDsiPgo8ZGl2IGNsYXNzPSJpbSI+ T24gMTUgbXJ0IDIwMTAsIGF0IDE3OjU3LCBKb2hhbiBUaWJlbGwgd3JvdGU6PGJyPgo8YnI+CiZn dDsgVGhlcmUgYXJlIGxvdHMgb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aXY+ ZG9jdW1lbnRlZCBoZXJlOjwvZGl2PjxkaXY+PGJyPjwvZGl2Pgo8ZGl2PjxhIGhyZWY9Imh0dHA6 Ly9zcmMuc2VlcmVhc29uLmNvbS9+amVyZW15L1NpbXBsZVNpdGUxLmh0bWwiPmh0dHA6Ly9zcmMu c2VlcmVhc29uLmNvbS9+amVyZW15L1NpbXBsZVNpdGUxLmh0bWw8L2E+PC9kaXY+PGRpdj48YnI+ PC9kaXY+PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0ibWFyZ2luOjAgMCAw IC44ZXg7Ym9yZGVyLWxlZnQ6MXB4ICNjY2Mgc29saWQ7cGFkZGluZy1sZWZ0OjFleDsiPgpWaWV3 IGFic3RyYWN0aW9uczxicj6gLSBhYnN0cmFjdGlvbnMgb3ZlciAmcXVvdDt3ZWIgY29tcG9uZW50 cyZxdW90OywgZS5nLiBjb21wb3NhYmxlIGNvbXBvbmVudHMgdGhhdCBjb250YWluIEhUTUwsIENT UyBhbmQgSmF2YXNjcmlwdC4gbWF5YmUgY29tcG9zZWQgdXNpbmcgc29tZXRoaW5nIGxpa2UgRlJQ Ljxicj48L2Jsb2NrcXVvdGU+PGRpdj48YnI+PC9kaXY+PGRpdj5JIGhhdmUgYmVlbiBleHBlcmlt ZW50aW5nIHdpdGggc29tZSB3ZWIgY29tcG9uZW50IHdpZGdldHMgcmVjZW50bHkuIKBJdCYjMzk7 cyB2ZXJ5IGV4cGVyaW1lbnRhbCBhdCB0aGUgbW9tZW50LiBIb3BlIHRvIHJlbGVhc2Ugc29tZXRo aW5nIHNvb24uLjwvZGl2Pgo8ZGl2Pjxicj48L2Rpdj48ZGl2Pi0gamVyZW15PC9kaXY+PC9kaXY+ Cg== --===============0082920668421962960==-- From marco-oweber@gmx.de Mon Mar 15 17:12:29 2010 From: Marc Weber To: web-devel@haskell.org Subject: Re: [web-devel] A separation of concerns Date: Mon, 15 Mar 2010 22:23:25 +0100 Message-ID: <1268688161-sup-48@nixos> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2443764178162899370==" --===============2443764178162899370== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Chris, > - High-performance HTML combinators The first step would be measuring performance of various existing libraries Nothing is faster than caching (?) So maybe we can have faster pages writing cache strategies (?) Not using caching means less dev - time. So I agree on that this can be important. > Data storage > - abstraction of relational databases (something like HaskellDB? based on= Takusen?) > - abstraction of nosql databases=20 > - purely functional databases (something like Happstack?) No matter what you're going to do. It will be compared against the ease of use of use of existing RDBM solutions. You just connect to the database an= d run arbitrary queries. Also keep in mind that some projects require keeping track of values such as sums or max which is typically done by triggers. Haskell could do this as well. > - a good URL routing library (where you can only produce and link to valid = urls) Think about this twice: You can't recompile bigger CMS systems each time you add a link. This may be fine for you personal web page (However you could use Joomla or such for that as well *kidding*) No matter what you're going to do - Having kind of meta compiler (EDSL) in order to write Flash / JS code would be perfect - and maybe Haskell is the best language to write that. Have a look at the features of HaXe. It's interesting: Write one language and target Flash, JS, PHP, neko virtual machine, (IPhone).. Marc Weber --===============2443764178162899370==-- From jeremy@n-heptane.com Mon Mar 15 17:28:15 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] A separation of concerns Date: Mon, 15 Mar 2010 16:58:50 -0500 Message-ID: In-Reply-To: <1268688161-sup-48@nixos> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5577339272436100034==" --===============5577339272436100034== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, Mar 15, 2010 at 4:23 PM, Marc Weber wrote: > Hi Chris, > > > - a good URL routing library (where you can only produce and link to > valid urls) > Think about this twice: You can't recompile bigger CMS systems each time > you add a link. > What do you mean by 'adding a link' in a bigger CMS. To me that sounds like something which is done by a user interacting with the app via the browser? I don't see that as being in conflict with producing only valid urls... It seems like the system would have two classes of URLs. Ones that are statically known at compile time, and ones that only exist due to the state of the live database. If you want to add new code that refers to a specific page that was created in the live database -- then you do have a potential issue, since you can not guarantee at compile time that the dynamically created page will exactly be there.. The URL routing library ensures that when you are referring to 'static' urls in your code, you only generate valid urls. And the app runtime ensures that dynamically created urls are valid. And when you want to have static code which refers to a page which may or may not exist.. you can still probably benefit from a good URL router.. data CmsUrl = LoginPage | Homepage | ASpecificDynamicLink | DynLink String do u <- showURL ASpecificDynamicLink ... cms :: CmsURL -> URLT CmrURL IO () cms LoginPage = .... cms Homepage = ... cms ASpecificDynamicLink = cms (Dynlink "somelink") cms (DynLink str) = ... What am I missing? - jeremy --===============5577339272436100034== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gTW9uLCBNYXIgMTUsIDIwMTAgYXQgNDoyMyBQTSwgTWFyYyBXZWJlciA8c3BhbiBkaXI9Imx0 ciI+Jmx0OzxhIGhyZWY9Im1haWx0bzptYXJjby1vd2ViZXJAZ214LmRlIj5tYXJjby1vd2ViZXJA Z214LmRlPC9hPiZndDs8L3NwYW4+IHdyb3RlOjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+ PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0ibWFyZ2luOjAgMCAwIC44ZXg7 Ym9yZGVyLWxlZnQ6MXB4ICNjY2Mgc29saWQ7cGFkZGluZy1sZWZ0OjFleDsiPgpIaSBDaHJpcyw8 YnI+PGJyPjxkaXYgY2xhc3M9ImltIj4KJmd0OyAtIGEgZ29vZCBVUkwgcm91dGluZyBsaWJyYXJ5 ICh3aGVyZSB5b3UgY2FuIG9ubHkgcHJvZHVjZSBhbmQgbGluayB0byB2YWxpZCB1cmxzKTxicj4K PC9kaXY+VGhpbmsgYWJvdXQgdGhpcyB0d2ljZTogWW91IGNhbiYjMzk7dCByZWNvbXBpbGUgYmln Z2VyIENNUyBzeXN0ZW1zIGVhY2ggdGltZTxicj4KeW91IGFkZCBhIGxpbmsuPGJyPjwv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3Npbmc/PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRp dj4tIGplcmVteTwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+oDwvZGl2PjwvZGl2Pgo= --===============5577339272436100034==-- From greg@gregorycollins.net Mon Mar 15 18:08:11 2010 From: Gregory Collins To: web-devel@haskell.org Subject: [web-devel] On the state of Haskell web frameworks Date: Mon, 15 Mar 2010 18:38:47 -0400 Message-ID: <87iq8xp5vs.fsf@gregorycollins.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5164972339271665046==" --===============5164972339271665046== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi all, Just subscribed, and after reading through the recent traffic on this list in the archives I have a couple of quick comments. First, and I've discussed this with Michael Snoyman at length in private, I agree 100% with Chris Eidhof when he writes "I don't believe that there could be one big framework for everybody." Even getting consensus on what the prerequisites would be is basically impossible. To quote Gour: > Although it might be great framework, I'll be frank to say that > Happstack with all technology that goes along is something which is > either too complicated for me, not practical to be run on shared > hosting (e.g. Webfaction), not documented properly and it belongs to > 'noSQL' which is not for me at the moment. > > That's why I'm interested to discuss possibility to somehow > consolidate Haskell's web frameworks nad provide something which is > good for practical development, does not require VPS to be used, nice > documentation etc. A priori we've reached a fundamental disagreement about first principles -- personally I couldn't give a rat's ass whether the framework I'm using runs well on shared hosting, my focus is on being able to efficiently service heavy loads in a production context. Obviously, on the other side of the coin, being able to run in a CGI process hooked up to Apache is really important to many people. Michael wants to use YAML to define data models: more power to him, but personally the idea of doing that makes me want to vomit. I'm not saying that to disparage him at all, the idea isn't necessarily bad on its own merits: it just isn't for me. Everyone has their own pet preferences. I'm seeing a lot of energy being dedicated to standardizing interfaces, which I suppose is an admirable goal, but to me it's putting the cart before the horse: what's the point of having a standardized adapter when there's nothing worth plugging into it, besides some middleware that your framework should be providing for you anyways? Concentrating too much on interop right now is a waste of time IMO - besides, on the level that it's currently being discussed, that stuff is *easy*: making an adapter between any two of the myriad different web stack implementations (WAI, Happstack, Hyena, CGI, Hack, FastCGI, etc etc etc) is trivial. I doubt there's anyone on this list who couldn't cook up a WAI/CGI gateway in an afternoon. We need pluggable *applications* (blog, CMS, RSS feed generation, administrative panels, forum, wiki, caching, user management, etc) that understand how to talk to each other --- expecting "plug and play" compatibility between frameworks on this level, when there's no consensus on the *primitives*, is a pipe dream. The first framework that cracks this particular nut, in a way that makes it easy and pleasurable for people to build web apps that perform, is going to gain a lot of traction. Code talks. G -- Gregory Collins --===============5164972339271665046==-- From jeremy@n-heptane.com Mon Mar 15 18:28:37 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] On the state of Haskell web frameworks Date: Mon, 15 Mar 2010 17:59:13 -0500 Message-ID: In-Reply-To: <87iq8xp5vs.fsf@gregorycollins.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7052060283698878221==" --===============7052060283698878221== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 15, 2010 at 5:38 PM, Gregory Collins wro= te: We need pluggable *applications* (blog, CMS, RSS feed generation, > administrative panels, forum, wiki, caching, user management, etc) that > understand how to talk to each other --- expecting "plug and play" > compatibility between frameworks on this level, when there's no > consensus on the *primitives*, is a pipe dream. The first framework that > cracks this particular nut, in a way that makes it easy and pleasurable > for people to build web apps that perform, is going to gain a lot of > traction. Code talks. > > I have been working on this in the happstack framework. Specially, the idea of making possible for you to write a new application by combining several libraries writing by different authors. The first issue is that the libraries need to have unique URLS that can not collide with each other. If two libraries expect to be able to handle, " http://localhost/submit", that will never fly. So one aim of URLT was to ensure that when you combined different modules together, the URLs remained unique. http://src.seereason.com/~jeremy/SimpleSite1.html Another issue is that each library has it's own set of state that it needs to manage. happstack-state is pretty well situated in that regard. The happstack state is made up of an arbitrary number of state Components. Each library can have it's own state Components which get added to the global state. The next big problem I have run into is user management / security. Each of the libraries maybe have different requirements regarding permissions, etc. But I am not clear how much independence they can have from the user management system. I don't really want to take a one-size-fits-all user management approach though if I don't have to. - jeremy --===============7052060283698878221== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gTW9uLCBNYXIgMTUsIDIwMTAgYXQgNTozOCBQTSwgR3JlZ29yeSBDb2xsaW5zIDxzcGFuIGRp cj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFpbHRvOmdyZWdAZ3JlZ29yeWNvbGxpbnMubmV0Ij5ncmVn QGdyZWdvcnljb2xsaW5zLm5ldDwvYT4mZ3Q7PC9zcGFuPiB3cm90ZTo8ZGl2Pjxicj48ZGl2IGNs YXNzPSJnbWFpbF9xdW90ZSI+PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0i bWFyZ2luOjAgMCAwIC44ZXg7Ym9yZGVyLWxlZnQ6MXB4ICNjY2Mgc29saWQ7cGFkZGluZy1sZWZ0 OjFleDsiPgpXZSBuZWVkIHBsdWdnYWJsZSAqYXBwbGljYXRpb25zKiAoYmxvZywgQ01TLCBSU1Mg ZmVlZCBnZW5lcmF0aW9uLDxicj4KYWRtaW5pc3RyYXRpdmUgcGFuZWxzLCBmb3J1bSwgd2lraSwg Y2FjaGluZywgdXNlciBtYW5hZ2VtZW50LCBldGMpIHRoYXQ8YnI+CnVuZGVyc3RhbmQgaG93IHRv IHRhbGsgdG8gZWFjaCBvdGhlciAtLS0gZXhwZWN0aW5nICZxdW90O3BsdWcgYW5kIHBsYXkmcXVv dDs8YnI+CmNvbXBhdGliaWxpdHkgYmV0d2VlbiBmcmFtZXdvcmtzIG9uIHRoaXMgbGV2ZWwsIHdo ZW4gdGhlcmUmIzM5O3Mgbm88YnI+CmNvbnNlbnN1cyBvbiB0aGUgKnByaW1pdGl2ZXMqLCBpcyBh IHBpcGUgZHJlYW0uIFRoZSBmaXJzdCBmcmFtZXdvcmsgdGhhdDxicj4KY3JhY2tzIHRoaXMgcGFy dGljdWxhciBudXQsIGluIGEgd2F5IHRoYXQgbWFrZXMga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WFuYWdlbWVu dCBhcHByb2FjaCB0aG91Z2ggaWYgSSBkb24mIzM5O3QgaGF2ZSB0by6gPC9kaXY+CjxkaXY+PGJy PjwvZGl2PjxkaXY+LSBqZXJlbXk8L2Rpdj48L2Rpdj48L2Rpdj4K --===============7052060283698878221==-- From peteg42@gmail.com Mon Mar 15 18:45:19 2010 From: Peter Gammie To: web-devel@haskell.org Subject: Re: [web-devel] On the state of Haskell web frameworks Date: Tue, 16 Mar 2010 10:15:55 +1100 Message-ID: <717927701003151615ja228260geb10b389a3073c76@mail.gmail.com> In-Reply-To: <87iq8xp5vs.fsf@gregorycollins.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2894398115688313332==" --===============2894398115688313332== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Tue, Mar 16, 2010 at 9:38 AM, Gregory Collins wrote: > We need pluggable *applications* (blog, CMS, RSS feed generation, > administrative panels, forum, wiki, caching, user management, etc) that > understand how to talk to each other --- expecting "plug and play" > compatibility between frameworks on this level, when there's no > consensus on the *primitives*, is a pipe dream. The first framework that > cracks this particular nut, in a way that makes it easy and pleasurable > for people to build web apps that perform, is going to gain a lot of > traction. Code talks. Several years ago (mid-2007) I was looking for something like this. I found Bjorn Bringert's HOPE: http://hope.bringert.net/ (err, that seems broken now.) In essence, it is a framework built from a bunch of standard Haskell libs, for better or worse. It uses CGI/FCGI to talk to a web server. I dropped the HaskellDB dependency (roughly because it was too much effort to get it to scale up to thousands of items - I really needed the database to help with pagination), added multi-lingual support, accessibility, a primitive forum, web polls, google services, etc. for this website: http://drdvietnam.com/ This is not a high-traffic site - perhaps up to a thousand hits a day. For this reason I am sure there are many memory leaks, etc. in my version of HOPE. Why is it not on Hackage? Well, it only compiles with 6.8.x due to the capricious changes to the exception libraries in 6.10.x, and moreover I adjusted some of the base libraries (xhtml, cgi, HSQL, etc) in ways that I doubt everyone would like. (Am I the only person who forks almost every library they use?) So if you're in the market for a CMS-alike and don't want to reinvent the wheel, HOPE might be a good starting point. Bjorn solved a lot of problems - modularity, extensibility, packaging with Cabal, routing URLs, MVC, user management with role-based capabilities, etc. - in highly pragmatic and occasionally beautiful ways. :-) The darcs repos are here: http://peteg.org/haskell/ BTW if you're in this business please take Unicode seriously! Haskell libraries interfacing with C were terrible on this front when I was doing this work. cheers peter -- http://peteg.org/ --===============2894398115688313332==-- From jeremy@n-heptane.com Mon Mar 15 18:51:41 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] On the state of Haskell web frameworks Date: Mon, 15 Mar 2010 18:22:17 -0500 Message-ID: In-Reply-To: <87iq8xp5vs.fsf@gregorycollins.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2790518531893078120==" --===============2790518531893078120== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 15, 2010 at 5:38 PM, Gregory Collins wro= te: > I'm seeing a lot of energy being dedicated to standardizing interfaces, > which I suppose is an admirable goal, but to me it's putting the cart > before the horse: what's the point of having a standardized adapter when > there's nothing worth plugging into it, besides some middleware that > your framework should be providing for you anyways? In the case of happstack, I have felt that the lazy I/O based server back end would ultimately be a liability. That we ultimately need to be able to use something enumerator based. Additionally, the lazy I/O backend part of happstack-server is the least interesting part of the project. It just takes extra resources to maintain, but provides nothing especially unique. Moving to Wai should put us in a much better position to use a fast enumerator based backend -- and with out having to write one ourselves. Plus it should make it easy for people to use CGI, fastCGI, etc. We have some adapters for that already, but the Wai solution seems cleaner. If you want to use happstack-state, then you still need a process that runs fulltime, but if you just want to use the ServerMonad stuff provided in happstack-server, then CGI should be fine. Some from the point of view of a framework developer, it's not 'the middleware that your framework should be providing', but rather 'not having to reimplement existing middleware when I could be doing something cooler'. And, it also means that we can more easily share pieces of our framework with others. Many people are not interested in happstack-state, but might be interested in happstack-server. So, making it easier for them to use just that little piece is good for us. There is certainly a point where we won't see much increased returns from standard interfaces though. - jeremy --===============2790518531893078120== Content-Type: text/html Content-Transfer-Encoding: base64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Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] On the state of Haskell web frameworks Date: Mon, 15 Mar 2010 16:45:25 -0800 Message-ID: <29bf512f1003151745l29e3e92cycaa54f6fa530529@mail.gmail.com> In-Reply-To: <87iq8xp5vs.fsf@gregorycollins.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6991604591877547163==" --===============6991604591877547163== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 15, 2010 at 2:38 PM, Gregory Collins wro= te: > Hi all, > > Just subscribed, and after reading through the recent traffic on this > list in the archives I have a couple of quick comments. > > First, and I've discussed this with Michael Snoyman at length in > private, I agree 100% with Chris Eidhof when he writes "I don't believe > that there could be one big framework for everybody." Even getting > consensus on what the prerequisites would be is basically impossible. To > quote Gour: > > > Although it might be great framework, I'll be frank to say that > > Happstack with all technology that goes along is something which is > > either too complicated for me, not practical to be run on shared > > hosting (e.g. Webfaction), not documented properly and it belongs to > > 'noSQL' which is not for me at the moment. > > > > That's why I'm interested to discuss possibility to somehow > > consolidate Haskell's web frameworks nad provide something which is > > good for practical development, does not require VPS to be used, nice > > documentation etc. > > A priori we've reached a fundamental disagreement about first principles > -- personally I couldn't give a rat's ass whether the framework I'm > using runs well on shared hosting, my focus is on being able to > efficiently service heavy loads in a production context. Obviously, on > the other side of the coin, being able to run in a CGI process hooked up > to Apache is really important to many people. > > Michael wants to use YAML to define data models: more power to him, but > personally the idea of doing that makes me want to vomit. I'm not saying > that to disparage him at all, the idea isn't necessarily bad on its own > merits: it just isn't for me. Everyone has their own pet preferences. > > I'm seeing a lot of energy being dedicated to standardizing interfaces, > which I suppose is an admirable goal, but to me it's putting the cart > before the horse: what's the point of having a standardized adapter when > there's nothing worth plugging into it, besides some middleware that > your framework should be providing for you anyways? Concentrating too > much on interop right now is a waste of time IMO - besides, on the level > that it's currently being discussed, that stuff is *easy*: making an > adapter between any two of the myriad different web stack > implementations (WAI, Happstack, Hyena, CGI, Hack, FastCGI, etc etc etc) > is trivial. I doubt there's anyone on this list who couldn't cook up a > WAI/CGI gateway in an afternoon. > > We need pluggable *applications* (blog, CMS, RSS feed generation, > administrative panels, forum, wiki, caching, user management, etc) that > understand how to talk to each other --- expecting "plug and play" > compatibility between frameworks on this level, when there's no > consensus on the *primitives*, is a pipe dream. The first framework that > cracks this particular nut, in a way that makes it easy and pleasurable > for people to build web apps that perform, is going to gain a lot of > traction. Code talks. > > Maybe I'm misunderstanding you, but your whole e-mail seems like a large contradiction. But firstly, I believe your premise is mistaken: we're not trying to "standardize interfaces" for the most part; it's true that WAI was such an approach, but that's not the focus of this thread. You claim that anyone could write an adapter between two interfaces; look at the code for hack-handler-hyena and you'll understand the folly of that sentiment. But more to the point: because of WAI, we don't *have* to write the adapter, and I don't see any substantive critiques of the WAI approach. (If there are, we can address them by fixing the WAI.) Now, let me try to understand your point here: we need standardized interfaces for applications to communicate with each other, but we can't do that until we have the low level interfaces hammered out. On the other hand, you say that it's premature to try to standardize interfaces. And then you make it clear that the use case of many people (shared hosting) doesn't interest you at all; based on previous conversations, I believe this means that Snap will have *no* (Fast)CGI support. So where exactly are you hoping to create this platform from which everyone will build these great applications that snap together so well? I think (correct me if I'm wrong) that everyone else here is in agreement that the goal should not be to create a great framework that will solve everyone's needs. The goal should be to create great libraries that can be used independently. For example, separating out happstack-server and happstack-state now provides two great libraries that someone can use as part of a completely different application stack. I think that this approach is much healthier and productive than each of us trying to create the greatest snappable framework ever and hoping everyone else creates applications for it. Michael --===============6991604591877547163== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gTW9uLCBNYXIgMTUsIDIwMTAgYXQg MjozOCBQTSwgR3JlZ29yeSBDb2xsaW5zIDxzcGFuIGRpcj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFp bHRvOmdyZWdAZ3JlZ29yeWNvbGxpbnMubmV0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2UgY3JlYXRlcyBhcHBsaWNh dGlvbnMgZm9yIGl0Ljwvc3Bhbj48L2ZvbnQ+PC9kaXY+CjxkaXY+PGZvbnQgY2xhc3M9IkFwcGxl LXN0eWxlLXNwYW4iIGZhY2U9ImFyaWFsLCBzYW5zLXNlcmlmIj48c3BhbiBjbGFzcz0iQXBwbGUt c3R5bGUtc3BhbiIgc3R5bGU9ImJvcmRlci1jb2xsYXBzZTogY29sbGFwc2U7Ij48YnI+PC9zcGFu PjwvZm9udD48L2Rpdj48ZGl2Pjxmb250IGNsYXNzPSJBcHBsZS1zdHlsZS1zcGFuIiBmYWNlPSJh cmlhbCwgc2Fucy1zZXJpZiI+PHNwYW4gY2xhc3M9IkFwcGxlLXN0eWxlLXNwYW4iIHN0eWxlPSJi b3JkZXItY29sbGFwc2U6IGNvbGxhcHNlOyI+TWljaGFlbDwvc3Bhbj48L2ZvbnQ+PC9kaXY+Cjwv ZGl2Pgo= --===============6991604591877547163==-- From michael@snoyman.com Mon Mar 15 20:33:49 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: [web-devel] Web projects wiki page Date: Mon, 15 Mar 2010 17:04:24 -0800 Message-ID: <29bf512f1003151804u16564f76md7f1d86c440f7698@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6405404838740611103==" --===============6405404838740611103== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Just wanted to give a heads up that a created the wiki page: http://haskell.org/haskellwiki/Web_Projects I put in the ideas that I've already mentioned; please go ahead and augment that list with any other ideas. Also, if someone has a good idea on how to organize the list, go ahead; I'll merge my list into any organizational system someone adds. Michael --===============6405404838740611103== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SnVzdCB3YW50ZWQgdG8gZ2l2ZSBhIGhlYWRzIHVwIHRoYXQgYSBjcmVhdGVkIHRoZSB3aWtpIHBh Z2U6PGRpdj48YnI+PC9kaXY+PGRpdj48YSBocmVmPSJodHRwOi8vaGFza2VsbC5vcmcvaGFza2Vs bHdpa2kvV2ViX1Byb2plY3RzIj5odHRwOi8vaGFza2VsbC5vcmcvaGFza2VsbHdpa2kvV2ViX1By b2plY3RzPC9hPjwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+SSBwdXQgaW4gdGhlIGlkZWFzIHRo YXQgSSYjMzk7dmUgYWxyZWFkeSBtZW50aW9uZWQ7IHBsZWFzZSBnbyBhaGVhZCBhbmQgYXVnbWVu dCB0aGF0IGxpc3Qgd2l0aCBhbnkgb3RoZXIgaWRlYXMuIEFsc28sIGlmIHNvbWVvbmUgaGFzIGEg Z29vZCBpZGVhIG9uIGhvdyB0byBvcmdhbml6ZSB0aGUgbGlzdCwgZ28gYWhlYWQ7IEkmIzM5O2xs IG1lcmdlIG15IGxpc3QgaW50byBhbnkgb3JnYW5pemF0aW9uYWwgc3lzdGVtIHNvbWVvbmUgYWRk cy48L2Rpdj4KPGRpdj48YnI+PC9kaXY+PGRpdj5NaWNoYWVsPC9kaXY+Cg== --===============6405404838740611103==-- From greg@gregorycollins.net Mon Mar 15 20:47:56 2010 From: Gregory Collins To: web-devel@haskell.org Subject: Re: [web-devel] On the state of Haskell web frameworks Date: Mon, 15 Mar 2010 21:18:33 -0400 Message-ID: <87wrxd3vyu.fsf@gregorycollins.net> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5469832339090822322==" --===============5469832339090822322== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Jeremy Shaw writes: > On Mon, Mar 15, 2010 at 5:38 PM, Gregory Collins = wrote: > > We need pluggable *applications* (blog, CMS, RSS feed generation, > administrative panels, forum, wiki, caching, user management, etc) that > understand how to talk to each other --- expecting "plug and play" > compatibility between frameworks on this level, when there's no > consensus on the *primitives*, is a pipe dream. The first framework that > cracks this particular nut, in a way that makes it easy and pleasurable > for people to build web apps that perform, is going to gain a lot of > traction. Code talks. > > I have been working on this in the happstack framework. Specially, the > idea of making possible for you to write a new application by > combining several libraries writing by different authors. > > The first issue is that the libraries need to have unique URLS that > can not collide with each other. If two libraries expect to be able to > handle, "http://localhost/submit", that will never fly. We're planning on handling this in Snap by doing what Java servlets do: you hang your component (our limp-pun code name for these is "Snaplets") somewhere on a portion of the URL tree. If you hang a servlet on "/foo" and give it request "/foo/frobnicate", the server tells you the servlet context path is "/foo" and the request path is "/frobnicate". To me this is a smart and sensible approach. > So one aim of URLT was to ensure that when you combined different > modules together, the URLs remained unique. > > http://src.seereason.com/~jeremy/SimpleSite1.html I'm not sure I'd want to use this, there's too much data being encoded at the type level here. I don't understand the fetish for wanting to verify links with a typechecking scheme anyhow; if you make the simplifying assumption that component authors can keep it together enough to keep their intra-component links organized, the only problem you really need to worry about is linking from one component into another. (I.e. "zazzle 1.7 broke all my internal links!") To me it seems more natural to solve that issue by asking zazzle to give you a link to one of its resources; i.e. take a pull vs. a push approach. If the code to pull the link to zazzle goes missing it will be obvious and you can fail loudly instead of silently. I don't know about you guys, but I think that level of assistance is enough for me -- do I have to run my website through a proof assistant? G --=20 Gregory Collins --===============5469832339090822322==-- From cmoore@wamboli.com Mon Mar 15 22:39:29 2010 From: Clint Moore To: web-devel@haskell.org Subject: Re: [web-devel] Web projects wiki page Date: Mon, 15 Mar 2010 20:10:05 -0700 Message-ID: <157577bd1003152010p4c911cafod2baf67b9dd38884@mail.gmail.com> In-Reply-To: <29bf512f1003151804u16564f76md7f1d86c440f7698@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4565033726671690193==" --===============4565033726671690193== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, Mar 15, 2010 at 6:04 PM, Michael Snoyman wrote: > Just wanted to give a heads up that a created the wiki page: > http://haskell.org/haskellwiki/Web_Projects Thanks for making that page. We have a cabal package that is at least a start on solving #1 on that list that handles Facebook and OpenID authentication plus a library for making FQL queries. I don't have a whole lot of time to spend on it at the moment, but I can make a github project to throw it into if anyone would like it 'now now now'. --===============4565033726671690193==-- From michael@snoyman.com Mon Mar 15 22:57:15 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Web projects wiki page Date: Mon, 15 Mar 2010 20:27:50 -0700 Message-ID: <29bf512f1003152027u508c181fq87b1e0784676f3a1@mail.gmail.com> In-Reply-To: <157577bd1003152010p4c911cafod2baf67b9dd38884@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7133141575031373174==" --===============7133141575031373174== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, Mar 15, 2010 at 8:10 PM, Clint Moore wrote: > On Mon, Mar 15, 2010 at 6:04 PM, Michael Snoyman > wrote: > > Just wanted to give a heads up that a created the wiki page: > > http://haskell.org/haskellwiki/Web_Projects > > Thanks for making that page. We have a cabal package that is at least > a start on solving #1 on that list that handles Facebook and OpenID > authentication plus a library for making FQL queries. I don't have a > whole lot of time to spend on it at the moment, but I can make a > github project to throw it into if anyone would like it 'now now now'. > Well, having the code out there definitely can't hurt ;). But in all reality, I won't have time to integrate that for a while, so don't stress yourself out on getting it done now. By the way, my next project will probably involve facebook integration ultimately, so thank you in advance ;). Michael --===============7133141575031373174== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gTW9uLCBNYXIgMTUsIDIwMTAgYXQg ODoxMCBQTSwgQ2xpbnQgTW9vcmUgPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWlsdG86 Y21vb3JlQHdhbWJvbGkuY29tIj5jbW9vcmVAd2FtYm9saS5jb208L2E+Jmd0Ozwvc3Bhbj4gd3Jv dGU6PGJyPjxibG9ja3F1b3RlIGNsYXNzPSJnbWFpbF9xdW90ZSIgc3R5bGU9Im1hcmdpbjowIDAg MCAuOGV4O2JvcmRlci1sZWZ0OjFweCAjY2NjIHN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2PldlbGwsIGhhdmluZyB0aGUgY29kZSBvdXQgdGhlcmUgZGVmaW5pdGVs eSBjYW4mIzM5O3QgaHVydCA7KS4gQnV0IGluIGFsbCByZWFsaXR5LCBJIHdvbiYjMzk7dCBoYXZl IHRpbWUgdG8gaW50ZWdyYXRlIHRoYXQgZm9yIGEgd2hpbGUsIHNvIGRvbiYjMzk7dCBzdHJlc3Mg eW91cnNlbGYgb3V0IG9uIGdldHRpbmcgaXQgZG9uZSBub3cuPC9kaXY+CjxkaXY+PGJyPjwvZGl2 PjxkaXY+QnkgdGhlIHdheSwgbXkgbmV4dCBwcm9qZWN0IHdpbGwgcHJvYmFibHkgaW52b2x2ZSBm YWNlYm9vayBpbnRlZ3JhdGlvbiB1bHRpbWF0ZWx5LCBzbyB0aGFuayB5b3UgaW4gYWR2YW5jZSA7 KS48L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2Pk1pY2hhZWw8L2Rpdj4K --===============7133141575031373174==-- From greg@gregorycollins.net Tue Mar 16 00:34:07 2010 From: Gregory Collins To: web-devel@haskell.org Subject: Re: [web-devel] On the state of Haskell web frameworks Date: Tue, 16 Mar 2010 01:04:44 -0400 Message-ID: <87sk80502b.fsf@gregorycollins.net> In-Reply-To: <29bf512f1003151745l29e3e92cycaa54f6fa530529@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4944440242878624960==" --===============4944440242878624960== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Michael Snoyman writes: > [F]irstly, I believe your premise is mistaken: we're not trying to > "standardize interfaces" for the most part; it's true that WAI was > such an approach, but that's not the focus of this thread. If it's not the focus, it's a recurring theme, especially in the context of multiple active efforts in that direction and postings on the list like this: > The Haskell language itself was created to consolidate fragmented > market of different FP languages. Are we ready to follow our > 'ancestors' and in their spirit do the same when it comes to > web-framework(s)? OK, obviously we're all on the same "team" here, we're all drinking the same kool-aid and there should be plenty of things we can agree upon: Haskell's not tremendously popular, there are only so many decent Haskell hackers, it would be good for us to pool our efforts and work towards common purposes. And there IS a lot of interest in and support of the idea of standardizing a web application interface for haskell: I've seen lots of positive chatter and off the top of my head I can think of at least three on Hackage, yours, Hack, and CGI. CGI has a historical reason to exist (it understands the CGI protocol) but the other two are "just plumbing". Which is fine! Plumbing is great, life would be really horrible without it. But in our case, I don't think it's necessary right now: we don't have good toilets or sewers! The marginal utility of producing a WAI/Hack adapter for our toolkit at this point in time is basically zero: we're talking about spending time making it easier to interoperate with *applications that don't exist*. In fact, the only ones I can even think of at the moment are gitit, and MAYBE the Hackage server. Chicken/egg, right? > you claim that anyone could write an adapter between two interfaces; > look at the code for hack-handler-hyena and you'll understand the > folly of that sentiment. Are you kidding? It's 164 lines of not-that-hairy code, a full third of which is a status code lookup table. (OK, I'm going to try to be less argumentative :) ) > But more to the point: because of WAI, we don't *have* to write the > adapter, This is the "M*N" VS "M+N" argument that the Rack guys make, which would be a perfectly good argument except that for us (pretty much) M=N=2. Keep in mind that WSGI (and to a lesser extent, this applies to rack) was created in the context of a bunch of webserver backends and more than half a dozen huge Python web toolkits, any one of which probably had more person-hours invested in it than all of our stuff put together. > and I don't see any substantive critiques of the WAI approach. (If > there are, we can address them by fixing the WAI.) ...and I just said I was going to try to be less argumentative. Your iteratee formulation is wrong, for starters. You picked the one the current Hyena is using, which Johan is currently in the process of abandoning because the other way is clearly better -- an explicit existential variable for the state is not as clean as the other formulation which pushes that goop down under the lambda, into a continuation. The Iteratee type from the iteratee library also has a convenient Monad instance (a big win!). I don't see that one is possible here, especially since there's no way that I can see for your iteratee to partially consume an input; how can you compose them? The Source thing is a little wacky, it should be an Enumerator instead. Again, the point of these things is that they *compose*; iteratees, which consume chunks of data, plug into enumerators, which produce them. So the request body should be an enumerator, and you process it by providing it an iteratee to read the data; the response body is an enumerator the user fills out, which plugs into an iteratee that splats it out the socket. Speaking of which, you don't define an iteratee type, given your formulation it should be: type Iteratee a = a -> ByteString -> IO (Either a a) or more generally type IterateeM m a = a -> ByteString -> m (Either a a) which is exactly the Hyena definition. The Status datatype is a mess. The requestHeader field should probably be a Map instead of an alist. RequestHeader and ResponseHeader don't need to have all of those header constructors in the datatype like that; as a result you have "ReqContentLength" which is awkward to say the least. Not to mention the fact that web application code should never have to get its hands dirty dealing with content-lengths for requests anyways; that should be handled on the enumerator level. Let's say I use the generic "RequestHeader ByteString" constructor. HTTP header names are supposed to be case-insensitive, and your Eq instance does a case-sensitive comparison: 'RequestHeader "x-foo" /= RequestHeader "X-Foo"', which is wrong; now I can't use "lookup" to pick a header out of the alist. Request has an entry for remoteHost but not remotePort. Request contains no cookies, query parameters, or POST parameters; I'm supposed to parse them myself? Users of Java servlets are snickering. I'm really not trying to badger you here (honest), I'm being hyperbolic to make a point: for nearly all of the criticisms I just made, there's room for a legitimate disagreement about what is the "best" way to approach the solution; lots of people wouldn't want to use iteratees at all, for instance! I also wouldn't expect you to rearrange the whole thing to cater to my whims or anyone else's, either. I think that if we're going to standardize, one of the following preconditions has to hold: * the standard is superior on engineering merits, solves concrete problems/enables you to get work done, and is agreeable enough to enough people that it picks up community momentum by wide consensus. * the standard is imposed by fiat, maybe because it comes from the language vendor. * the standard comes out of a standardization committee effort which hammers out disagreements over a period of time to produce something which everyone can stomach --- I'd actually be pretty okay with this if it happened, but there's a reason "design by committee" is a perjorative. * the standard comes about as a result of market forces, i.e. blub toolkit becomes really popular and a standard emerges because everyone wants to interoperate with blub. Honestly, I just don't any of these things happening, not right now. > Now, let me try to understand your point here: we need standardized > interfaces for applications to communicate with each other, but we > can't do that until we have the low level interfaces hammered out. No, you're misrepresenting me here. What I said is that "we need pluggable applications that understand how talk to each other", NOT that those interfaces should be subject to standardization. There's a critical distinction there; you don't expect Django components to plug into a Zope app. > On the other hand, you say that it's premature to try to standardize > interfaces. And then you make it clear that the use case of many > people (shared hosting) doesn't interest you at all; based on previous > conversations, I believe this means that Snap will have *no* (Fast)CGI > support. I wouldn't say that's necessarily true in the long term, although it's probably true that I myself am not likely to write it. FastCGI support is definitely not important to me, but if someone wanted it badly enough there's nothing in Snap (as of this moment) which would preclude her from writing whichever backend she wanted: CGI, WAI, Hack, whatever. That said, I'd be 100% a-ok with sacrificing CGI support specifically, because spawning a fresh process every time you want to service a request is, frankly, dumb and absurdly limiting. It isn't 1996 anymore. > I think (correct me if I'm wrong) that everyone else here is in > agreement that the goal should not be to create a great framework that > will solve everyone's needs. I do agree with this; my point all long has been that no one web library is going to satisfy everyone any more than one parsing combinator library or one regular expression library or one database could. I'm aiming to help create a great framework that satisfies my needs, and if it works for other people too: great. > The goal should be to create great libraries that can be used > independently. ..but not necessarily this, at least not in the broader context of "people writing web applications". Obviously I agree in general terms: self-contained, single-purpose libraries are great. There's no reason to have a bunch of competing libraries to parse and output RSS, for instance. A productive *web framework*, on the other hand, by its nature makes a whole set of "convention over configuration" assumptions about how requests are handled and routed, how data is accessed, how users are managed, how to hook into an admin panel, how templates are laid out on disk, which template system to ship out of the box, how components are specified, how they talk to each other etc etc etc. I see the future being a lot like the present, where a heterogeneous collection of frameworks of varying comprehensiveness and quality provide their own self-contained ecosystems. G. -- Gregory Collins --===============4944440242878624960==-- From cjs@starling-software.com Tue Mar 16 00:54:48 2010 From: Curt Sampson To: web-devel@haskell.org Subject: Re: [web-devel] On the state of Haskell web frameworks Date: Tue, 16 Mar 2010 14:25:23 +0900 Message-ID: <20100316052522.GU4400@poetic.cynic.net> In-Reply-To: <87sk80502b.fsf@gregorycollins.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7363441051131835308==" --===============7363441051131835308== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 2010-03-16 01:04 -0400 (Tue), Gregory Collins wrote: > And there IS a lot of interest in and support of the idea of > standardizing a web application interface for haskell... Speaking as someone who spent ten years doing more web applications than he cares to think about, and having written a web application framework, I'd like to make a couple of points about this. I think that the ideal "interface" is something that gives you a web request extremly close to exactly how it came in to the web server, and let you send what is essentially a raw response. This allows developers to work with that directly, if they chose, or use a library interfaces with that, does whatever parsing and other things it cares to, and presents some other interface on the other side of that. If the world could work in such a way we'd probably have several different libraries to provide varoius interfaces, including a CGI-like interface, and the world would be a happy place. Unfortunately, the world doesn't actually work that way. Interfaces (and their associated protocols) such as CGI, SCGI, FastCGI and AJP don't present the raw web request; instead they do a large amount of parsing and modification of the request; exactly how this is done varies not only with the implementation but with the web server configuration. Some of the things passed via this protocol, such as SCRIPT_NAME and PATH_TRANSLATED, often don't make sense in the context of a single application running behind a web server. Others, such as PATH_INFO, will have different values for the same URL depending on the web server configuration. Other information is missing entirely. For example, most of these protocols don't even give you the URL that was used; if you want it you have to try to reconsruct it using your best guess about the web server configuration. Unfortunately, I don't really have a good solution to this. The best I can come up with is to have a simple, standard inteface that delivers essentially the raw request for use with web servers written in Haskell and suggest that anybody who wants to use a different web server just use it as a proxy. It would be possible to provide libraries that try to take, e.g., a FastCGI request and turn it back into the raw request, but this can't be done very reliably. cjs -- Curt Sampson +81 90 7737 2974 http://www.starling-software.com The power of accurate observation is commonly called cynicism by those who have not got it. --George Bernard Shaw --===============7363441051131835308==-- From michael@snoyman.com Tue Mar 16 01:03:51 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] On the state of Haskell web frameworks Date: Mon, 15 Mar 2010 22:34:26 -0700 Message-ID: <29bf512f1003152234x321ab01bnb9409be98c494a2f@mail.gmail.com> In-Reply-To: <87sk80502b.fsf@gregorycollins.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6635145086046712681==" --===============6635145086046712681== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, Mar 15, 2010 at 10:04 PM, Gregory Collins wrote: > Michael Snoyman writes: > > > [F]irstly, I believe your premise is mistaken: we're not trying to > > "standardize interfaces" for the most part; it's true that WAI was > > such an approach, but that's not the focus of this thread. > > If it's not the focus, it's a recurring theme, especially in the context > of multiple active efforts in that direction and postings on the list > like this: > > > The Haskell language itself was created to consolidate fragmented > > market of different FP languages. Are we ready to follow our > > 'ancestors' and in their spirit do the same when it comes to > > web-framework(s)? > > OK, obviously we're all on the same "team" here, we're all drinking the > same kool-aid and there should be plenty of things we can agree upon: > Haskell's not tremendously popular, there are only so many decent > Haskell hackers, it would be good for us to pool our efforts and work > towards common purposes. And there IS a lot of interest in and support > of the idea of standardizing a web application interface for haskell: > I've seen lots of positive chatter and off the top of my head I can > think of at least three on Hackage, yours, Hack, and CGI. > > CGI has a historical reason to exist (it understands the CGI protocol) > but the other two are "just plumbing". Which is fine! Plumbing is > great, life would be really horrible without it. But in our case, I > don't think it's necessary right now: we don't have good toilets or > sewers! The marginal utility of producing a WAI/Hack adapter for our > toolkit at this point in time is basically zero: we're talking about > spending time making it easier to interoperate with *applications that > don't exist*. In fact, the only ones I can even think of at the moment > are gitit, and MAYBE the Hackage server. Chicken/egg, right? > > I don't think it's really fair to put CGI in the same category, and the Hack/WAI issue is well documented: Hack is simple, WAI is performant. However, let me address the meat of your claim: even though you don't see the value, doesn't mean there is none. I'm able to write an application against the WAI and test it locally with the SimpleServer, then deploy it with CGI. That by itself justifies its existence for me. > > > you claim that anyone could write an adapter between two interfaces; > > look at the code for hack-handler-hyena and you'll understand the > > folly of that sentiment. > > Are you kidding? It's 164 lines of not-that-hairy code, a full third of > which is a status code lookup table. (OK, I'm going to try to be less > argumentative :) ) > > It wasn't the line count I was talking about: it requires spawning a separate thread to convert the Enumerator to a lazy bytestring. > > > But more to the point: because of WAI, we don't *have* to write the > > adapter, > > This is the "M*N" VS "M+N" argument that the Rack guys make, which would > be a perfectly good argument except that for us (pretty much) > M=N=2. Keep in mind that WSGI (and to a lesser extent, this applies to > rack) was created in the context of a bunch of webserver backends and > more than half a dozen huge Python web toolkits, any one of which > probably had more person-hours invested in it than all of our stuff put > together. > > > I don't really see your point here. > > and I don't see any substantive critiques of the WAI approach. (If > > there are, we can address them by fixing the WAI.) > > ...and I just said I was going to try to be less argumentative. > > Your iteratee formulation is wrong, for starters. You picked the one the > current Hyena is using, which Johan is currently in the process of > abandoning because the other way is clearly better -- an explicit > existential variable for the state is not as clean as the other > formulation which pushes that goop down under the lambda, into a > continuation. The Iteratee type from the iteratee library also has a > convenient Monad instance (a big win!). I don't see that one is possible > here, especially since there's no way that I can see for your iteratee > to partially consume an input; how can you compose them? > > The Source thing is a little wacky, it should be an Enumerator > instead. Again, the point of these things is that they *compose*; > iteratees, which consume chunks of data, plug into enumerators, which > produce them. So the request body should be an enumerator, and you > process it by providing it an iteratee to read the data; the response > body is an enumerator the user fills out, which plugs into an iteratee > that splats it out the socket. > > So, instead of speaking rhetoric, can you give a concrete example where the Source is *bad*? It has serious benefits over Enumerator, such as the ability to convert (via unsafeInterleaveIO) into a lazy bytestring. I'm happy to see a better approach, why not give me a datatype for the "obviously better" Enumerator? (Hint: releasing no code and using phrases like "clearly better" are not going to win any arguments.) > Speaking of which, you don't define an iteratee type, given your > formulation it should be: > > type Iteratee a = a -> ByteString -> IO (Either a a) > > or more generally > > type IterateeM m a = a -> ByteString -> m (Either a a) > > which is exactly the Hyena definition. > The Status datatype is a mess. The requestHeader field should probably > be a Map instead of an alist. RequestHeader and ResponseHeader don't > need to have all of those header constructors in the datatype like that; > as a result you have "ReqContentLength" which is awkward to say the > least. Not to mention the fact that web application code should never > have to get its hands dirty dealing with content-lengths for requests > anyways; that should be handled on the enumerator level. > > That just shows a misunderstanding on your part: the content-lengths are *not* handled at the application level, though the information is available to the application. Why would I censor it? And would you care to elaborate on "Status datatype is a mess"? > Let's say I use the generic "RequestHeader ByteString" constructor. HTTP > header names are supposed to be case-insensitive, and your Eq instance > does a case-sensitive comparison: 'RequestHeader "x-foo" /= > RequestHeader "X-Foo"', which is wrong; now I can't use "lookup" to pick > a header out of the alist. > > This is a valid concern. However, my goal in that decision is to keep things as close to the wire as possible. On the wire, x-foo and X-Foo are different. You also are conveniently ignoring all character encoding issues. True, HTTP has a character encoding defined, but do you trust ever web client in the world to respect all this? > Request has an entry for remoteHost but not remotePort. Request contains > no cookies, query parameters, or POST parameters; I'm supposed to parse > them myself? Users of Java servlets are snickering. > > Yes, you are. You clearly have a misunderstanding about what WAI is about (or are just trying to attack baselessly): it's meant to represent the raw data. (And if anyone wants remotePort for any reason, let me know. I have yet to see a need for it, and no one has asked.) > > I'm really not trying to badger you here (honest), I'm being hyperbolic > to make a point: for nearly all of the criticisms I just made, there's > room for a legitimate disagreement about what is the "best" way to > approach the solution; lots of people wouldn't want to use iteratees at > all, for instance! I also wouldn't expect you to rearrange the whole > thing to cater to my whims or anyone else's, either. > > I think that if we're going to standardize, one of the following > preconditions has to hold: > > * the standard is superior on engineering merits, solves concrete > problems/enables you to get work done, and is agreeable enough to > enough people that it picks up community momentum by wide > consensus. > > * the standard is imposed by fiat, maybe because it comes from the > language vendor. > > * the standard comes out of a standardization committee effort which > hammers out disagreements over a period of time to produce something > which everyone can stomach --- I'd actually be pretty okay with this > if it happened, but there's a reason "design by committee" is a > perjorative. > > * the standard comes about as a result of market forces, i.e. blub > toolkit becomes really popular and a standard emerges because > everyone wants to interoperate with blub. > > Honestly, I just don't any of these things happening, not right now. > > > Don't worry, I won't ask you to join the standardization committee ;). > > Now, let me try to understand your point here: we need standardized > > interfaces for applications to communicate with each other, but we > > can't do that until we have the low level interfaces hammered out. > > No, you're misrepresenting me here. What I said is that "we need > pluggable applications that understand how talk to each other", NOT that > those interfaces should be subject to standardization. There's a > critical distinction there; you don't expect Django components to plug > into a Zope app. > > > > On the other hand, you say that it's premature to try to standardize > > interfaces. And then you make it clear that the use case of many > > people (shared hosting) doesn't interest you at all; based on previous > > conversations, I believe this means that Snap will have *no* (Fast)CGI > > support. > > I wouldn't say that's necessarily true in the long term, although it's > probably true that I myself am not likely to write it. FastCGI support > is definitely not important to me, but if someone wanted it badly enough > there's nothing in Snap (as of this moment) which would preclude her > from writing whichever backend she wanted: CGI, WAI, Hack, > whatever. That said, I'd be 100% a-ok with sacrificing CGI support > specifically, because spawning a fresh process every time you want to > service a request is, frankly, dumb and absurdly limiting. It isn't 1996 > anymore. > > > > I think (correct me if I'm wrong) that everyone else here is in > > agreement that the goal should not be to create a great framework that > > will solve everyone's needs. > > I do agree with this; my point all long has been that no one web library > is going to satisfy everyone any more than one parsing combinator > library or one regular expression library or one database could. I'm > aiming to help create a great framework that satisfies my needs, and if > it works for other people too: great. > > > > The goal should be to create great libraries that can be used > > independently. > > ..but not necessarily this, at least not in the broader context of > "people writing web applications". Obviously I agree in general terms: > self-contained, single-purpose libraries are great. There's no reason to > have a bunch of competing libraries to parse and output RSS, for > instance. > > A productive *web framework*, on the other hand, by its nature makes a > whole set of "convention over configuration" assumptions about how > requests are handled and routed, how data is accessed, how users are > managed, how to hook into an admin panel, how templates are laid out on > disk, which template system to ship out of the box, how components are > specified, how they talk to each other etc etc etc. I see the future > being a lot like the present, where a heterogeneous collection of > frameworks of varying comprehensiveness and quality provide their own > self-contained ecosystems. > > Michael --===============6635145086046712681== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gTW9uLCBNYXIgMTUsIDIwMTAgYXQg MTA6MDQgUE0sIEdyZWdvcnkgQ29sbGlucyA8c3BhbiBkaXI9Imx0ciI+Jmx0OzxhIGhyZWY9Im1h aWx0bzpncmVnQGdyZWdvcnljb2xsaW5zLm5ldCI+Z3JlZ0BncmVnb3J5Y29sbGlucy5uZXQ8L2E+ Jmd0Ozwvc3Bhbj4gd3JvdGU6PGJyPjxibG9ja3F1b3RlIGNsYXNzPSJnbWFpbF9xdW90ZSIgc3R5 bGU9Im1hcmdpbjowIDAgMCAuOGV4O2JvcmRlci1sZWZ0OjFweCAjY2NjIHNvbGlkO3BhZGRpbmct bGVmdDoxZXg7Ij4KTWljaGFlbCBTbm95bWFuICZsdDs8YSBocmVmPSJtYWlsdG86bWljaGFlbEBz bm95bWFuLmNvbSI+bWljaGFlbEBzbm95bWFuLmNvbTwvYT4mZ3Q7IHdyaXRlczo8YnI+Cjxicj4K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G8gcGFyc2UgYW5kIG91dHB1dCBSU1MsIGZvcjxicj4KaW5zdGFuY2UuPGJyPgo8YnI+ CkEgcHJvZHVjdGl2ZSAqd2ViIGZyYW1ld29yayosIG9uIHRoZSBvdGhlciBoYW5kLCBieSBpdHMg bmF0dXJlIG1ha2VzIGE8YnI+Cndob2xlIHNldCBvZiAmcXVvdDtjb252ZW50aW9uIG92ZXIgY29u ZmlndXJhdGlvbiZxdW90OyBhc3N1bXB0aW9ucyBhYm91dCBob3c8YnI+CnJlcXVlc3RzIGFyZSBo YW5kbGVkIGFuZCByb3V0ZWQsIGhvdyBkYXRhIGlzIGFjY2Vzc2VkLCBob3cgdXNlcnMgYXJlPGJy PgptYW5hZ2VkLCBob3cgdG8gaG9vayBpbnRvIGFuIGFkbWluIHBhbmVsLCBob3cgdGVtcGxhdGVz IGFyZSBsYWlkIG91dCBvbjxicj4KZGlzaywgd2hpY2ggdGVtcGxhdGUgc3lzdGVtIHRvIHNoaXAg b3V0IG9mIHRoZSBib3gsIGhvdyBjb21wb25lbnRzIGFyZTxicj4Kc3BlY2lmaWVkLCBob3cgdGhl eSB0YWxrIHRvIGVhY2ggb3RoZXIgZXRjIGV0YyBldGMuIEkgc2VlIHRoZSBmdXR1cmU8YnI+CmJl aW5nIGEgbG90IGxpa2UgdGhlIHByZXNlbnQsIHdoZXJlIGEgaGV0ZXJvZ2VuZW91cyBjb2xsZWN0 aW9uIG9mPGJyPgpmcmFtZXdvcmtzIG9mIHZhcnlpbmcgY29tcHJlaGVuc2l2ZW5lc3MgYW5kIHF1 YWxpdHkgcHJvdmlkZSB0aGVpciBvd248YnI+CnNlbGYtY29udGFpbmVkIGVjb3N5c3RlbXMuPGJy Pjxicj48L2Jsb2NrcXVvdGU+PGRpdj48YnI+PC9kaXY+PGRpdj5NaWNoYWVswqA8L2Rpdj48L2Rp dj4K --===============6635145086046712681==-- From greg@gregorycollins.net Tue Mar 16 01:32:32 2010 From: Gregory Collins To: web-devel@haskell.org Subject: Re: [web-devel] On the state of Haskell web frameworks Date: Tue, 16 Mar 2010 02:03:05 -0400 Message-ID: <87fx404xd2.fsf@gregorycollins.net> In-Reply-To: <20100316052522.GU4400@poetic.cynic.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7051891373036385248==" --===============7051891373036385248== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Curt Sampson writes: > I think that the ideal "interface" is something that gives you a web > request extremly close to exactly how it came in to the web server, and > let you send what is essentially a raw response. This allows developers > to work with that directly, if they chose, or use a library interfaces > with that, does whatever parsing and other things it cares to, and > presents some other interface on the other side of that. > > If the world could work in such a way we'd probably have several > different libraries to provide varoius interfaces, including a CGI-like > interface, and the world would be a happy place. > > Unfortunately, the world doesn't actually work that way. Interfaces (and > their associated protocols) such as CGI, SCGI, FastCGI and AJP don't > present the raw web request; instead they do a large amount of parsing > and modification of the request; exactly how this is done varies not > only with the implementation but with the web server configuration. > I think I agree with you completely. The question is: where do you draw the lines? You probably want transfer-encodings handled for you, but what about POST data? In Snap right now we detect requests with mime type "application/x-www-form-urlencoded" and parse them for you -- IMO why on earth would you want anything else? But I'm sure there are people who wouldn't be comfortable with that behaviour. Another example: we treat responses differently based on whether you explicitly set a content length or not. If the connection is HTTP/1.0, and you don't set a content length, we have to set "Connection: close" in the response headers and close the socket when we're finished sending the response, because otherwise the client has no way of knowing when the stream ends. If the connection is HTTP/1.1 and there's no content length, we set "Transfer-encoding: chunked" and encode the response body accordingly. If there is a content-length, we use it, because it's a few bytes cheaper. How much of that sort of logic goes into the interface layer? What guarantees does an application written on (for example) the WAI interface receive about what the web server will or will not touch? G. -- Gregory Collins --===============7051891373036385248==-- From mightybyte@gmail.com Tue Mar 16 01:39:30 2010 From: MightyByte To: web-devel@haskell.org Subject: [web-devel] Re: On the state of Haskell web frameworks Date: Tue, 16 Mar 2010 06:06:38 +0000 Message-ID: In-Reply-To: <29bf512f1003152234x321ab01bnb9409be98c494a2f@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3880656571185998459==" --===============3880656571185998459== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Michael Snoyman writes: > On Mon, Mar 15, 2010 at 10:04 PM, Gregory Collins wrote: > Michael Snoyman snoyman.com> writes: > > But more to the point: because of WAI, we don't *have* to write the > > adapter, > This is the "M*N" VS "M+N" argument that the Rack guys make, which would > be a perfectly good argument except that for us (pretty much) > M=N=2. Keep in mind that WSGI (and to a lesser extent, this applies to > rack) was created in the context of a bunch of webserver backends and > more than half a dozen huge Python web toolkits, any one of which > probably had more person-hours invested in it than all of our stuff put > together. > > > > I don't really see your point here. I think I would characterize the core difference between Greg's and Michael's approaches to be this: Michael = Waterfall Greg = Agile Although there may also be some minor differences in the scope that they're talking about regarding a wai. --===============3880656571185998459==-- From cjs@starling-software.com Tue Mar 16 01:51:40 2010 From: Curt Sampson To: web-devel@haskell.org Subject: Re: [web-devel] On the state of Haskell web frameworks Date: Tue, 16 Mar 2010 15:22:15 +0900 Message-ID: <20100316062215.GW4400@poetic.cynic.net> In-Reply-To: <87fx404xd2.fsf@gregorycollins.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6136350719551364970==" --===============6136350719551364970== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 2010-03-16 02:03 -0400 (Tue), Gregory Collins wrote: > I think I agree with you completely. The question is: where do you > draw the lines? I like to draw the real line, as best as possible, at "do the minimal possible processing to the request" and let users chose a library to process the request and handle as much as possible. Let me expand on your examples, offering examples of reasonable situations in which one wants the opposite behaviour of your (also reasonable!) situations. > You probably want transfer-encodings handled for you.... Let's say on my server I store a lot of static content in gzip'd form. In this case, I certainly want to be handling the transfer-encoding myself, because I don't want to uncompress my compressed copy to send it to the server, only so that the server can compress it again as it sends it. > Another example: we treat responses differently based on whether you > explicitly set a content length or not. If the connection is HTTP/1.0, > and you don't set a content length, we have to set "Connection: close" > in the response headers and close the socket when we're finished > sending the response.... Another approach would be to have interface library buffer the response as it's being generated and, when it's complete, calculate the content length and pass it on to the web server. In the case of a web server doing a lot of relatively small requests, this would probably be considerably more efficient. But of course you still need to the ability to send out the response as it's being generated for large responses that quickly produce some data, but take a relatively long time to produce all of the data. > How much of that sort of logic goes into the interface layer? I'm not sure what you mean by "interface layer," but I feel that, as much as possible, that sort of logic should be in standalone libraries that go between the "standard" web server interface and the user application. cjs -- Curt Sampson +81 90 7737 2974 http://www.starling-software.com The power of accurate observation is commonly called cynicism by those who have not got it. --George Bernard Shaw --===============6136350719551364970==-- From greg@gregorycollins.net Tue Mar 16 02:28:26 2010 From: Gregory Collins To: web-devel@haskell.org Subject: Re: [web-devel] On the state of Haskell web frameworks Date: Tue, 16 Mar 2010 02:59:01 -0400 Message-ID: <877hpc4uru.fsf@gregorycollins.net> In-Reply-To: <20100316062215.GW4400@poetic.cynic.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6515158670028183650==" --===============6515158670028183650== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Curt Sampson writes: > Let's say on my server I store a lot of static content in gzip'd form. > In this case, I certainly want to be handling the transfer-encoding > myself, because I don't want to uncompress my compressed copy to send > it to the server, only so that the server can compress it again as it > sends it. I think you're confusing content-encoding and transfer-encoding here. Servers shouldn't be arbitrarily mucking around with your content-encoding. >> Another example: we treat responses differently based on whether you >> explicitly set a content length or not. If the connection is HTTP/1.0, >> and you don't set a content length, we have to set "Connection: close" >> in the response headers and close the socket when we're finished >> sending the response.... > > Another approach would be to have interface library buffer the response > as it's being generated and, when it's complete, calculate the content > length and pass it on to the web server. In the case of a web server > doing a lot of relatively small requests, this would probably be > considerably more efficient. But of course you still need to the ability > to send out the response as it's being generated for large responses > that quickly produce some data, but take a relatively long time to > produce all of the data. This breaks "being able to stream in O(1) space", so it's out. Concrete examples: comet, internet radio, etc. >> How much of that sort of logic goes into the interface layer? > > I'm not sure what you mean by "interface layer," but I feel that, as > much as possible, that sort of logic should be in standalone libraries > that go between the "standard" web server interface and the user > application. By "interface layer" for the purposes of this conversation I mean roughly the level of abstraction that Hack/WAI/WSGI/Rack/Java Servlets are inhabiting. G -- Gregory Collins --===============6515158670028183650==-- From cjs@starling-software.com Tue Mar 16 03:17:37 2010 From: Curt Sampson To: web-devel@haskell.org Subject: Re: [web-devel] On the state of Haskell web frameworks Date: Tue, 16 Mar 2010 16:48:13 +0900 Message-ID: <20100316074812.GE4400@poetic.cynic.net> In-Reply-To: <877hpc4uru.fsf@gregorycollins.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0418805938481365790==" --===============0418805938481365790== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 2010-03-16 02:59 -0400 (Tue), Gregory Collins wrote: > Curt Sampson writes: > > I think you're confusing content-encoding and transfer-encoding here. Yup. Oops, sorry. > > Another approach would be to have interface library buffer the response > > as it's being generated and, when it's complete, calculate the content > > length and pass it on to the web server. > > This breaks "being able to stream in O(1) space", so it's out. Concrete > examples: comet, internet radio, etc. Having *the option* to do this for efficiency does not break streaming. Only forcing everyone to use this would do that. My point is, if you provide only one way of doing things, you can end up in a situation where some applications will still work, but be a lot more inefficient than they would be otherwise. > By "interface layer" for the purposes of this conversation I mean > roughly the level of abstraction that Hack/WAI/WSGI/Rack/Java Servlets > are inhabiting. Ah, well this is what I'm saying: that should ideally be part of a standalone library that translates between the web applicaton and the protocol you use to talk to the server. cjs -- Curt Sampson +81 90 7737 2974 http://www.starling-software.com The power of accurate observation is commonly called cynicism by those who have not got it. --George Bernard Shaw --===============0418805938481365790==-- From jeremy@n-heptane.com Tue Mar 16 03:45:24 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Web projects wiki page Date: Tue, 16 Mar 2010 03:15:58 -0500 Message-ID: In-Reply-To: <29bf512f1003152027u508c181fq87b1e0784676f3a1@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8113349197890175080==" --===============8113349197890175080== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, Mar 15, 2010 at 10:27 PM, Michael Snoyman wrote: > > By the way, my next project will probably involve facebook integration > ultimately, so thank you in advance ;). > > You might want to look at the happstack-facebook library. It has support for facebook Connect and support for calling the facebook API. It is a little bit happstack specific, but I am trying to factor those portions out into a separate library. - jeremy --===============8113349197890175080== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gTW9uLCBNYXIgMTUsIDIwMTAgYXQgMTA6MjcgUE0sIE1pY2hhZWwgU25veW1hbiA8c3BhbiBk aXI9Imx0ciI+Jmx0OzxhIGhyZWY9Im1haWx0bzptaWNoYWVsQHNub3ltYW4uY29tIj5taWNoYWVs QHNub3ltYW4uY29tPC9hPiZndDs8L3NwYW4+IHdyb3RlOjxicj48ZGl2IGNsYXNzPSJnbWFpbF9x dW90ZSI+PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0ibWFyZ2luOjAgMCAw IC44ZXg7Ym9yZGVyLWxlZnQ6MXB4ICNjY2Mgc29saWQ7cGFkZGluZy1sZWZ0OjFleDsiPgo8ZGl2 IGNsYXNzPSJpbSI+PGJyPjwvZGl2PjxkaXY+QnkgdGhlIHdheSwgbXkgbmV4dCBwcm9qZWN0IHdp bGwgcHJvYmFibHkgaW52b2x2ZSBmYWNlYm9vayBpbnRlZ3JhdGlvbiB1bHRpbWF0ZWx5LCBzbyB0 aGFuayB5b3UgaW4gYWR2YW5jZSA7KS48L2Rpdj48ZGl2Pjxicj48L2Rpdj48L2Jsb2NrcXVvdGU+ PGRpdj48YnI+PC9kaXY+PGRpdj5Zb3UgbWlnaHQgd2FudCB0byBsb29rIGF0IHRoZSBoYXBwc3Rh Y2stZmFjZWJvb2sgbGlicmFyeS4gSXQgaGFzIHN1cHBvcnQgZm9yIGZhY2Vib29rIENvbm5lY3Qg YW5kIHN1cHBvcnQgZm9yIGNhbGxpbmcgdGhlIGZhY2Vib29rIEFQSS4gSXQgaXMgYSBsaXR0bGUg Yml0IGhhcHBzdGFjayBzcGVjaWZpYywgYnV0IEkgYW0gdHJ5aW5nIHRvIGZhY3RvciB0aG9zZSBw b3J0aW9ucyBvdXQgaW50byBhIHNlcGFyYXRlIGxpYnJhcnkuoDwvZGl2Pgo8ZGl2Pjxicj48L2Rp dj48ZGl2Pi0gamVyZW15PC9kaXY+PGRpdj6gPC9kaXY+PC9kaXY+Cg== --===============8113349197890175080==-- From chris@eidhof.nl Tue Mar 16 04:21:33 2010 From: Chris Eidhof To: web-devel@haskell.org Subject: [web-devel] Type-safe URL handling Date: Tue, 16 Mar 2010 09:52:06 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0512146801868357287==" --===============0512146801868357287== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hey everyone, I just wrote down some of my ideas about type-safe URL handling on github, it= 's at http://gist.github.com/333769 I think it's similar to what Jeremy is doing with his urlt package [1]. -chris [1]: http://src.seereason.com/~jeremy/SimpleSite1.html --===============0512146801868357287==-- From jeremy@n-heptane.com Tue Mar 16 08:59:44 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Tue, 16 Mar 2010 08:29:18 -0500 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6228470599806903732==" --===============6228470599806903732== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hello, It looks nearly identical, but without the URLT monad transformer. Instead of ToURL I have the class: class AsURL a where toURLS :: a -> ShowS fromURLC :: Consumer String (Failing a) With is basically the same. Except toURLS returns a ShowS instead of [String]. fromURLC consumes a list of [String]. These functions are wrapped up to provide: toURL :: (AsURL a) => a -> String fromURL :: (AsURL a) => String -> Failing a I do not have generics based url printing/parsing, but there is no reason it could not be added. I do have template haskell based code though. http://src.seereason.com/urlt/URLT/TH.hs The thing you don't have is the URLT monad transformer: http://src.seereason.com/urlt/URLT/Base.hs Here is why you want it. Imagine you write an image gallery library: data ImageURL = Upload | ViewImage Int when you call toURL, you are going to get urls like, /Upload, /ViewImage/1, etc. Now let's say I try to use your library in my application. So at first I try: data MyApp = Upload | FooBar But when a URL comes in, how do I know if I should decode it as MyApp or ImageURL? Do I try both and see which one succeeds? Except we both have a constructor Upload, so both will succeed. There is no way to tell with Upload the path "/Upload" is referring to. So now I try: data MyApp = Upload | FooBar | Images ImageURL now I know that all incoming urls are decoded as MyApp. But there is still a problem. In my code I could write: toUrl (Images (ViewImage 1)) but in your library code, you don't know anything about the Images constructor. So you just call, toURL (ViewImage 1) which generates /ViewImage/1 instead of the required /Images/ViewImage/1. What I need is someway to tell your library code what prefix to add at the beginning. That is exactly what the URLT monad does. It just holds a function that adds a prefix to the URL. so in your library you have: image :: ImageURL -> URLT ImageURL m () image Upload = do ... u <- showURL (ViewImage n) ... image (ViewImage num) = ... Instead of calling toURL, it calls showURL, which adds the context to the URL and then calls toURL on it. And in my code I have: myApp :: MyAPP -> URLT MyApp m () mpApp Upload = ... myApp FooBar = ... myApp (Images subURL) = nestURL Images $ images subURL the 'nextURL Images' adds the Images context to the URLT environment. It can be used to nest multiple levels if needed: nestURL A $ nestURL B $ nestURL Images $ showURL (ViewImage 1) would get turned into something like: "/A/B/Images/ViewImage/1" What do you think? - jeremy On Tue, Mar 16, 2010 at 3:52 AM, Chris Eidhof wrote: > Hey everyone, > > I just wrote down some of my ideas about type-safe URL handling on github, > it's at http://gist.github.com/333769 > > I think it's similar to what Jeremy is doing with his urlt package [1]. > > -chris > > [1]: http://src.seereason.com/~jeremy/SimpleSite1.html > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > --===============6228470599806903732== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SGVsbG8sPGRpdj48YnI+PC9kaXY+PGRpdj5JdCBsb29rcyBuZWFybHkgaWRlbnR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mby93ZWItZGV2ZWw8L2E+PGJyPgo8L2Jsb2NrcXVvdGU+PC9kaXY+PGJyPjwvZGl2Pgo= --===============6228470599806903732==-- From chris@eidhof.nl Tue Mar 16 09:34:12 2010 From: Chris Eidhof To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Tue, 16 Mar 2010 15:04:45 +0100 Message-ID: <08575CA8-51FD-4145-B7F7-E19621A2D9EC@eidhof.nl> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0692201597467014466==" --===============0692201597467014466== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable I have the feeling it adds a lot of complexity. I agree with you that, if you= want modularity, your components should only provide relative URLs and need = to be parameterized over how to build an absolute URL. I didn't think of that= problem, and using a custom monad transformer is definitely a solution. However, I'm always hesitant to build up stacks of monad transformers, it add= s a lot of complexity. I would rather use something like typeclass, but I'm n= ot sure yet how to do that. -chris On 16 mrt 2010, at 14:29, Jeremy Shaw wrote: > Hello, >=20 > It looks nearly identical, but without the URLT monad transformer.=20 >=20 > Instead of ToURL I have the class: >=20 > class AsURL a where > toURLS :: a -> ShowS > fromURLC :: Consumer String (Failing a) >=20 > With is basically the same. Except toURLS returns a ShowS instead of [Strin= g]. fromURLC consumes a list of [String]. These functions are wrapped up to p= rovide: >=20 > toURL :: (AsURL a) =3D> a -> String > fromURL :: (AsURL a) =3D> String -> Failing a >=20 > I do not have generics based url printing/parsing, but there is no reason i= t could not be added. I do have template haskell based code though.=20 >=20 > http://src.seereason.com/urlt/URLT/TH.hs >=20 > The thing you don't have is the URLT monad transformer: >=20 > http://src.seereason.com/urlt/URLT/Base.hs >=20 > Here is why you want it. Imagine you write an image gallery library: >=20 > data ImageURL =3D Upload | ViewImage Int >=20 > when you call toURL, you are going to get urls like, /Upload, /ViewImage/1,= etc. >=20 > Now let's say I try to use your library in my application. So at first I tr= y: >=20 > data MyApp =3D Upload | FooBar >=20 > But when a URL comes in, how do I know if I should decode it as MyApp or Im= ageURL? Do I try both and see which one succeeds? Except we both have a const= ructor Upload, so both will succeed. There is no way to tell with Upload the = path "/Upload" is referring to. >=20 > So now I try: >=20 > data MyApp =3D Upload | FooBar | Images ImageURL >=20 > now I know that all incoming urls are decoded as MyApp. But there is still = a problem. In my code I could write: >=20 > toUrl (Images (ViewImage 1)) >=20 > but in your library code, you don't know anything about the Images construc= tor. So you just call, >=20 > toURL (ViewImage 1) >=20 > which generates /ViewImage/1 instead of the required /Images/ViewImage/1. >=20 > What I need is someway to tell your library code what prefix to add at the = beginning. That is exactly what the URLT monad does. It just holds a function= that adds a prefix to the URL. >=20 > so in your library you have: >=20 > image :: ImageURL -> URLT ImageURL m () > image Upload =3D=20 > do ... > u <- showURL (ViewImage n) > ... > image (ViewImage num) =3D ... >=20 > Instead of calling toURL, it calls showURL, which adds the context to the U= RL and then calls toURL on it. >=20 > And in my code I have: >=20 > myApp :: MyAPP -> URLT MyApp m () > mpApp Upload =3D ... > myApp FooBar =3D ... > myApp (Images subURL) =3D nestURL Images $ images subURL=20 >=20 > the 'nextURL Images' adds the Images context to the URLT environment. It ca= n be used to nest multiple levels if needed: >=20 > nestURL A $ nestURL B $ nestURL Images $ showURL (ViewImage 1)=20 >=20 > would get turned into something like: >=20 > "/A/B/Images/ViewImage/1" >=20 > What do you think? >=20 > - jeremy >=20 >=20 > On Tue, Mar 16, 2010 at 3:52 AM, Chris Eidhof wrote: > Hey everyone, >=20 > I just wrote down some of my ideas about type-safe URL handling on github, = it's at http://gist.github.com/333769 >=20 > I think it's similar to what Jeremy is doing with his urlt package [1]. >=20 > -chris >=20 > [1]: http://src.seereason.com/~jeremy/SimpleSite1.html >=20 > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel >=20 --===============0692201597467014466==-- From michael@snoyman.com Tue Mar 16 10:46:05 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Tue, 16 Mar 2010 08:16:42 -0700 Message-ID: <29bf512f1003160816gc5ee59fwc794fcb7fca1d6c6@mail.gmail.com> In-Reply-To: <08575CA8-51FD-4145-B7F7-E19621A2D9EC@eidhof.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0722773310412284863==" --===============0722773310412284863== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit These approaches will definitely work, but I'm worried that creating a whole set of datatypes to represent URLs is overkill. In Yesod (I'm sure many of you have seen) I use quasi-quoting for defining the resources, like such: [$mkResources| /user: GET: userList /user/find/#userid GET: userFind /user/name/$username GET: userName |] And so on and so forth. I don't think defining UserRoute adds much, besides making the job of the library writer a little bit easier by pushing the work off to the user. I think the six lines above succinctly: * define the valid routes * define the data types for arguments * define the appropriate mapping to handler functions for each request method Chris mentioned earlier to me the idea of using quasi-quoting on the link generation side, perhaps like: [$link|/user/find/6] I think the only piece of the puzzle missing to combine these two together is to have mkResources output something along the lines of: data RoutePiece = StaticPiece String | IntPiece | StringPiece _validRoutes :: [[RoutePiece]] _validRoutes = [ [StaticPiece "user"] , [StaticPiece "user", StaticPiece "find", IntPiece] , [StaticPiece "user", StaticPiece "name", StringPiece] ] Now if you write [$link|/user/find/michael] link can look up in _validRoutes that there is no matching route and complain at compile time. Advantages: less typing by the user. Disadvantages: we'll have to restrict the data types allowed, but in practice I think people will usually want only strings and ints anyway. Also, this approach is more complex. Michael On Tue, Mar 16, 2010 at 7:04 AM, Chris Eidhof wrote: > I have the feeling it adds a lot of complexity. I agree with you that, if > you want modularity, your components should only provide relative URLs and > need to be parameterized over how to build an absolute URL. I didn't think > of that problem, and using a custom monad transformer is definitely a > solution. > > However, I'm always hesitant to build up stacks of monad transformers, it > adds a lot of complexity. I would rather use something like typeclass, but > I'm not sure yet how to do that. > > -chris > > On 16 mrt 2010, at 14:29, Jeremy Shaw wrote: > > > Hello, > > > > It looks nearly identical, but without the URLT monad transformer. > > > > Instead of ToURL I have the class: > > > > class AsURL a where > > toURLS :: a -> ShowS > > fromURLC :: Consumer String (Failing a) > > > > With is basically the same. Except toURLS returns a ShowS instead of > [String]. fromURLC consumes a list of [String]. These functions are wrapped > up to provide: > > > > toURL :: (AsURL a) => a -> String > > fromURL :: (AsURL a) => String -> Failing a > > > > I do not have generics based url printing/parsing, but there is no reason > it could not be added. I do have template haskell based code though. > > > > http://src.seereason.com/urlt/URLT/TH.hs > > > > The thing you don't have is the URLT monad transformer: > > > > http://src.seereason.com/urlt/URLT/Base.hs > > > > Here is why you want it. Imagine you write an image gallery library: > > > > data ImageURL = Upload | ViewImage Int > > > > when you call toURL, you are going to get urls like, /Upload, > /ViewImage/1, etc. > > > > Now let's say I try to use your library in my application. So at first I > try: > > > > data MyApp = Upload | FooBar > > > > But when a URL comes in, how do I know if I should decode it as MyApp or > ImageURL? Do I try both and see which one succeeds? Except we both have a > constructor Upload, so both will succeed. There is no way to tell with > Upload the path "/Upload" is referring to. > > > > So now I try: > > > > data MyApp = Upload | FooBar | Images ImageURL > > > > now I know that all incoming urls are decoded as MyApp. But there is > still a problem. In my code I could write: > > > > toUrl (Images (ViewImage 1)) > > > > but in your library code, you don't know anything about the Images > constructor. So you just call, > > > > toURL (ViewImage 1) > > > > which generates /ViewImage/1 instead of the required /Images/ViewImage/1. > > > > What I need is someway to tell your library code what prefix to add at > the beginning. That is exactly what the URLT monad does. It just holds a > function that adds a prefix to the URL. > > > > so in your library you have: > > > > image :: ImageURL -> URLT ImageURL m () > > image Upload = > > do ... > > u <- showURL (ViewImage n) > > ... > > image (ViewImage num) = ... > > > > Instead of calling toURL, it calls showURL, which adds the context to the > URL and then calls toURL on it. > > > > And in my code I have: > > > > myApp :: MyAPP -> URLT MyApp m () > > mpApp Upload = ... > > myApp FooBar = ... > > myApp (Images subURL) = nestURL Images $ images subURL > > > > the 'nextURL Images' adds the Images context to the URLT environment. It > can be used to nest multiple levels if needed: > > > > nestURL A $ nestURL B $ nestURL Images $ showURL (ViewImage 1) > > > > would get turned into something like: > > > > "/A/B/Images/ViewImage/1" > > > > What do you think? > > > > - jeremy > > > > > > On Tue, Mar 16, 2010 at 3:52 AM, Chris Eidhof wrote: > > Hey everyone, > > > > I just wrote down some of my ideas about type-safe URL handling on > github, it's at http://gist.github.com/333769 > > > > I think it's similar to what Jeremy is doing with his urlt package [1]. > > > > -chris > > > > [1]: http://src.seereason.com/~jeremy/SimpleSite1.html > > > > _______________________________________________ > > web-devel mailing list > > web-devel@haskell.org > > http://www.haskell.org/mailman/listinfo/web-devel > > > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > --===============0722773310412284863== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 VGhlc2UgYXBwcm9hY2hlcyB3aWxsIGRlZmluaXRlbHkgd29yaywgYnV0IEkmIzM5O20gd29ycmll ZCB0aGF0IGNyZWF0aW5nIGEgd2hvbGUgc2V0IG9mIGRhdGF0eXBlcyB0byByZXByZXNlbnQgVVJM cyBpcyBvdmVya2lsbC4gSW4gWWVzb2QgKEkmIzM5O20gc3VyZSBtYW55IG9mIHlvdSBoYXZlIHNl ZW4pIEkgdXNlIHF1YXNpLXF1b3RpbmcgZm9yIGRlZmluaW5nIHRoZSByZXNvdXJjZXMsIGxpa2Ug c3VjaDo8ZGl2Pgo8YnI+PC9kaXY+PGRpdj5bJG1rUmVzb3VyY2VzfDwvZGl2PjxkaXY+L3VzZXI6 PC9kaXY+PGRpdj7CoMKgIMKgR0VUOiB1c2VyTGlzdDwvZGl2PjxkaXY+L3VzZXIvZmluZC8jdXNl cmlkPC9kaXY+PGRpdj7CoMKgIMKgR0VUOiB1c2VyRmluZDwvZGl2PjxkaXY+L3VzZXIvbmFtZS8k dXNlcm5hbWU8L2Rpdj48ZGl2PsKgwqAgwqBHRVQ6IHVzZXJOYW1lPC9kaXY+PGRpdj58XTwvZGl2 PjxkaXY+PGJyPjwvZGl2Pgo8ZGl2PkFuZCBzbyBvbiBhbmQgc28gZm9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19fX19fX19fX19fX19fX19fX19fXzxicj4Kd2ViLWRldmVsIG1haWxp bmcgbGlzdDxicj4KPGEgaHJlZj0ibWFpbHRvOndlYi1kZXZlbEBoYXNrZWxsLm9yZyI+d2ViLWRl dmVsQGhhc2tlbGwub3JnPC9hPjxicj4KPGEgaHJlZj0iaHR0cDovL3d3dy5oYXNrZWxsLm9yZy9t YWlsbWFuL2xpc3RpbmZvL3dlYi1kZXZlbCIgdGFyZ2V0PSJfYmxhbmsiPmh0dHA6Ly93d3cuaGFz a2VsbC5vcmcvbWFpbG1hbi9saXN0aW5mby93ZWItZGV2ZWw8L2E+PGJyPgo8L2Rpdj48L2Rpdj48 L2Jsb2NrcXVvdGU+PC9kaXY+PGJyPjwvZGl2Pgo= --===============0722773310412284863==-- From chris@eidhof.nl Tue Mar 16 10:53:46 2010 From: Chris Eidhof To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Tue, 16 Mar 2010 16:24:20 +0100 Message-ID: <64948FBB-EF47-487F-9637-D4C9E2C7FA73@eidhof.nl> In-Reply-To: <29bf512f1003160816gc5ee59fwc794fcb7fca1d6c6@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4780222080150759449==" --===============4780222080150759449== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Creating a number of datatypes (each for every "component") is interesting be= cause of two things: * You can only produce valid URLs (you get that for free) * You can provide an individual component as a library (e.g. a hackage packag= e) I guess that all these approaches can be made equivalent, it's mostly a matte= r of style and preference. What I like about my approach is that it's very li= ght on Template Haskell: the only TH comes from the regular library and is we= ll-tested. -chris On 16 mrt 2010, at 16:16, Michael Snoyman wrote: > These approaches will definitely work, but I'm worried that creating a whol= e set of datatypes to represent URLs is overkill. In Yesod (I'm sure many of = you have seen) I use quasi-quoting for defining the resources, like such: >=20 > [$mkResources| > /user: > GET: userList > /user/find/#userid > GET: userFind > /user/name/$username > GET: userName > |] >=20 > And so on and so forth. I don't think defining UserRoute adds much, besides= making the job of the library writer a little bit easier by pushing the work= off to the user. I think the six lines above succinctly: >=20 > * define the valid routes > * define the data types for arguments > * define the appropriate mapping to handler functions for each request meth= od >=20 > Chris mentioned earlier to me the idea of using quasi-quoting on the link g= eneration side, perhaps like: >=20 > [$link|/user/find/6] >=20 > I think the only piece of the puzzle missing to combine these two together = is to have mkResources output something along the lines of: >=20 > data RoutePiece =3D StaticPiece String | IntPiece | StringPiece > _validRoutes :: [[RoutePiece]] > _validRoutes =3D > [ [StaticPiece "user"] > , [StaticPiece "user", StaticPiece "find", IntPiece] > , [StaticPiece "user", StaticPiece "name", StringPiece] > ] >=20 > Now if you write >=20 > [$link|/user/find/michael] >=20 > link can look up in _validRoutes that there is no matching route and compla= in at compile time. >=20 > Advantages: less typing by the user. > Disadvantages: we'll have to restrict the data types allowed, but in practi= ce I think people will usually want only strings and ints anyway. Also, this = approach is more complex. >=20 > Michael >=20 > On Tue, Mar 16, 2010 at 7:04 AM, Chris Eidhof wrote: > I have the feeling it adds a lot of complexity. I agree with you that, if y= ou want modularity, your components should only provide relative URLs and nee= d to be parameterized over how to build an absolute URL. I didn't think of th= at problem, and using a custom monad transformer is definitely a solution. >=20 > However, I'm always hesitant to build up stacks of monad transformers, it a= dds a lot of complexity. I would rather use something like typeclass, but I'm= not sure yet how to do that. >=20 > -chris >=20 > On 16 mrt 2010, at 14:29, Jeremy Shaw wrote: >=20 > > Hello, > > > > It looks nearly identical, but without the URLT monad transformer. > > > > Instead of ToURL I have the class: > > > > class AsURL a where > > toURLS :: a -> ShowS > > fromURLC :: Consumer String (Failing a) > > > > With is basically the same. Except toURLS returns a ShowS instead of [Str= ing]. fromURLC consumes a list of [String]. These functions are wrapped up to= provide: > > > > toURL :: (AsURL a) =3D> a -> String > > fromURL :: (AsURL a) =3D> String -> Failing a > > > > I do not have generics based url printing/parsing, but there is no reason= it could not be added. I do have template haskell based code though. > > > > http://src.seereason.com/urlt/URLT/TH.hs > > > > The thing you don't have is the URLT monad transformer: > > > > http://src.seereason.com/urlt/URLT/Base.hs > > > > Here is why you want it. Imagine you write an image gallery library: > > > > data ImageURL =3D Upload | ViewImage Int > > > > when you call toURL, you are going to get urls like, /Upload, /ViewImage/= 1, etc. > > > > Now let's say I try to use your library in my application. So at first I = try: > > > > data MyApp =3D Upload | FooBar > > > > But when a URL comes in, how do I know if I should decode it as MyApp or = ImageURL? Do I try both and see which one succeeds? Except we both have a con= structor Upload, so both will succeed. There is no way to tell with Upload th= e path "/Upload" is referring to. > > > > So now I try: > > > > data MyApp =3D Upload | FooBar | Images ImageURL > > > > now I know that all incoming urls are decoded as MyApp. But there is stil= l a problem. In my code I could write: > > > > toUrl (Images (ViewImage 1)) > > > > but in your library code, you don't know anything about the Images constr= uctor. So you just call, > > > > toURL (ViewImage 1) > > > > which generates /ViewImage/1 instead of the required /Images/ViewImage/1. > > > > What I need is someway to tell your library code what prefix to add at th= e beginning. That is exactly what the URLT monad does. It just holds a functi= on that adds a prefix to the URL. > > > > so in your library you have: > > > > image :: ImageURL -> URLT ImageURL m () > > image Upload =3D > > do ... > > u <- showURL (ViewImage n) > > ... > > image (ViewImage num) =3D ... > > > > Instead of calling toURL, it calls showURL, which adds the context to the= URL and then calls toURL on it. > > > > And in my code I have: > > > > myApp :: MyAPP -> URLT MyApp m () > > mpApp Upload =3D ... > > myApp FooBar =3D ... > > myApp (Images subURL) =3D nestURL Images $ images subURL > > > > the 'nextURL Images' adds the Images context to the URLT environment. It = can be used to nest multiple levels if needed: > > > > nestURL A $ nestURL B $ nestURL Images $ showURL (ViewImage 1) > > > > would get turned into something like: > > > > "/A/B/Images/ViewImage/1" > > > > What do you think? > > > > - jeremy > > > > > > On Tue, Mar 16, 2010 at 3:52 AM, Chris Eidhof wrote: > > Hey everyone, > > > > I just wrote down some of my ideas about type-safe URL handling on github= , it's at http://gist.github.com/333769 > > > > I think it's similar to what Jeremy is doing with his urlt package [1]. > > > > -chris > > > > [1]: http://src.seereason.com/~jeremy/SimpleSite1.html > > > > _______________________________________________ > > web-devel mailing list > > web-devel@haskell.org > > http://www.haskell.org/mailman/listinfo/web-devel > > >=20 > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel >=20 --===============4780222080150759449==-- From michael@snoyman.com Tue Mar 16 11:15:58 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Tue, 16 Mar 2010 08:46:31 -0700 Message-ID: <29bf512f1003160846n76fa4307iedcc94f3934670ce@mail.gmail.com> In-Reply-To: <64948FBB-EF47-487F-9637-D4C9E2C7FA73@eidhof.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3281029105808965353==" --===============3281029105808965353== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Took me a bit to appreciate what you just said there, but I see your point now. It's true, it does have some very nice features. I'm still concerned about creating something which involves too much boilerplate. Am I understanding correctly that the URLs will be derived from the names of the datatypes? Also, how would you address URL dispatch in this approach? On Tue, Mar 16, 2010 at 8:24 AM, Chris Eidhof wrote: > Creating a number of datatypes (each for every "component") is interesting > because of two things: > > * You can only produce valid URLs (you get that for free) > * You can provide an individual component as a library (e.g. a hackage > package) > > I guess that all these approaches can be made equivalent, it's mostly a > matter of style and preference. What I like about my approach is that it's > very light on Template Haskell: the only TH comes from the regular library > and is well-tested. > > -chris > > On 16 mrt 2010, at 16:16, Michael Snoyman wrote: > > > These approaches will definitely work, but I'm worried that creating a > whole set of datatypes to represent URLs is overkill. In Yesod (I'm sure > many of you have seen) I use quasi-quoting for defining the resources, like > such: > > > > [$mkResources| > > /user: > > GET: userList > > /user/find/#userid > > GET: userFind > > /user/name/$username > > GET: userName > > |] > > > > And so on and so forth. I don't think defining UserRoute adds much, > besides making the job of the library writer a little bit easier by pushing > the work off to the user. I think the six lines above succinctly: > > > > * define the valid routes > > * define the data types for arguments > > * define the appropriate mapping to handler functions for each request > method > > > > Chris mentioned earlier to me the idea of using quasi-quoting on the link > generation side, perhaps like: > > > > [$link|/user/find/6] > > > > I think the only piece of the puzzle missing to combine these two > together is to have mkResources output something along the lines of: > > > > data RoutePiece = StaticPiece String | IntPiece | StringPiece > > _validRoutes :: [[RoutePiece]] > > _validRoutes = > > [ [StaticPiece "user"] > > , [StaticPiece "user", StaticPiece "find", IntPiece] > > , [StaticPiece "user", StaticPiece "name", StringPiece] > > ] > > > > Now if you write > > > > [$link|/user/find/michael] > > > > link can look up in _validRoutes that there is no matching route and > complain at compile time. > > > > Advantages: less typing by the user. > > Disadvantages: we'll have to restrict the data types allowed, but in > practice I think people will usually want only strings and ints anyway. > Also, this approach is more complex. > > > > Michael > > > > On Tue, Mar 16, 2010 at 7:04 AM, Chris Eidhof wrote: > > I have the feeling it adds a lot of complexity. I agree with you that, if > you want modularity, your components should only provide relative URLs and > need to be parameterized over how to build an absolute URL. I didn't think > of that problem, and using a custom monad transformer is definitely a > solution. > > > > However, I'm always hesitant to build up stacks of monad transformers, it > adds a lot of complexity. I would rather use something like typeclass, but > I'm not sure yet how to do that. > > > > -chris > > > > On 16 mrt 2010, at 14:29, Jeremy Shaw wrote: > > > > > Hello, > > > > > > It looks nearly identical, but without the URLT monad transformer. > > > > > > Instead of ToURL I have the class: > > > > > > class AsURL a where > > > toURLS :: a -> ShowS > > > fromURLC :: Consumer String (Failing a) > > > > > > With is basically the same. Except toURLS returns a ShowS instead of > [String]. fromURLC consumes a list of [String]. These functions are wrapped > up to provide: > > > > > > toURL :: (AsURL a) => a -> String > > > fromURL :: (AsURL a) => String -> Failing a > > > > > > I do not have generics based url printing/parsing, but there is no > reason it could not be added. I do have template haskell based code though. > > > > > > http://src.seereason.com/urlt/URLT/TH.hs > > > > > > The thing you don't have is the URLT monad transformer: > > > > > > http://src.seereason.com/urlt/URLT/Base.hs > > > > > > Here is why you want it. Imagine you write an image gallery library: > > > > > > data ImageURL = Upload | ViewImage Int > > > > > > when you call toURL, you are going to get urls like, /Upload, > /ViewImage/1, etc. > > > > > > Now let's say I try to use your library in my application. So at first > I try: > > > > > > data MyApp = Upload | FooBar > > > > > > But when a URL comes in, how do I know if I should decode it as MyApp > or ImageURL? Do I try both and see which one succeeds? Except we both have a > constructor Upload, so both will succeed. There is no way to tell with > Upload the path "/Upload" is referring to. > > > > > > So now I try: > > > > > > data MyApp = Upload | FooBar | Images ImageURL > > > > > > now I know that all incoming urls are decoded as MyApp. But there is > still a problem. In my code I could write: > > > > > > toUrl (Images (ViewImage 1)) > > > > > > but in your library code, you don't know anything about the Images > constructor. So you just call, > > > > > > toURL (ViewImage 1) > > > > > > which generates /ViewImage/1 instead of the required > /Images/ViewImage/1. > > > > > > What I need is someway to tell your library code what prefix to add at > the beginning. That is exactly what the URLT monad does. It just holds a > function that adds a prefix to the URL. > > > > > > so in your library you have: > > > > > > image :: ImageURL -> URLT ImageURL m () > > > image Upload = > > > do ... > > > u <- showURL (ViewImage n) > > > ... > > > image (ViewImage num) = ... > > > > > > Instead of calling toURL, it calls showURL, which adds the context to > the URL and then calls toURL on it. > > > > > > And in my code I have: > > > > > > myApp :: MyAPP -> URLT MyApp m () > > > mpApp Upload = ... > > > myApp FooBar = ... > > > myApp (Images subURL) = nestURL Images $ images subURL > > > > > > the 'nextURL Images' adds the Images context to the URLT environment. > It can be used to nest multiple levels if needed: > > > > > > nestURL A $ nestURL B $ nestURL Images $ showURL (ViewImage 1) > > > > > > would get turned into something like: > > > > > > "/A/B/Images/ViewImage/1" > > > > > > What do you think? > > > > > > - jeremy > > > > > > > > > On Tue, Mar 16, 2010 at 3:52 AM, Chris Eidhof wrote: > > > Hey everyone, > > > > > > I just wrote down some of my ideas about type-safe URL handling on > github, it's at http://gist.github.com/333769 > > > > > > I think it's similar to what Jeremy is doing with his urlt package [1]. > > > > > > -chris > > > > > > [1]: http://src.seereason.com/~jeremy/SimpleSite1.html > > > > > > _______________________________________________ > > > web-devel mailing list > > > web-devel@haskell.org > > > http://www.haskell.org/mailman/listinfo/web-devel > > > > > > > _______________________________________________ > > web-devel mailing list > > web-devel@haskell.org > > http://www.haskell.org/mailman/listinfo/web-devel > > > > --===============3281029105808965353== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 VG9vayBtZSBhIGJpdCB0byBhcHByZWNpYXRlIHdoYXQgeW91IGp1c3Qgc2FpZCB0aGVyZSwgYnV0 IEkgc2VlIHlvdXIgcG9pbnQgbm93LiBJdCYjMzk7cyB0cnVlLCBpdCBkb2VzIGhhdmUgc29tZSB2 ZXJ5IG5pY2UgZmVhdHVyZXMuIEkmIzM5O20gc3RpbGwgY29uY2VybmVkIGFib3V0IGNyZWF0aW5n IHNvbWV0aGluZyB3aGljaCBpbnZvbHZlcyB0b28gbXVjaCBib2lsZXJwbGF0ZS48ZGl2Pgo8YnI+ PC9kaXY+PGRpdj5BbSBJIHVuZGVyc3RhbmRpbmcgY29ycmVjdGx5IHRoYXQgdGhlIFVSTHMgd2ls bCBiZSBkZXJpdmVkIGZyb20gdGhlIG5hbWVzIG9mIHRoZSBkYXRhdHlwZXM/IEFsc28sIGhvdyB3 b3VsZCB5b3UgYWRkcmVzcyBVUkwgZGlzcGF0Y2ggaW4gdGhpcyBhcHByb2FjaD88L2Rpdj48ZGl2 Pjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gVHVlLCBNYXIgMTYsIDIwMTAgYXQgODoy NCBBTSwgQ2hyaXMgRWlkaG9mIDxzcGFuIGRpcj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFpbHRvOmNo cmlzQGVpZGhvZi5ubCI+Y2hyaXNAZWlkaG9mLm5sPC9hPiZndDs8L3NwYW4+IHdyb3RlOjxicj4K PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0ibWFyZ2luOjAgMCAwIC44ZXg7 Ym9yZGVyLWxlZnQ6MXB4ICNjY2Mgc29saWQ7cGFkZGluZy1sZWZ0OjFleDsiPkNyZWF0aW5nIGEg bnVtYmVyIG9mI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d3d3Lmhhc2tlbGwub3JnL21haWxtYW4vbGlz dGluZm8vd2ViLWRldmVsPC9hPjxicj4KJmd0Ozxicj4KPGJyPgo8L2Rpdj48L2Rpdj48L2Jsb2Nr cXVvdGU+PC9kaXY+PGJyPjwvZGl2Pgo= --===============3281029105808965353==-- From greg@gregorycollins.net Tue Mar 16 12:21:00 2010 From: Gregory Collins To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Tue, 16 Mar 2010 12:51:36 -0400 Message-ID: <877hpc5hwn.fsf@gregorycollins.net> In-Reply-To: <29bf512f1003160816gc5ee59fwc794fcb7fca1d6c6@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8050780493653060475==" --===============8050780493653060475== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Michael Snoyman writes: > I think the only piece of the puzzle missing to combine these two > together is to have mkResources output something along the lines of: > > data RoutePiece = StaticPiece String | IntPiece | StringPiece > _validRoutes :: [[RoutePiece]] > _validRoutes = > [ [StaticPiece "user"] > , [StaticPiece "user", StaticPiece "find", IntPiece] > , [StaticPiece "user", StaticPiece "name", StringPiece] > ] Yes, this approach smells a lot better to me: the types are types and the data are data. Just a brainstorm: if each handler monad were to carry its routing table around with it, you could define something like: match :: ByteString -> (WhateverYourWebMonadIsCalled a) -> (WhateverYourWebMonadIsCalled a) And write handler = match "/foo/:bar/#int/" $ do ... without the template haskell quasiquotation (i.e. do the checking at runtime.) Is it always true that compile-time link checking is possible/desirable? All of these solutions also imply that each handler knows where it's hung on the routing table so that it can resolve relative URLs, etc. IMO no matter what a link-checker should be lightweight enough that you can refactor easily without rewriting a bunch of static tables; you should be able to move an entire "subtree" to another place in the routing table in O(1) time. This rabbit hole goes pretty deep though; if you're serious about the bondage and discipline approach you'd want to ensure that you can check query parameters; i.e. "'/foo' takes a mandatory 'bar' integer parameter on the queryString and an optional 'sort' parameter which must be either 'asc' or 'desc'", etc. At some point I have to wonder: is the medicine worse than the disease? G -- Gregory Collins --===============8050780493653060475==-- From chris@eidhof.nl Tue Mar 16 12:24:06 2010 From: Chris Eidhof To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Tue, 16 Mar 2010 17:54:36 +0100 Message-ID: <827E3B06-0470-426A-BC11-DC23897B7283@eidhof.nl> In-Reply-To: <29bf512f1003160846n76fa4307iedcc94f3934670ce@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4060392347777388834==" --===============4060392347777388834== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On 16 mrt 2010, at 16:46, Michael Snoyman wrote: > Took me a bit to appreciate what you just said there, but I see your point = now. It's true, it does have some very nice features. I'm still concerned abo= ut creating something which involves too much boilerplate. Yes. Generic programming (which is what the regular library provides) tries t= o hide the boilerplate (Template Haskell) code in a library and provides you = with combinators so that you can program on the structure of a datatype. This= is also at the core of my regular-web library [1], which generates forms/htm= l/json/xml in the same way. You notice that on lines 34-36, I use the exact s= ame TH calls. Once you did that, you get HTML and Formlets generation for fre= e! >=20 > Am I understanding correctly that the URLs will be derived from the names o= f the datatypes? Exactly! > Also, how would you address URL dispatch in this approach? A URL is represented by a datastructure, e.g. ApplicationRoute. You would wri= te a function "dispatch :: ApplicationRoute -> Application". Dispatch is not = part of the library (and it shouldn't be, imo). In the module "MyApp.UserCont= roller" you might write a function "dispatchUser :: UserRoute -> Application"= , which is called by the original dispatch function. -chris [1]: http://github.com/chriseidhof/regular-web/blob/master/Example.lhs >=20 > On Tue, Mar 16, 2010 at 8:24 AM, Chris Eidhof wrote: > Creating a number of datatypes (each for every "component") is interesting = because of two things: >=20 > * You can only produce valid URLs (you get that for free) > * You can provide an individual component as a library (e.g. a hackage pack= age) >=20 > I guess that all these approaches can be made equivalent, it's mostly a mat= ter of style and preference. What I like about my approach is that it's very = light on Template Haskell: the only TH comes from the regular library and is = well-tested. >=20 > -chris >=20 > On 16 mrt 2010, at 16:16, Michael Snoyman wrote: >=20 > > These approaches will definitely work, but I'm worried that creating a wh= ole set of datatypes to represent URLs is overkill. In Yesod (I'm sure many o= f you have seen) I use quasi-quoting for defining the resources, like such: > > > > [$mkResources| > > /user: > > GET: userList > > /user/find/#userid > > GET: userFind > > /user/name/$username > > GET: userName > > |] > > > > And so on and so forth. I don't think defining UserRoute adds much, besid= es making the job of the library writer a little bit easier by pushing the wo= rk off to the user. I think the six lines above succinctly: > > > > * define the valid routes > > * define the data types for arguments > > * define the appropriate mapping to handler functions for each request me= thod > > > > Chris mentioned earlier to me the idea of using quasi-quoting on the link= generation side, perhaps like: > > > > [$link|/user/find/6] > > > > I think the only piece of the puzzle missing to combine these two togethe= r is to have mkResources output something along the lines of: > > > > data RoutePiece =3D StaticPiece String | IntPiece | StringPiece > > _validRoutes :: [[RoutePiece]] > > _validRoutes =3D > > [ [StaticPiece "user"] > > , [StaticPiece "user", StaticPiece "find", IntPiece] > > , [StaticPiece "user", StaticPiece "name", StringPiece] > > ] > > > > Now if you write > > > > [$link|/user/find/michael] > > > > link can look up in _validRoutes that there is no matching route and comp= lain at compile time. > > > > Advantages: less typing by the user. > > Disadvantages: we'll have to restrict the data types allowed, but in prac= tice I think people will usually want only strings and ints anyway. Also, thi= s approach is more complex. > > > > Michael > > > > On Tue, Mar 16, 2010 at 7:04 AM, Chris Eidhof wrote: > > I have the feeling it adds a lot of complexity. I agree with you that, if= you want modularity, your components should only provide relative URLs and n= eed to be parameterized over how to build an absolute URL. I didn't think of = that problem, and using a custom monad transformer is definitely a solution. > > > > However, I'm always hesitant to build up stacks of monad transformers, it= adds a lot of complexity. I would rather use something like typeclass, but I= 'm not sure yet how to do that. > > > > -chris > > > > On 16 mrt 2010, at 14:29, Jeremy Shaw wrote: > > > > > Hello, > > > > > > It looks nearly identical, but without the URLT monad transformer. > > > > > > Instead of ToURL I have the class: > > > > > > class AsURL a where > > > toURLS :: a -> ShowS > > > fromURLC :: Consumer String (Failing a) > > > > > > With is basically the same. Except toURLS returns a ShowS instead of [S= tring]. fromURLC consumes a list of [String]. These functions are wrapped up = to provide: > > > > > > toURL :: (AsURL a) =3D> a -> String > > > fromURL :: (AsURL a) =3D> String -> Failing a > > > > > > I do not have generics based url printing/parsing, but there is no reas= on it could not be added. I do have template haskell based code though. > > > > > > http://src.seereason.com/urlt/URLT/TH.hs > > > > > > The thing you don't have is the URLT monad transformer: > > > > > > http://src.seereason.com/urlt/URLT/Base.hs > > > > > > Here is why you want it. Imagine you write an image gallery library: > > > > > > data ImageURL =3D Upload | ViewImage Int > > > > > > when you call toURL, you are going to get urls like, /Upload, /ViewImag= e/1, etc. > > > > > > Now let's say I try to use your library in my application. So at first = I try: > > > > > > data MyApp =3D Upload | FooBar > > > > > > But when a URL comes in, how do I know if I should decode it as MyApp o= r ImageURL? Do I try both and see which one succeeds? Except we both have a c= onstructor Upload, so both will succeed. There is no way to tell with Upload = the path "/Upload" is referring to. > > > > > > So now I try: > > > > > > data MyApp =3D Upload | FooBar | Images ImageURL > > > > > > now I know that all incoming urls are decoded as MyApp. But there is st= ill a problem. In my code I could write: > > > > > > toUrl (Images (ViewImage 1)) > > > > > > but in your library code, you don't know anything about the Images cons= tructor. So you just call, > > > > > > toURL (ViewImage 1) > > > > > > which generates /ViewImage/1 instead of the required /Images/ViewImage/= 1. > > > > > > What I need is someway to tell your library code what prefix to add at = the beginning. That is exactly what the URLT monad does. It just holds a func= tion that adds a prefix to the URL. > > > > > > so in your library you have: > > > > > > image :: ImageURL -> URLT ImageURL m () > > > image Upload =3D > > > do ... > > > u <- showURL (ViewImage n) > > > ... > > > image (ViewImage num) =3D ... > > > > > > Instead of calling toURL, it calls showURL, which adds the context to t= he URL and then calls toURL on it. > > > > > > And in my code I have: > > > > > > myApp :: MyAPP -> URLT MyApp m () > > > mpApp Upload =3D ... > > > myApp FooBar =3D ... > > > myApp (Images subURL) =3D nestURL Images $ images subURL > > > > > > the 'nextURL Images' adds the Images context to the URLT environment. I= t can be used to nest multiple levels if needed: > > > > > > nestURL A $ nestURL B $ nestURL Images $ showURL (ViewImage 1) > > > > > > would get turned into something like: > > > > > > "/A/B/Images/ViewImage/1" > > > > > > What do you think? > > > > > > - jeremy > > > > > > > > > On Tue, Mar 16, 2010 at 3:52 AM, Chris Eidhof wrote: > > > Hey everyone, > > > > > > I just wrote down some of my ideas about type-safe URL handling on gith= ub, it's at http://gist.github.com/333769 > > > > > > I think it's similar to what Jeremy is doing with his urlt package [1]. > > > > > > -chris > > > > > > [1]: http://src.seereason.com/~jeremy/SimpleSite1.html > > > > > > _______________________________________________ > > > web-devel mailing list > > > web-devel@haskell.org > > > http://www.haskell.org/mailman/listinfo/web-devel > > > > > > > _______________________________________________ > > web-devel mailing list > > web-devel@haskell.org > > http://www.haskell.org/mailman/listinfo/web-devel > > >=20 >=20 --===============4060392347777388834==-- From chris@eidhof.nl Tue Mar 16 12:27:03 2010 From: Chris Eidhof To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Tue, 16 Mar 2010 17:57:36 +0100 Message-ID: In-Reply-To: <877hpc5hwn.fsf@gregorycollins.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1913479944387988582==" --===============1913479944387988582== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On 16 mrt 2010, at 17:51, Gregory Collins wrote: > Michael Snoyman writes: >=20 >> I think the only piece of the puzzle missing to combine these two >> together is to have mkResources output something along the lines of: >>=20 >> data RoutePiece =3D StaticPiece String | IntPiece | StringPiece >> _validRoutes :: [[RoutePiece]] >> _validRoutes =3D >> [ [StaticPiece "user"] >> , [StaticPiece "user", StaticPiece "find", IntPiece] >> , [StaticPiece "user", StaticPiece "name", StringPiece] >> ] >=20 > Yes, this approach smells a lot better to me: the types are types and > the data are data. Just a brainstorm: if each handler monad were to > carry its routing table around with it, you could define something like: >=20 > match :: ByteString > -> (WhateverYourWebMonadIsCalled a) > -> (WhateverYourWebMonadIsCalled a) >=20 > And write >=20 > handler =3D match "/foo/:bar/#int/" $ do ... >=20 > without the template haskell quasiquotation (i.e. do the checking at > runtime.) Is it always true that compile-time link checking is > possible/desirable? All of these solutions also imply that each handler > knows where it's hung on the routing table so that it can resolve > relative URLs, etc. >=20 > IMO no matter what a link-checker should be lightweight enough that you > can refactor easily without rewriting a bunch of static tables; you > should be able to move an entire "subtree" to another place in the > routing table in O(1) time. >=20 > This rabbit hole goes pretty deep though; if you're serious about the > bondage and discipline approach you'd want to ensure that you can check > query parameters; i.e. "'/foo' takes a mandatory 'bar' integer parameter > on the queryString and an optional 'sort' parameter which must be either > 'asc' or 'desc'", etc. At some point I have to wonder: is the medicine > worse than the disease? This would be a fairly straightforward extension of my library. I'll see if I= can come up with something on the trainride to ZuriHac tomorrow! -chris --===============1913479944387988582==-- From michael@snoyman.com Tue Mar 16 12:58:06 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Tue, 16 Mar 2010 10:28:43 -0700 Message-ID: <29bf512f1003161028j7ebebe06qaf5c0c80c99e98b0@mail.gmail.com> In-Reply-To: <877hpc5hwn.fsf@gregorycollins.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0809195188800711841==" --===============0809195188800711841== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Tue, Mar 16, 2010 at 9:51 AM, Gregory Collins wro= te: > Michael Snoyman writes: > > > I think the only piece of the puzzle missing to combine these two > > together is to have mkResources output something along the lines of: > > > > data RoutePiece =3D StaticPiece String | IntPiece | StringPiece > > _validRoutes :: [[RoutePiece]] > > _validRoutes =3D > > [ [StaticPiece "user"] > > , [StaticPiece "user", StaticPiece "find", IntPiece] > > , [StaticPiece "user", StaticPiece "name", StringPiece] > > ] > > Yes, this approach smells a lot better to me: the types are types and > the data are data. Just a brainstorm: if each handler monad were to > carry its routing table around with it, you could define something like: > > match :: ByteString > -> (WhateverYourWebMonadIsCalled a) > -> (WhateverYourWebMonadIsCalled a) > > And write > > handler =3D match "/foo/:bar/#int/" $ do ... > > without the template haskell quasiquotation (i.e. do the checking at > runtime.) Is it always true that compile-time link checking is > possible/desirable? All of these solutions also imply that each handler > knows where it's hung on the routing table so that it can resolve > relative URLs, etc. > > IMO no matter what a link-checker should be lightweight enough that you > can refactor easily without rewriting a bunch of static tables; you > should be able to move an entire "subtree" to another place in the > routing table in O(1) time. > > This rabbit hole goes pretty deep though; if you're serious about the > bondage and discipline approach you'd want to ensure that you can check > query parameters; i.e. "'/foo' takes a mandatory 'bar' integer parameter > on the queryString and an optional 'sort' parameter which must be either > 'asc' or 'desc'", etc. At some point I have to wonder: is the medicine > worse than the disease? > > I think you have some valid points here. If anyone cares to dig back through the Yesod repo far enough, they'll find an approach very similar to this, which I replaced with the quasi-quotation approach due to the boilerplate. However, if regular can clean up the boilerplate, maybe this *is* a better approach. Also, it seems like pairing this up with a dispatch system and a model layer would actually allow fully pluggable components, assuming we can address the "where am I hung on the tree" issue. However, I'll have to think hard to come up with an example which actually makes sense. Michael --===============0809195188800711841== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gVHVlLCBNYXIgMTYsIDIwMTAgYXQg OTo1MSBBTSwgR3JlZ29yeSBDb2xsaW5zIDxzcGFuIGRpcj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFp bHRvOmdyZWdAZ3JlZ29yeWNvbGxpbnMubmV0Ij5ncmVnQGdyZWdvcnljb2xsaW5zLm5ldDwvYT4m Z3Q7PC9zcGFuPiB3cm90ZTo8YnI+PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHls ZT0ibWFyZ2luOjAgMCAwIC44ZXg7Ym9yZGVyLWxlZnQ6MXB4ICNjY2Mgc29saWQ7cGFkZGluZy1s ZWZ0OjFleDsiPgo8ZGl2IGNsYXNzPSJpbSI+TWljaGFlbCBTbm95bWFuICZsdDs8YSBocmVmPSJt YWlsdG86bWlj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vd2V2ZXIsIGlmIHJl Z3VsYXIgY2FuIGNsZWFuIHVwIHRoZSBib2lsZXJwbGF0ZSwgbWF5YmUgdGhpcyAqaXMqIGEgYmV0 dGVyIGFwcHJvYWNoLjwvZGl2Pgo8ZGl2Pjxicj48L2Rpdj48ZGl2PkFsc28sIGl0IHNlZW1zIGxp a2UgcGFpcmluZyB0aGlzIHVwIHdpdGggYSBkaXNwYXRjaCBzeXN0ZW0gYW5kIGEgbW9kZWwgbGF5 ZXIgd291bGQgYWN0dWFsbHkgYWxsb3cgZnVsbHkgcGx1Z2dhYmxlIGNvbXBvbmVudHMsIGFzc3Vt aW5nIHdlIGNhbiBhZGRyZXNzIHRoZSAmcXVvdDt3aGVyZSBhbSBJIGh1bmcgb24gdGhlIHRyZWUm cXVvdDsgaXNzdWUuIEhvd2V2ZXIsIEkmIzM5O2xsIGhhdmUgdG8gdGhpbmsgaGFyZCB0byBjb21l IHVwIHdpdGggYW4gZXhhbXBsZSB3aGljaCBhY3R1YWxseSBtYWtlcyBzZW5zZS48L2Rpdj4KPGRp dj48YnI+PC9kaXY+PGRpdj5NaWNoYWVsPC9kaXY+PC9kaXY+Cg== --===============0809195188800711841==-- From cjs@starling-software.com Tue Mar 16 14:25:34 2010 From: Curt Sampson To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Wed, 17 Mar 2010 03:56:09 +0900 Message-ID: <20100316185609.GT4400@poetic.cynic.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1800627330681643733==" --===============1800627330681643733== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Tue, Mar 16, 2010 at 9:51 AM, Gregory Collins wro= te: > This rabbit hole goes pretty deep though; if you're serious about the > bondage and discipline approach you'd want to ensure that you can > check query parameters; i.e. "'/foo' takes a mandatory 'bar' integer > parameter on the queryString and an optional 'sort' parameter which > must be either 'asc' or 'desc'", etc. Which is not at all unreasonable, actually, if you take the approach I sorta-kinda-did with my Ruby system at one point (using regexps to match URIs): if the URL doesn't match the types you need for it, you get a 404. Thus, simplifying immensely for the sake of an example, "/user/show/1312" shows information about user 1312, but "/user/show/13x7" returns a 404. You still have to deal with the problem somewhere else of making sure everything within your system generates valid URLs, though.... cjs --=20 Curt Sampson To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Tue, 16 Mar 2010 13:49:01 -0700 Message-ID: <29bf512f1003161349g74f3ece9l6423ef8eb5b526f5@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2026687111100835774==" --===============2026687111100835774== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Here's a bit of an orthogonal gist to what Chris has posted. It's very tedious to program in this style, but it could form the basis for other libraries to build on top of it. http://gist.github.com/334475 WebPlug is a typeclass that consists of three methods: one to convert to a relative path, one to convert from a relative path, and a dispatch method. The trick is that dispatch is given a function that can convert a WebPlug into an *absolute* path. Given something like this, I could write a blog WebPlug that creates all internal links via the absolute path function. They would all be guaranteed to be valid by definition, and then the blog could be plugged into another application at any point. Some standards for loading settings and the like *might* be nice, but aren't really necesary. Also, I believe that this approach is compatible with either the regular package approach Chris uses above, or a quasi-quoting approach like in Yesod. (Obviously the Yesod code itself would have to change to accomodate this.) Michael --===============2026687111100835774== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SGVyZSYjMzk7cyBhIGJpdCBvZiBhbiBvcnRob2dvbmFsIGdpc3QgdG8gd2hhdCBDaHJpcyBoYXMg cG9zdGVkLiBJdCYjMzk7cyB2ZXJ5IHRlZGlvdXMgdG8gcHJvZ3JhbSBpbiB0aGlzIHN0eWxlLCBi dXQgaXQgY291bGQgZm9ybSB0aGUgYmFzaXMgZm9yIG90aGVyIGxpYnJhcmllcyB0byBidWlsZCBv biB0b3Agb2YgaXQuPGRpdj48YnI+PC9kaXY+PGRpdj48YSBocmVmPSJodHRwOi8vZ2lzdC5naXRo dWIuY29t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VpdGhlciB0aGUgcmVndWxhciBw YWNrYWdlIGFwcHJvYWNoIENocmlzIHVzZXMgYWJvdmUsIG9yIGEgcXVhc2ktcXVvdGluZyBhcHBy b2FjaCBsaWtlIGluIFllc29kLiAoT2J2aW91c2x5IHRoZSBZZXNvZCBjb2RlIGl0c2VsZiB3b3Vs ZCBoYXZlIHRvIGNoYW5nZSB0byBhY2NvbW9kYXRlIHRoaXMuKTwvZGl2Pgo8ZGl2Pjxicj48L2Rp dj48ZGl2Pk1pY2hhZWw8L2Rpdj4K --===============2026687111100835774==-- From jeremy@n-heptane.com Tue Mar 16 16:29:47 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Tue, 16 Mar 2010 16:00:25 -0500 Message-ID: In-Reply-To: <29bf512f1003161349g74f3ece9l6423ef8eb5b526f5@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1394510844686970359==" --===============1394510844686970359== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hello, I believe this is essentially how URLT works, except the 'toAbsPath' function is stored in the reader monad instead of being passed around manually. And advantage of using the reader monad is that it also ensures that you are dispatching the right type of URL in each part. More on this in a different post later. - jeremy On Tue, Mar 16, 2010 at 3:49 PM, Michael Snoyman wrote: > Here's a bit of an orthogonal gist to what Chris has posted. It's very > tedious to program in this style, but it could form the basis for other > libraries to build on top of it. > > http://gist.github.com/334475 > > WebPlug is a typeclass that consists of three methods: one to convert to a > relative path, one to convert from a relative path, and a dispatch method. > The trick is that dispatch is given a function that can convert a WebPlug > into an *absolute* path. > > Given something like this, I could write a blog WebPlug that creates all > internal links via the absolute path function. They would all be guaranteed > to be valid by definition, and then the blog could be plugged into another > application at any point. > > Some standards for loading settings and the like *might* be nice, but > aren't really necesary. Also, I believe that this approach is compatible > with either the regular package approach Chris uses above, or a > quasi-quoting approach like in Yesod. (Obviously the Yesod code itself would > have to change to accomodate this.) > > Michael > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > > --===============1394510844686970359== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SGVsbG8sPGRpdj48YnI+PC9kaXY+PGRpdj5JIGJlbGlldmUgdGhpcyBpcyBlc3NlbnRpYWxseSBo b3cgVVJMVCB3b3JrcywgZXhjZXB0IHRoZSAmIzM5O3RvQWJzUGF0aCYjMzk7IGZ1bmN0aW9uIGlz IHN0b3JlZCBpbiB0aGUgcmVhZGVyIG1vbmFkIGluc3RlYWQgb2YgYmVpbmcgcGFzc2VkIGFyb3Vu ZCBtYW51YWxseS6gPC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5BbmQgYWR2YW50YWdlIG9mIHVz aW5nIHRoZSByZWFkZXIgbW9uYWQgaXMgdGhhdCBpdCBhbHNvIGVuc3VyZXMgdGhhdCB5b3UgYXJl IGRpc3BhdGNoaW5nIHRoZSByaWdodCB0eXBlIG9mIFVSTCBpbiBlYWNoIHBhcnQuIE1vcmUgb24g dGhpcyBpbiBhIGRpZmZlcmVudCBwb3N0IGxhdGVyLjwvZGl2Pgo8ZGl2Pjxicj48L2Rpdj48ZGl2 Pi0gamVyZW15PC9kaXY+PGRpdj48YnI+PGRpdiBjbGFzcz0iZ21haWxfcXVvdGUiPk9uIFR1ZSwg TWFyIDE2LCAyMDEwIGF0IDM6NDkgUE0sIE1pY2hhZWwgU25veW1hbiA8c3BhbiBkaXI9Imx0ciI+ Jmx0OzxhIGhyZWY9Im1haWx0bzptaWNoYWVsQHNub3ltYW4uY29tIj5taWNoYWVsQHNub3ltYW4u Y29tPC9hPiZndDs8L3NwYW4+IHdyb3RlOjxicj48YmxvY2txdW90ZSBjbGFzcz0iZ21haWxfcXVv dGUiIHN0eWxlPSJtYXJnaW46MCAwIDAgLjhleDtib3JkZXItbGVmdDoxcHggI2NjYyBzb2xpZDtw YWRkaW5nLWxlZnQ6MWV4OyI+Ckhlc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2Rpdj48 YnI+PC9kaXY+Cg== --===============1394510844686970359==-- From jeremy@n-heptane.com Tue Mar 16 17:30:03 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Tue, 16 Mar 2010 17:00:41 -0500 Message-ID: In-Reply-To: <827E3B06-0470-426A-BC11-DC23897B7283@eidhof.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5736763010697468140==" --===============5736763010697468140== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Tue, Mar 16, 2010 at 11:54 AM, Chris Eidhof wrote: > On 16 mrt 2010, at 16:46, Michael Snoyman wrote: > > > Took me a bit to appreciate what you just said there, but I see your > point now. It's true, it does have some very nice features. I'm still > concerned about creating something which involves too much boilerplate. > > Yes. Generic programming (which is what the regular library provides) tries > to hide the boilerplate (Template Haskell) code in a library and provides > you with combinators so that you can program on the structure of a datatype. > This is also at the core of my regular-web library [1], which generates > forms/html/json/xml in the same way. You notice that on lines 34-36, I use > the exact same TH calls. Once you did that, you get HTML and Formlets > generation for free! Using URLT.TH you would just need the one-liner: $(deriveAsURL ''UserRoute) However, if that is asking too much, I have also added URLT.Regular: http://src.seereason.com/urlt/URLT/Regular.hs So instead you do: $(deriveAll ''UserRoute "PFUserRoute") type instance PF UserRoute = PFUserRoute instance AsURL UserRoute where toURLS = gtoURLS . from fromURLC = fmap (fmap to) gfromURLC > > Am I understanding correctly that the URLs will be derived from the names > of the datatypes? > > Exactly! URLT currently allows you to generate the urls from the names via template haskell, generics, or by writing instances by hand. I would like to add support for QuasiQuotes similar to what is done in Yesod. > Also, how would you address URL dispatch in this approach? > > A URL is represented by a datastructure, e.g. ApplicationRoute. You would > write a function "dispatch :: ApplicationRoute -> Application". Dispatch is > not part of the library (and it shouldn't be, imo). In the module > "MyApp.UserController" you might write a function "dispatchUser :: UserRoute > -> Application", which is called by the original dispatch function. > > That is how URLT works -- except better. Your function type will be like: dispatchApp :: (ShowURL m, URL m ~ ApplicationRoute) => ApplicationRoute -> m a MyApp.UserController might have a function like: dispatchUser :: (ShowURL m, URL m ~ UserRoute) => UserRoute -> m a the top level dispatchApp would call it like: dispatchApp (User userURL) = nestURL User $ dispatchApp userURL The constraints ensure that your app is also only generating URLs of type ApplicationRoute. If your app was generating urls of type UserRoute, but expecting incoming urls of type ApplicationRoute, that clearly would not work. Imagine if you accidentally wrote: dispatchApp Login = do let url = toURL List in list Here, in the dispatchApp function I accidentally called 'toURL List' instead of, 'toURL (User List)'. In your code that is *not* caught as a type error. With the ShowURL monad it is caught as a compile time error. If the goal is type-safe URLs I think it is essential to catch this error, don't you? - jeremy --===============5736763010697468140== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gVHVlLCBNYXIgMTYsIDIwMTAgYXQgMTE6NTQgQU0sIENocmlzIEVpZGhvZiA8c3BhbiBkaXI9 Imx0ciI+Jmx0OzxhIGhyZWY9Im1haWx0bzpjaHJpc0BlaWRob2YubmwiPmNocmlzQGVpZGhvZi5u bDwvYT4mZ3Q7PC9zcGFuPiB3cm90ZTo8YnI+PGRpdiBjbGFzcz0iZ21haWxfcXVvdGUiPjxibG9j a3F1b3RlIGNsYXNzPSJnbWFpbF9xdW90ZSIgc3R5bGU9Im1hcmdpbjowIDAgMCAuOGV4O2JvcmRl ci1sZWZ0OjFweCAjY2NjIHNvbGlkO3BhZGRpbmctbGVmdDoxZXg7Ij4KPGRpdiBjbGFzcz0iaW0i Pk9uIDE2IG1ydCAyMDEwLCBhdCAxNjo0NiwgTWljaGFlbCBTbm95bWFuIHdyb3RlOjxicj4KPGJy PgomZ3Q7IFRvb2sgbWUgYSBiaXQgdG8gYXBwcmVjaWF0ZSB3aGF0IHlvdSBqdXN0IHNhaWQgdGhl cmUsIGJ1dCBJIHNlZSB5b3VyIHBvaW50IG5vdy4gSXQmIzM5O3MgdHJ1ZSwgaXQgZG9lcyBoYXZl IHNvbWUgdmVyeSBuaWNl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763010697468140==-- From jeremy@n-heptane.com Tue Mar 16 18:04:32 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Tue, 16 Mar 2010 17:35:11 -0500 Message-ID: In-Reply-To: <877hpc5hwn.fsf@gregorycollins.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1261114228449332106==" --===============1261114228449332106== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Tue, Mar 16, 2010 at 11:51 AM, Gregory Collins wrote: > Michael Snoyman writes: > > Yes, this approach smells a lot better to me: the types are types and > the data are data. Just a brainstorm: if each handler monad were to > carry its routing table around with it, you could define something like: > > match :: ByteString > -> (WhateverYourWebMonadIsCalled a) > -> (WhateverYourWebMonadIsCalled a) And write > > handler = match "/foo/:bar/#int/" $ do ... > > without the template haskell quasiquotation (i.e. do the checking at > runtime.) Well, that is pretty much exactly how the ServerMonad in happstack works. That is why I wanted to free ServerMonad so that it is not happstack specific. I am not sure what :bar is supposed to mean, but let's pretend it means match on the type Bar. In the current code today you would could match on "/foo/:bar/#int/" like this: dir "foo" $ path $ \(bar :: Bar) -> path $ \(i :: Int) -> ... Now, one issue with your runtime match function is that it returns two parameters, in that example, but might return a different number of arguments in other cases. So the type would have to be something vararg-ish. match :: (MonadPlus m, ServerMonad m, MatchArgs c) => String -> (c -> m a) -> m a Where the type 'c' hopefully matches up with the values that "/foo/:bar/#int/" returns. Despite this annoyance, this could be implemented using ServerMonad today. One advantage of using the QuasiQuote method instead of a plain string is that the QuasiQuote method would parse the string at compile time and generate a matcher with a specific type signature. If the handler function had different arguments you would get a compile time error. I would very much like to see a QuasiQuote version of match added to the ServerMonad library. It's basically just syntactic sugar for using dir / path /etc. But it is very nice sugar. > Is it always true that compile-time link checking is > possible/desirable? All of these solutions also imply that each handler > knows where it's hung on the routing table so that it can resolve > relative URLs, etc. With URLT, the handler 'knows where it is hung' because it is stored transparently by the URLT monad, and accessed via showURL. So in the blog library, for example, you would just write: u <- showURL (ViewPost 1) showURL magically knows where it is hung. If the blog was incorporated into a master site: data App = Blog BlogURL it would be told like: app (Blog blogURL) = nestURL Blog $ blogHandler blogURL > IMO no matter what a link-checker should be lightweight enough that you > can refactor easily without rewriting a bunch of static tables; you > should be able to move an entire "subtree" to another place in the > routing table in O(1) time. > That should be easy with URLT. You could just change the type: data App = MyBlog BlogURL Now, if you forget to update the nestURL handler from Blog to MyBlog, you will get a compile time error. Or, might might not change the type at all. You might just change the AsURL instance so that (Blog (ViewPost 1)) generates: /myblog/viewpost/1 So, you have the flexibility to change the way your urls look by modifying two functions and leaving everything else alone. > This rabbit hole goes pretty deep though; if you're serious about the > bondage and discipline approach you'd want to ensure that you can check > query parameters; i.e. "'/foo' takes a mandatory 'bar' integer parameter > on the queryString and an optional 'sort' parameter which must be either > 'asc' or 'desc'", etc. At some point I have to wonder: is the medicine > worse than the disease? > Using the the URLT, the issue of the mandatory and optional arguments is simple. You would have types like: data Sort = Asc | Desc data WebURL = Foo Int (Maybe Sort) instance AsURL Foo where toURLS (Foo i mSort) = showString "Foo?" . showString "bar=" . shows n . showString ";" . (case mSort of Nothing -> id ; (Just Asc) -> showString "sort=asc;" ; (Just Desc) -> showString "sort=desc;") fromURLC = -- skipped for brevity It seems like the medicine is quite nice here. Instead of having to remember if the 'bar' is a parameter or a path component, we just do: showURL (Foo 1 (Just Asc)) The details of how that looks are centralized in a single spot. if we decide that we want the url to instead look like: /foo/1?sort=desc We can change it in one spot instead of having to: 1. change it everywhere 2. tell everyone about the change and get them to remember that it changed Additionally, with the typed version you can never forget the mandatory 'bar' parameter because the compiler will tell you. Writing the toURLS and fromURLC instances by hand gives you very precise control over how the URLs look -- though it can be a bit tedious. However I think some simple combinators could help with that. Either a DSL for constructing things by hand, or something based on a yesod style quasiquoter. - jeremy --===============1261114228449332106== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gVHVlLCBNYXIgMTYsIDIwMTAg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vdWxkIGhlbHAgd2l0aCB0aGF0LiBFaXRoZXIgYSBE U0wgZm9yIGNvbnN0cnVjdGluZyB0aGluZ3MgYnkgaGFuZCwgb3Igc29tZXRoaW5nIGJhc2VkIG9u IGEgeWVzb2Qgc3R5bGUgcXVhc2lxdW90ZXIuPC9kaXY+CjxkaXY+PGJyPjwvZGl2PjxkaXY+LSBq ZXJlbXk8L2Rpdj48L2Rpdj4K --===============1261114228449332106==-- From michael@snoyman.com Tue Mar 16 19:44:23 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Tue, 16 Mar 2010 17:15:00 -0700 Message-ID: <29bf512f1003161715k2da2cbf5jd6e1d6f130763fbc@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4554307601499833824==" --===============4554307601499833824== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Tue, Mar 16, 2010 at 3:00 PM, Jeremy Shaw wrote: > On Tue, Mar 16, 2010 at 11:54 AM, Chris Eidhof wrote: > >> On 16 mrt 2010, at 16:46, Michael Snoyman wrote: >> >> > Took me a bit to appreciate what you just said there, but I see your >> point now. It's true, it does have some very nice features. I'm still >> concerned about creating something which involves too much boilerplate. >> >> Yes. Generic programming (which is what the regular library provides) >> tries to hide the boilerplate (Template Haskell) code in a library and >> provides you with combinators so that you can program on the structure of a >> datatype. This is also at the core of my regular-web library [1], which >> generates forms/html/json/xml in the same way. You notice that on lines >> 34-36, I use the exact same TH calls. Once you did that, you get HTML and >> Formlets generation for free! > > > Using URLT.TH you would just need the one-liner: > > $(deriveAsURL ''UserRoute) > > However, if that is asking too much, I have also added URLT.Regular: > > http://src.seereason.com/urlt/URLT/Regular.hs > > So instead you do: > > $(deriveAll ''UserRoute "PFUserRoute") > type instance PF UserRoute =3D PFUserRoute > > instance AsURL UserRoute where > toURLS =3D gtoURLS . from > fromURLC =3D fmap (fmap to) gfromURLC > > >> > Am I understanding correctly that the URLs will be derived from the >> names of the datatypes? >> >> Exactly! > > > URLT currently allows you to generate the urls from the names via template > haskell, generics, or by writing instances by hand. I would like to add > support for QuasiQuotes similar to what is done in Yesod. > > > Also, how would you address URL dispatch in this approach? >> >> A URL is represented by a datastructure, e.g. ApplicationRoute. You would >> write a function "dispatch :: ApplicationRoute -> Application". Dispatch is >> not part of the library (and it shouldn't be, imo). In the module >> "MyApp.UserController" you might write a function "dispatchUser :: UserRou= te >> -> Application", which is called by the original dispatch function. >> >> > That is how URLT works -- except better. Your function type will be like: > > dispatchApp :: (ShowURL m, URL m ~ ApplicationRoute) =3D> ApplicationRoute > -> m a > > MyApp.UserController might have a function like: > > dispatchUser :: (ShowURL m, URL m ~ UserRoute) =3D> UserRoute -> m a > > the top level dispatchApp would call it like: > > dispatchApp (User userURL) =3D nestURL User $ dispatchApp userURL > > > The constraints ensure that your app is also only generating URLs of type > ApplicationRoute. If your app was generating urls of type UserRoute, but > expecting incoming urls of type ApplicationRoute, that clearly would not > work. > > Imagine if you accidentally wrote: > > dispatchApp Login =3D > do let url =3D toURL List > in list > > Here, in the dispatchApp function I accidentally called 'toURL List' > instead of, 'toURL (User List)'. In your code that is *not* caught as a type > error. With the ShowURL monad it is caught as a compile time error. If the > goal is type-safe URLs I think it is essential to catch this error, don't > you? > > - jeremy > Firstly, I haven't read through all of URLT, so take anything I say with a grain of salt. I'll happily be corrected where I misspeak. I'm not sure if I really see the big advantages for URLT over the code that I posted. As an advantage to my code, it's *much* smaller and easier to digest. I understand the URLT is doing a lot of other stuff with TH and the like, but I'm trying to look at the core of URL dispatch here. I would imagine having a system like this: * An underlying typeclass/datatype/whatever for defining a set of URLs. For lack of a better term, let's call it a WebSubapp. * The ability to embed a WebSubapp within another WebSubapp. * The ability to convert a resource in a WebSubapp into a relative path, and vice-versa. * Dispatch a request to a specific resource, passing also (either via explicit argument or through a Reader monad) a function to convert a resource into an absolute path. * Convert a WebSubapp into an Application. I'll assume for the moment that would be a Network.Wai.Application. Once we had that skeleton, we could dress it up however we want. For Yesod, I would change the mkResources quasi-quoter to produce an instance of WebSubapp. Others may wish to use the regular package, some might use TH, and others still may code it all directly. However, if we keep the same skeleton, then all of these will operate with each other seemlessly. The one piece of the puzzle that still irks me just a bit is initialization, such as creating database connections, loading settings, etc. I have some ideas on that as well, but I'll wait to discuss them after we get some of the more basic components addressed. Michael --===============4554307601499833824== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gVHVlLCBNYXIgMTYsIDIwMTAgYXQg MzowMCBQTSwgSmVyZW15IFNoYXcgPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWlsdG86 amVyZW15QG4taGVwdGFuZS5jb20iPmplcmVteUBuLWhlcHRhbmUuY29tPC9hPiZndDs8L3NwYW4+ IHdyb3RlOjxicj48YmxvY2txdW90ZSBjbGFzcz0iZ21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46 MCAwIDAgLjhleDtib3JkZXItbGVmdDoxcHggI2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4OyI+ CjxkaXYgY2xhc3M9ImltIj5PbiBUdWUsIE1hciAxNiwgMjAxMCBhdCAxMTo1NCBBTSwgQ2hyaXMg RWlkaG9mIDxzcGFuIGRpcj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFpbHRvOmNocmlzQGVpZGhvZi5u bCIgdGFyZ2V0PSJfYmxhbmsiPmNocmlzQGVpZGhvZi5ubDwvYT4mZ3Q7PC9zcGFuPiB3cm90ZTo8 YnI+PC9kaXY+PGRpdiBjbGFzcz0iZ21haWxfcXVvdGUiPjxkaXYgY2xhc3M9ImltIj48YmxvY2tx dW90ZSBjbGFzcz0iZ21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46MCAwIDAgLjhleDtib3JkZXIt bGVmdDoxcHggI2NjYyBzb2xpZDtwYWRkaW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LiBGb3Ig WWVzb2QsIEkgd291bGQgY2hhbmdlIHRoZSBta1Jlc291cmNlcyBxdWFzaS1xdW90ZXIgdG8gcHJv ZHVjZSBhbiBpbnN0YW5jZSBvZiBXZWJTdWJhcHAuIE90aGVycyBtYXkgd2lzaCB0byB1c2UgdGhl IHJlZ3VsYXIgcGFja2FnZSwgc29tZSBtaWdodCB1c2UgVEgsIGFuZCBvdGhlcnMgc3RpbGwgbWF5 IGNvZGUgaXQgYWxsIGRpcmVjdGx5LjwvZGl2Pgo8ZGl2Pjxicj48L2Rpdj48ZGl2Pkhvd2V2ZXIs IGlmIHdlIGtlZXAgdGhlIHNhbWUgc2tlbGV0b24sIHRoZW4gYWxsIG9mIHRoZXNlIHdpbGwgb3Bl cmF0ZSB3aXRoIGVhY2ggb3RoZXIgc2VlbWxlc3NseS48L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2 PlRoZSBvbmUgcGllY2Ugb2YgdGhlIHB1enpsZSB0aGF0IHN0aWxsIGlya3MgbWUganVzdCBhIGJp dCBpcyBpbml0aWFsaXphdGlvbiwgc3VjaCBhcyBjcmVhdGluZyBkYXRhYmFzZSBjb25uZWN0aW9u cywgbG9hZGluZyBzZXR0aW5ncywgZXRjLiBJIGhhdmUgc29tZSBpZGVhcyBvbiB0aGF0IGFzIHdl bGwsIGJ1dCBJJiMzOTtsbCB3YWl0IHRvIGRpc2N1c3MgdGhlbSBhZnRlciB3ZSBnZXQgc29tZSBv ZiB0aGUgbW9yZSBiYXNpYyBjb21wb25lbnRzIGFkZHJlc3NlZC48L2Rpdj4KPGRpdj48YnI+PC9k aXY+PGRpdj5NaWNoYWVsPC9kaXY+Cg== --===============4554307601499833824==-- From jeremy@n-heptane.com Tue Mar 16 23:11:43 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Tue, 16 Mar 2010 22:42:22 -0500 Message-ID: In-Reply-To: <29bf512f1003161715k2da2cbf5jd6e1d6f130763fbc@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1756835819355882568==" --===============1756835819355882568== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Tue, Mar 16, 2010 at 7:15 PM, Michael Snoyman wrote: > Firstly, I haven't read through all of URLT, so take anything I say with a > grain of salt. I'll happily be corrected where I misspeak. > > I'm not sure if I really see the big advantages for URLT over the code that > I posted. As an advantage to my code, it's *much* smaller and easier to > digest. I understand the URLT is doing a lot of other stuff with TH and the > like, but I'm trying to look at the core of URL dispatch here. I would > imagine having a system like this: > The essence of URLT is pretty darn small. The TH, generics, and all that other stuff is not required. This is the essence of URLT: newtype URLT url m a = URLT { unURLT :: ReaderT (url -> String) m a } deriving (Functor, Monad, MonadFix, MonadPlus, MonadIO, MonadTrans, MonadReader (url -> String)) showURL :: (Monad m) => url -> URLT url m String showURL u = do mkAbs <- ask return (mkAbs u) -- |used to embed a URLT into a larger parent url nestURL :: (Monad m) => (url2 -> url1) -> URLT url2 m a -> URLT url1 m a nestURL b = withURLT (. b) It's just one newtype wrapper around ReaderT and two very simple functions. No classes, no generics, no nothing.. To 'run' the URLT monad transformer (ie. go from 'URLT url m a' to 'm a') we simple supply a simple function of the type (url -> String). That is all that is required. To dispatch the incoming url we need a function that goes from (String -> url). And then we just write a plain old function that takes the type 'url' as an argument. So for the dispatch portion we don't require any classes or anything from the library itself. The Template Haskell, Generics, etc, are just there to provide some various ways of automatically deriving the (url -> String) and (String -> url) functions. * An underlying typeclass/datatype/whatever for defining a set of URLs. For > lack of a better term, let's call it a WebSubapp. > This would either refer to the monad URLT parameterized with a url type. e.g., URLT WebURL m a > > * The ability to embed a WebSubapp within another WebSubapp. > the nestURL function. > * The ability to convert a resource in a WebSubapp into a relative path, > and vice-versa. > showURL converts a relative path to an absolute. > * Dispatch a request to a specific resource, passing also (either via > explicit argument or through a Reader monad) a function to convert a > resource into an absolute path. > To dispatch a url you simple call the top-level handling function and pass in the url. The URLT environment holds the function to convert a resource into an absolute path. > * Convert a WebSubapp into an Application. I'll assume for the moment that > would be a Network.Wai.Application. > In the current URLT I have a function that does this for happstack. (that is the entire reason why URLT depends on happstack, and why it would be easy to split out). I can write a similar module for Wai tomorrow. > Once we had that skeleton, we could dress it up however we want. For Yesod, > I would change the mkResources quasi-quoter to produce an instance of > WebSubapp. Others may wish to use the regular package, some might use TH, > and others still may code it all directly. > In URLT mkResources would just need to return the two functions (String -> url) and (url -> String). > However, if we keep the same skeleton, then all of these will operate with > each other seemlessly. > Yes. TH and Regular already operate seamless in URLT. If you add mkResource it would as well. Let's examine WebPlug more closely. class WebPlug a where toRelPath :: a -> RelPath fromRelPath :: RelPath -> Maybe a dispatch :: a -> (a -> AbsPath) -> Application now, I think that having dispatch be part of the WebPlug class itself is a problem because it assumes that your dispatch function needs no other arguments besides the URL. I find that is often not the case. For an image gallery library, the dispatch function might need to take a FilePath argument which specifies where the image directory is. So I think it is better that you write a dispatch handler with a unique name for url type and call it by its unique name. Then there is no problem if you want to add other arguments. So, now you have a function like: dispatchBlog :: a -> (a -> AbsPath) -> Application. now in my function I might want to generate a url that I will use as an href value. It's can't be a relative url (obviously) it needs to be an absolute url. So I need to do something like this: dispatchBlog Foo mkAbs = let u = mkAbs (BlogPost 1) in Blog Post 1 Well, it can be a bit annoying to have to have to explicitly have that extra mkAbs argument on every pattern. So we could just wrap it up in ReaderT monad if we wanted: dispatchBlog :: a -> Reader (a -> AbsPath) Application and mkAbs can be: mkAbs :: a -> Reader (a -> AbsPath) AbsPath mkAbs url = do f <- ask return (f url) and we can use it like: dispatchBlog Foo = do u <- mkAbs (BlogPost 1) Blog Post 1 and were you currently have this: dispatch (MyBlog b) toAbsPath req = dispatch b (toAbsPath . MyBlog) req we would have something like: dispatchMyBlog (MyBlog b) = withReader (MyBlog .) $ dispatchBlog b we can rename withReader to make its intentions more clear: dispatchSub c = withReader (c .) and just write: dispatchMyBlog (MyBlog b) = dispatchSub MyBlog $ dispatchBlog b Since we got rid of the dispatch function in WebPlug we now have: class WebPlug a where toRelPath :: a -> RelPath fromRelPath :: RelPath -> Maybe a Personally, I think it should return Failure a instead of Maybe a, because we can include information about why it failed. class WebPlug a where toRelPath :: a -> RelPath fromRelPath :: RelPath -> Failing a Now, this class is useful, but not required. It is also essentially the same as AsURL We have a low-level function: plugToWai' :: (a -> ReaderT (a -> AbsPath) Application) -- ^ the dispatch function -> (a -> AbsPath) -- ^ function to convert url to an AbsPath -> (AbsPath -> a) -- ^ function to convert the AbsPath back to a url -> Application We can that function from the higher-level: plugToWai :: (WebPlug a) => (a -> ReaderT (a -> AbsPath) Application) -> Application if we have a dispatch function that takes argumens: fooDispatch :: FilePath -> Int -> a -> ReaderT (a -> AbsPath) Application, we just do something like: plugToWai (fooDispatch "foo" 1) So, to summerize: 1. I don't think dispatch can be a member of the class, because the various dispatch functions may need to take extra arguments, and you can't do that if dispatch is in a class. 2. if you pass the mkAbs function via the Reader monad instead of passing it as an explicit argument then you have pretty much exactly reinvented URLT. Hence, I think you have no option but to agree that URLT is what you wanted all along ;) I am happy to split the happstack and HSP portions out of the core library. I would even be happy to split regular and TH so that we can have: urlt urlt-regular urlt-th urlt-mkResource urt-hsp urlt-happstack urlt-wai urlt-all so that you can only only the extensions you care about. - jeremy --===============1756835819355882568== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gVHVlLCBNYXIgMTYsIDIwMTAgYXQgNzoxNSBQTSwgTWljaGFlbCBTbm95bWFuIDxzcGFuIGRp cj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFpbHRvOm1pY2hhZWxAc25veW1hbi5jb20iPm1pY2hhZWxA c25veW1hbi5jb208L2E+Jmd0Ozwvc3Bhbj4gd3JvdGU6PGJyPjxkaXYgY2xhc3M9ImdtYWlsX3F1 b3RlIj48YmxvY2txdW90ZSBjbGFzcz0iZ21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46MCAwIDAg LjhleDtib3JkZXItbGVmdDo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gd291bGQgZXZlbiBiZSBoYXBweSB0byBzcGxpdCBy ZWd1bGFyIGFuZCBUSCBzbyB0aGF0IHdlIGNhbiBoYXZlOjwvZGl2Pgo8ZGl2Pjxicj48L2Rpdj48 ZGl2PnVybHQ8L2Rpdj48ZGl2PnVybHQtcmVndWxhcjwvZGl2PjxkaXY+dXJsdC10aDwvZGl2Pjxk aXY+dXJsdC1ta1Jlc291cmNlPC9kaXY+PGRpdj51cnQtaHNwPC9kaXY+PGRpdj51cmx0LWhhcHBz dGFjazwvZGl2PjxkaXY+dXJsdC13YWk8L2Rpdj48ZGl2PnVybHQtYWxsPC9kaXY+PGRpdj48YnI+ PC9kaXY+PGRpdj5zbyB0aGF0IHlvdSBjYW4gb25seSBvbmx5IHRoZSBleHRlbnNpb25zIHlvdSBj YXJlIGFib3V0LjwvZGl2Pgo8ZGl2Pjxicj48L2Rpdj48ZGl2Pi0gamVyZW15oDwvZGl2PjwvZGl2 PjwvZGl2PjwvZGl2Pgo= --===============1756835819355882568==-- From michael@snoyman.com Tue Mar 16 23:35:14 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Tue, 16 Mar 2010 21:05:51 -0700 Message-ID: <29bf512f1003162105j1a6c274ayfd9809c3408b58c6@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3542529840059989664==" --===============3542529840059989664== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Tue, Mar 16, 2010 at 8:42 PM, Jeremy Shaw wrote: > On Tue, Mar 16, 2010 at 7:15 PM, Michael Snoyman wrote: > >> Firstly, I haven't read through all of URLT, so take anything I say with a >> grain of salt. I'll happily be corrected where I misspeak. >> >> I'm not sure if I really see the big advantages for URLT over the code >> that I posted. As an advantage to my code, it's *much* smaller and easier = to >> digest. I understand the URLT is doing a lot of other stuff with TH and the >> like, but I'm trying to look at the core of URL dispatch here. I would >> imagine having a system like this: >> > > The essence of URLT is pretty darn small. The TH, generics, and all that > other stuff is not required. This is the essence of URLT: > > newtype URLT url m a =3D URLT { unURLT :: ReaderT (url -> String) m a } > deriving (Functor, Monad, MonadFix, MonadPlus, MonadIO, MonadTrans, > MonadReader (url -> String)) > > showURL :: (Monad m) =3D> url -> URLT url m String > showURL u =3D > do mkAbs <- ask > return (mkAbs u) > > -- |used to embed a URLT into a larger parent url > nestURL :: (Monad m) =3D> (url2 -> url1) -> URLT url2 m a -> URLT url1 m a > nestURL b =3D withURLT (. b) > > It's just one newtype wrapper around ReaderT and two very simple functions. > No classes, no generics, no nothing.. > > To 'run' the URLT monad transformer (ie. go from 'URLT url m a' to 'm a') > we simple supply a simple function of the type (url -> String). > > That is all that is required. > > To dispatch the incoming url we need a function that goes from (String -> > url). And then we just write a plain old function that takes the type 'url' > as an argument. So for the dispatch portion we don't require any classes or > anything from the library itself. > > The Template Haskell, Generics, etc, are just there to provide some various > ways of automatically deriving the (url -> String) and (String -> url) > functions. > > * An underlying typeclass/datatype/whatever for defining a set of URLs. For >> lack of a better term, let's call it a WebSubapp. >> > > This would either refer to the monad URLT parameterized with a url type. > > e.g., URLT WebURL m a > >> >> * The ability to embed a WebSubapp within another WebSubapp. >> > > the nestURL function. > > >> * The ability to convert a resource in a WebSubapp into a relative path, >> and vice-versa. >> > > showURL converts a relative path to an absolute. > > >> * Dispatch a request to a specific resource, passing also (either via >> explicit argument or through a Reader monad) a function to convert a >> resource into an absolute path. >> > > To dispatch a url you simple call the top-level handling function and pass > in the url. The URLT environment holds the function to convert a resource > into an absolute path. > > >> * Convert a WebSubapp into an Application. I'll assume for the moment that >> would be a Network.Wai.Application. >> > > In the current URLT I have a function that does this for happstack. (that > is the entire reason why URLT depends on happstack, and why it would be easy > to split out). I can write a similar module for Wai tomorrow. > > >> Once we had that skeleton, we could dress it up however we want. For >> Yesod, I would change the mkResources quasi-quoter to produce an instance = of >> WebSubapp. Others may wish to use the regular package, some might use TH, >> and others still may code it all directly. >> > > In URLT mkResources would just need to return the two functions (String -> > url) and (url -> String). > > >> However, if we keep the same skeleton, then all of these will operate with >> each other seemlessly. >> > > Yes. TH and Regular already operate seamless in URLT. If you add mkResource > it would as well. > > Let's examine WebPlug more closely. > > class WebPlug a where > toRelPath :: a -> RelPath > fromRelPath :: RelPath -> Maybe a > dispatch :: a -> (a -> AbsPath) -> Application > > now, I think that having dispatch be part of the WebPlug class itself is a > problem because it assumes that your dispatch function needs no other > arguments besides the URL. I find that is often not the case. For an image > gallery library, the dispatch function might need to take a FilePath > argument which specifies where the image directory is. So I think it is > better that you write a dispatch handler with a unique name for url type and > call it by its unique name. Then there is no problem if you want to add > other arguments. > > So, now you have a function like: > > dispatchBlog :: a -> (a -> AbsPath) -> Application. > > now in my function I might want to generate a url that I will use as an > href value. It's can't be a relative url (obviously) it needs to be an > absolute url. So I need to do something like this: > > dispatchBlog Foo mkAbs =3D > let u =3D mkAbs (BlogPost 1) > in Blog Post 1 > > Well, it can be a bit annoying to have to have to explicitly have that > extra mkAbs argument on every pattern. So we could just wrap it up in > ReaderT monad if we wanted: > > dispatchBlog :: a -> Reader (a -> AbsPath) Application > > and mkAbs can be: > > mkAbs :: a -> Reader (a -> AbsPath) AbsPath > mkAbs url =3D > do f <- ask > return (f url) > > and we can use it like: > > dispatchBlog Foo =3D > do u <- mkAbs (BlogPost 1) > Blog Post 1 > > and were you currently have this: > > dispatch (MyBlog b) toAbsPath req =3D dispatch b (toAbsPath . MyBlog) > req > > we would have something like: > > dispatchMyBlog (MyBlog b) =3D withReader (MyBlog .) $ dispatchBlog b > > we can rename withReader to make its intentions more clear: > > dispatchSub c =3D withReader (c .) > > and just write: > > dispatchMyBlog (MyBlog b) =3D dispatchSub MyBlog $ dispatchBlog b > > Since we got rid of the dispatch function in WebPlug we now have: > > class WebPlug a where > toRelPath :: a -> RelPath > fromRelPath :: RelPath -> Maybe a > > Personally, I think it should return Failure a instead of Maybe a, because > we can include information about why it failed. > > class WebPlug a where > toRelPath :: a -> RelPath > fromRelPath :: RelPath -> Failing a > > Now, this class is useful, but not required. It is also essentially the > same as AsURL > > We have a low-level function: > > plugToWai' :: (a -> ReaderT (a -> AbsPath) Application) -- ^ the dispatch > function > -> (a -> AbsPath) -- ^ function to convert url to an > AbsPath > -> (AbsPath -> a) -- ^ function to convert the AbsPath > back to a url > -> Application > > We can that function from the higher-level: > > plugToWai :: (WebPlug a) =3D> (a -> ReaderT (a -> AbsPath) Application) -> > Application > > if we have a dispatch function that takes argumens: > > fooDispatch :: FilePath -> Int -> a -> ReaderT (a -> AbsPath) Application, > we just do something like: > > plugToWai (fooDispatch "foo" 1) > > So, to summerize: > > 1. I don't think dispatch can be a member of the class, because the > various dispatch functions may need to take extra arguments, and you can't > do that if dispatch is in a class. > 2. if you pass the mkAbs function via the Reader monad instead of passing > it as an explicit argument then you have pretty much exactly reinvented > URLT. > > Hence, I think you have no option but to agree that URLT is what you wanted > all along ;) I am happy to split the happstack and HSP portions out of the > core library. I would even be happy to split regular and TH so that we can > have: > > urlt > urlt-regular > urlt-th > urlt-mkResource > urt-hsp > urlt-happstack > urlt-wai > urlt-all > > so that you can only only the extensions you care about. > > - jeremy > Very thorough breakdown, +2 ;). As far as the ReaderT versus extra argument: I think this is a general argument that we could always have. I agree that monad stacks are more convenient; on the other hand, if we want to make something as palatable to as many people as possible, we would probably want to avoid the mtl vs transformers debate like the plague. See, for instance, what we had to do with control-monad-failure and control-monad-failure-mtl. Anyway, let's agree that that's almost irrelevant. I also agree completely with your point about needing to pass extra parameters; I just pushed an update to my gist (http://gist.github.com/334475) which addresses just that. My gist is *incredibly* similar to urlt, so frankly, I'd be happy taking urlt exactly as you've defined it so far. But for sake of completeness, I'd like to point out the last important difference. My new version has two typeclasses, I'll copy them in their entirety here: class IsRelPath a where toRelPath :: a -> RelPath fromRelPath :: RelPath -> Maybe a class IsRelPath (Routes a) =3D> WebPlug a where type Routes a dispatch :: a -> Routes a -> (Routes a -> AbsPath) -> Application I think we all agree that IsRelPath 1) needs to exist and 2) should be called something better than that. I would say that it's useful to have dispatch as part of a typeclass, which is what WebPlug now is. What makes this typeclass so convenient is that any instance of WebPlug is *self contained*. There's no need to keep track of which subapps require which arguments. Finally, regarding the ReaderT issue, I would recommend making anything that requires monad transformers be a layer on top of the low-level code. Take, for instance, a comparison of the CGI monad versus the WAI Request -> IO Response; I find the latter much nicer to deal with, and if I ever want to, I could package up the Request in a ReaderT at some later stage.* Michael * Yes, I know we could unwrap the ReaderT and go in the reverse direction. --===============3542529840059989664== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gVHVlLCBNYXIgMTYsIDIwMTAgYXQg ODo0MiBQTSwgSmVyZW15IFNoYXcgPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWlsdG86 amVyZW15QG4taGVwdGFuZS5jb20iPmplcmVteUBuLWhlcHRhbmUuY29tPC9hPiZndDs8L3NwYW4+ IHdyb3RlOjxicj48YmxvY2txdW90ZSBjbGFzcz0iZ21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46 MCAwIDAgLjhleDtib3JkZXItbGVmdDoxcHggI2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4OyI+ CjxkaXYgY2xhc3M9ImltIj5PbiBUdWUsIE1hciAxNiwgMjAxMCBhdCA3OjE1IFBNLCBNaWNoYWVs IFNub3ltYW4gPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWlsdG86bWljaGFlbEBzbm95 bWFuLmNvbSIgdGFyZ2V0PSJfYmxhbmsiPm1pY2hhZWxAc25veW1hbi5jb208L2E+Jmd0Ozwvc3Bh bj4gd3JvdGU6PGJyPjwvZGl2PjxkaXYgY2xhc3M9ImdtYWlsX3F1b3RlIj48ZGl2IGNsYXNzPSJp bSI+CjxibG9ja3F1b3RlIGNsYXNzPSJnbWFpbF9xdW90ZSIgc3R5bGU9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p dj48L2Rpdj4K --===============3542529840059989664==-- From jeremy@n-heptane.com Wed Mar 17 15:17:50 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Wed, 17 Mar 2010 14:48:31 -0500 Message-ID: In-Reply-To: <29bf512f1003162105j1a6c274ayfd9809c3408b58c6@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1556818542776585499==" --===============1556818542776585499== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Tue, Mar 16, 2010 at 11:05 PM, Michael Snoyman wrote: > > My new version has two typeclasses, I'll copy them in their entirety here: > > class IsRelPath a where > toRelPath :: a -> RelPath > fromRelPath :: RelPath -> Maybe a > > class IsRelPath (Routes a) => WebPlug a where > type Routes a > dispatch :: a -> Routes a -> (Routes a -> AbsPath) -> Application > > I think we all agree that IsRelPath 1) needs to exist and 2) should be > called something better than that. I would say that it's useful to have > dispatch as part of a typeclass, which is what WebPlug now is. What makes > this typeclass so convenient is that any instance of WebPlug is *self > contained*. There's no need to keep track of which subapps require which > arguments. > > I am not really clear wath the benefit for WebPlug is -- it seems to me that it is just adding more boilerplate.. I added two new modules to URLT, namely URLT.Wai and URLT.Dispatch. I think implemented your little blog demo twice. Once where I didn't use dispatch, and once were I did. The code for that is here: http://src.seereason.com/urlt/WaiExample.hs It seemed like using dispatch did not get rid of or simplify anything, it just added more boiler plate, type classes, and used extensions (type families) that a lot of people don't understand yet. And instead of writing something short a straigt-forward like: handleWai mkAbs fromAbs (mySite now) I had to write the longer: handleWai mkAbs fromAbs (dispatch (SiteArgs (BlogArgs now))) And on the handler end, it hide useful information in the type signature and required more constructor matching. Instead of: myBlog :: UTCTime -> (BlogURL -> String) -> BlogURL -> Application myBlog now mkAbs BlogHome _request = I have: myBlogD :: BlogArgs -> (BlogURL -> String) -> BlogURL -> Application myBlogD (BlogArgs now) mkAbs BlogHome _request = In order to know the type of 'now' I have to go look somewhere else. In 'myBlog' it was right there in the type signature. So, I guess I do not yet see the value of Dispatch. On the plus side, it doesn't seem like I have to use it if I don't like it. But I am curious if I am missing something useful here.. One advantage is that I can do: :info Dispatch in GHCi, and see all the Dispatch instances that are available. But I'm not sure that really makes it worth the effort. - jeremy p.s. The WaiExample does not use AsURL / IsRelPath, because that is really a completely orthogonal issue, and I wanted to cut out anything that was not relevant. --===============1556818542776585499== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gVHVlLCBNYXIgMTYsIDIwMTAgYXQgMTE6MDUgUE0sIE1pY2hhZWwgU25veW1hbiA8c3BhbiBk aXI9Imx0ciI+Jmx0OzxhIGhyZWY9Im1haWx0bzptaWNoYWVsQHNub3ltYW4uY29tIj5taWNoYWVs QHNub3ltYW4uY29tPC9hPiZndDs8L3NwYW4+IHdyb3RlOjxicj48ZGl2IGNsYXNzPSJnbWFpbF9x dW90ZSI+PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0ibWFyZ2luOjAgMCAw IC44ZXg7Ym9yZGVyLWxlZnQ6MXB4ICNjY2Mgc29saWQ7cGFkZGluZy1sZWZ0OjFleDsiPgo8ZGl2 PjxkaXY+PC9kaXY+PGRpdiBjbGFzcz0iaDUiPjxicj48L2Rpdj48L2Rpdj48ZGl2Pk15IG5ldyB2 ZXJzaW9uIGhhcyB0d28gdHlwZWNsYXNzZXMsIEkmIzM5O2xsIGNvcHkgdGhlbSBpbiB0aGVpciBl bnRpcmV0eSBoZXJlOjwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+PGRpdj5jbGFzcyBJc1JlbFBh dGggYSB3aGVyZTwvZGl2PjxkaXYgY2xhc3M9ImltIj48ZGl2PqCgIKB0b1JlbFBhdGggOjogYSAt Jmd0OyBSZWxQYXRoPC9kaXY+CjxkaXY+oKAgoGZyb21SZWxQYXRoIDo6IFJlbFBhdGggLSZndDsg TWF5YmUgYTwvZGl2Pgo8ZGl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From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Wed, 17 Mar 2010 15:47:42 -0700 Message-ID: <29bf512f1003171547s4ec4fc00m5ba71f25ca0b5963@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1018573816906637443==" --===============1018573816906637443== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Wed, Mar 17, 2010 at 12:48 PM, Jeremy Shaw wrote: > On Tue, Mar 16, 2010 at 11:05 PM, Michael Snoyman wrot= e: > >> >> My new version has two typeclasses, I'll copy them in their entirety here: >> >> class IsRelPath a where >> toRelPath :: a -> RelPath >> fromRelPath :: RelPath -> Maybe a >> >> class IsRelPath (Routes a) =3D> WebPlug a where >> type Routes a >> dispatch :: a -> Routes a -> (Routes a -> AbsPath) -> Application >> >> I think we all agree that IsRelPath 1) needs to exist and 2) should be >> called something better than that. I would say that it's useful to have >> dispatch as part of a typeclass, which is what WebPlug now is. What makes >> this typeclass so convenient is that any instance of WebPlug is *self >> contained*. There's no need to keep track of which subapps require which >> arguments. >> >> > I am not really clear wath the benefit for WebPlug is -- it seems to me > that it is just adding more boilerplate.. > > I added two new modules to URLT, namely URLT.Wai and URLT.Dispatch. > > I think implemented your little blog demo twice. Once where I didn't use > dispatch, and once were I did. The code for that is here: > > http://src.seereason.com/urlt/WaiExample.hs > > It seemed like using dispatch did not get rid of or simplify anything, it > just added more boiler plate, type classes, and used extensions (type > families) that a lot of people don't understand yet. > > And instead of writing something short a straigt-forward like: > > handleWai mkAbs fromAbs (mySite now) > > I had to write the longer: > > handleWai mkAbs fromAbs (dispatch (SiteArgs (BlogArgs now))) > > And on the handler end, it hide useful information in the type signature > and required more constructor matching. Instead of: > > myBlog :: UTCTime -> (BlogURL -> String) -> BlogURL -> Application > myBlog now mkAbs BlogHome _request =3D > > I have: > > myBlogD :: BlogArgs -> (BlogURL -> String) -> BlogURL -> Application > myBlogD (BlogArgs now) mkAbs BlogHome _request =3D > > In order to know the type of 'now' I have to go look somewhere else. In > 'myBlog' it was right there in the type signature. > > So, I guess I do not yet see the value of Dispatch. On the plus side, it > doesn't seem like I have to use it if I don't like it. But I am curious if I > am missing something useful here.. > > One advantage is that I can do: > > :info Dispatch > > in GHCi, and see all the Dispatch instances that are available. But I'm not > sure that really makes it worth the effort. > > - jeremy > > p.s. The WaiExample does not use AsURL / IsRelPath, because that is really > a completely orthogonal issue, and I wanted to cut out anything that was not > relevant. > > Firstly, I think the most valid concern about my appoach is that it uses TypeFamilies. I grant that 100%. Now, as far as your concerns about boilerplate and hiding of types: you're correct on the small scale. When dealing with simple examples, it makes perfect sense to just pass in the 2 or 3 arguments directly instead of having a datatype declared. I see the advantage of having a unified typeclass/dispatch function for dealing with large, nested applications. That said, your example and my example are not exactly the same. I find the final line of mine to be *much* more concise than your Dispatch version. Let's compare them directly: Mine: run 3000 $ plugToWai (MySite $ Blog now) "http://localhost:3000/" Your dispatch version: run 3000 $ handleWai mkAbs fromAbs (dispatch (SiteArgs (BlogArgs now))) Your handleWai version: run 3000 $ handleWai mkAbs fromAbs (mySite now) I think a lot of the boilerplate you experienced comes from your implementation of my idea, not the idea itself. However, let's try to deal with some of the other important issues. Firstly, Failing versus Maybe: I can't really see a case when you'd need to specify why the path is not a valid URL. It would seem that either it's a theoretically valid path, or it's not. Issues like "that object doesn't exist" wouldn't be handled at the dispatch level usually. I still think we need to reconsider relying on one or the other monad transformer library. I notice now that you're using mtl; Yesod uses transformers. I don't really have a strong preference on this, but it's immediately divisive. There's one other major difference between URLT and my gist: my gist splits a path into pieces and hands that off for parsing. Your code allows each function to handle that itself. In your example, you use the default Read instance (I assume for simplicity). Splitting into pieces the way I did allowed for easy pattern matching; what would URLT code look like that handled "real" URLs? Michael --===============1018573816906637443== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+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eW91IHVzZSB0aGUgZGVmYXVsdCBSZWFkIGluc3RhbmNlIChJIGFz c3VtZSBmb3Igc2ltcGxpY2l0eSkuIFNwbGl0dGluZyBpbnRvIHBpZWNlcyB0aGUgd2F5IEkgZGlk IGFsbG93ZWQgZm9yIGVhc3kgcGF0dGVybiBtYXRjaGluZzsgd2hhdCB3b3VsZCBVUkxUIGNvZGUg bG9vayBsaWtlIHRoYXQgaGFuZGxlZCAmcXVvdDtyZWFsJnF1b3Q7IFVSTHM/PC9kaXY+CjxkaXY+ PGJyPjwvZGl2PjxkaXY+TWljaGFlbDwvZGl2PjwvZGl2Pgo= --===============1018573816906637443==-- From jeremy@n-heptane.com Thu Mar 18 16:36:21 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Thu, 18 Mar 2010 16:07:01 -0500 Message-ID: In-Reply-To: <29bf512f1003171547s4ec4fc00m5ba71f25ca0b5963@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9033521753201875667==" --===============9033521753201875667== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Wed, Mar 17, 2010 at 5:47 PM, Michael Snoyman wrote: > > Now, as far as your concerns about boilerplate and hiding of types: you're > correct on the small scale. When dealing with simple examples, it makes > perfect sense to just pass in the 2 or 3 arguments directly instead of > having a datatype declared. I see the advantage of having a unified > typeclass/dispatch function for dealing with large, nested applications. > I can see how declaring a datatype (typically a record) can be useful when you are passing a larger number of arguments to a subhandler. In fact, I already have real code based on URLT where I do that. In the existing example, I can call the version with the wrapped up arguments just fine with out dispatch: run 3000 $ handleWaiU (mySiteD (SiteArgs (BlogArgs now))) " http://localhost:3000" If I call it using dispatch, then it is one token shorter: run 3000 $ handleWaiD (SiteArgs (BlogArgs now)) "http://localhost:3000" except I also am forced to add all these tokens: instance Dispatch SiteArgs where type Routes SiteArgs = SiteURL type App SiteArgs = Application dispatch = mySiteD even though I am only going to call dispatch on SiteArgs one place in my code. So, without dispatch you get the option of using data-types to bundle up arguments if you want to. I don't see how dispatch improves on that portion. With dispatch you are forced to whether you want to or not. The reason you are forced to is because dispatch requires a uniquely named type so it can determine which function to call. One advantage of Dispatch, is that you can write polymorphic functions that call dispatch: myFunc :: (Dispatch a) => a -> ... Is that something we are likely to exploit? > That said, your example and my example are not exactly the same. I find the > final line of mine to be *much* more concise than your Dispatch version. > Let's compare them directly: > > Mine: > run 3000 $ plugToWai (MySite $ Blog now) "http://localhost:3000/" > Your dispatch version: > run 3000 $ handleWai mkAbs fromAbs (dispatch (SiteArgs (BlogArgs > now))) > Your handleWai version: > run 3000 $ handleWai mkAbs fromAbs (mySite now) > True. If I had a version of handleWai that uses AsURL (similar to how plugToWai works). Then we have: Yours: run 3000 $ plugToWai (MySite $ Blog now) "http://localhost:3000/" Mine (no dispatch): run 3000 $ handleWaiU (mySite now) "http://localhost:3000" Mine (dispatch) run 3000 $ handleWaiD (MySite $ Blog now) "http://localhost:3000" which are essentially the same. Without dispatch, mine could potentially be one token longer. Though in this case it is one token shorter. The version with dispatch is, of course, the same length. I think a lot of the boilerplate you experienced comes from your > implementation of my idea, not the idea itself. > I guess at this point I just feel like it is easier and more straightforward to call the handlers by unique names than to create an instance of Dispatch so I can call the handler using a general name. So, I am looking for some compelling examples where I am going to benefit from having a function like, dispatch :: (Dispatch a) => a -> (Routes a -> String) -> Routes a -> App a, hanging around. Though, as I also mentioned. I don't mind having the Dispatch class in the library as long as I am not required to use it. > However, let's try to deal with some of the other important issues. > Firstly, Failing versus Maybe: I can't really see a case when you'd need to > specify why the path is not a valid URL. It would seem that either it's a > theoretically valid path, or it's not. Issues like "that object doesn't > exist" wouldn't be handled at the dispatch level usually. > I have founding the Failing class to be very useful when using URLT for implementing a REST API. The links within my Haskell app won't fail, but links generated by non-Haskell clients can fail. For example, if some php programmer accidentally tries to get, /mysite/myblog/foobar/bolg/1 -- they are going to be a lot happier to see: expecting, 'blog', 'images', 'foo', but got 'bolg', than they would be if they just got 'invalid url'. (Even better would be if it gave the character offset to the bogus path component). Also, if you are writing the toURL / fromURL functions by hand instead of deriving them automatically somehow, then you are going to get it wrong sometimes (in my experience, often). I provide a QuickCheck function that can be used to ensure that your toURL / fromURL functions are inverses. But when the test fails, it is nice to get a more specific error message. I still think we need to reconsider relying on one or the other monad > transformer library. I notice now that you're using mtl; Yesod uses > transformers. I don't really have a strong preference on this, but it's > immediately divisive. > I refactored so that it does not really depend on either now. I did this by basically reimplementing URLT as a native Reader-like monad instead of wrapping around ReaderT. I added URLT.MTL and URLT.Transformers which contain the MonadTrans and MonadIO instances. But they are not used by any of the code. Happstack is currently mtl based. I think I like transformers better, though I am saddened to see they do not have the classes like MonadReader, MonadWriter, etc. > There's one other major difference between URLT and my gist: my gist splits > a path into pieces and hands that off for parsing. Your code allows each > function to handle that itself. In your example, you use the default Read > instance (I assume for simplicity). Splitting into pieces the way I did > allowed for easy pattern matching; what would URLT code look like that > handled "real" URLs? > I like the String over the [String] because it is the most general form of representing a URL. If you wanted to use URLT to handle both the pathInfo and the query string parameters, then [String] isn't really the correct type. Though there could be something better than String as well... As for handling, "real" URLs, there are a variety of solutions. If you don't care too much about the prettiness of the URLs you can use template haskell to generate AsURL instances: $(deriveAsURL ''BlogURL) $(deriveAsURL ''SiteURL) main1b :: IO () main1b = do now <- getCurrentTime run 3000 $ handleWaiU (mySite now) "http://localhost:3000" Or if you prefer Regular over TH you can do something like this (we can probably be cleaned up a little): $(deriveAll ''BlogURL "PFBlogURL") type instance PF BlogURL = PFBlogURL instance AsURL BlogURL where toURLS = gtoURLS . from fromURLC = fmap (fmap to) gfromURLC $(deriveAll ''SiteURL "PFSiteURL") type instance PF SiteURL = PFSiteURL instance AsURL SiteURL where toURLS = gtoURLS . from fromURLC = fmap (fmap to) gfromURLC that should also work with main1b. Or you could do it without AsURL at all using syb: gtoURL :: (Data url) => url -> String gfromURL :: (Data url) => String -> Failing url run 3000 $ handleWai gtoURL gfromURL (mySite now) " http://localhost:3000" Or you could add an AsURL instance that just called gtoURL / gfromURL, and then you could use handleWaiU. If you want to write parsers by hand, you could do it using parsec: main1c :: IO () main1c = do now <- getCurrentTime run 3000 $ handleWai toSiteURL (fromURLP pSiteURL) (mySite now) " http://localhost:3000" where pBlogURL :: Parser BlogURL pBlogURL = do char '/' (BlogPost <$> many1 (noneOf "/")) <|> pure BlogHome pSiteURL :: Parser SiteURL pSiteURL = do char '/' MyBlog <$> (string "blog" *> pBlogURL) <|> pure MyHome toBlogURL :: BlogURL -> String toBlogURL BlogHome = "" toBlogURL (BlogPost title) = title toSiteURL :: SiteURL -> String toSiteURL MyHome = "" toSiteURL (MyBlog blogURL) = "blog/" (toBlogURL blogURL) In this example, I call handleWai. But I could also create AsURL instances and call handleWaiU. Parsec is perhaps not the best choice of parser combinators. A more specialized URL parser combinator library might be nice. We could also add a helper function so that it is easier to do things via straight pattern matching. But I think straight pattern patching may prove tedious rather quickly? In general though, I am not a big fan of writing the converters by hand, because there is no assurance that they are inverses of each other, and it's annoying to have to basically express the same structure twice -- once to parse it, and once to print it. But there does need to be someway where you can very explicitly map how the datatype and string representation of the URL are related. It would be much better if there was a DSL that simultaneously expressed how to parse and how to print. I have not worked out how to do that yet though -- it is somewhat tricky. However, the quasiquote stuff looks potentially promising as a way of expressing the parsing and printing in a single step... - jeremy --===============9033521753201875667== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gV2VkLCBNYXIgMTcsIDIwMTAgYXQgNTo0NyBQTSwgTWljaGFlbCBTbm95bWFuIDxzcGFuIGRp cj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFpbHRvOm1pY2hhZWxAc25veW1hbi5jb20iIHRhcmdldD0i X2JsYW5rIj5taWNoYWVsQHNub3ltYW4uY29tPC9hPiZndDs8L3NwYW4+IHdyb3RlOjxicj48ZGl2 IGNsYXNzPSJnbWFpbF9xdW90ZSI+PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3Rl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uLjwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+LSBqZXJl bXk8L2Rpdj48L2Rpdj48L2Rpdj48L2Rpdj48L2Rpdj48L2Rpdj4K --===============9033521753201875667==-- From jeremy@n-heptane.com Thu Mar 18 16:36:59 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Thu, 18 Mar 2010 16:07:44 -0500 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5141106841182243109==" --===============5141106841182243109== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable I should note that I pushed updates to WaiExample and the URLT library in regards to this post. - jeremy On Thu, Mar 18, 2010 at 4:07 PM, Jeremy Shaw wrote: > On Wed, Mar 17, 2010 at 5:47 PM, Michael Snoyman wrote: > >> >> Now, as far as your concerns about boilerplate and hiding of types: you're >> correct on the small scale. When dealing with simple examples, it makes >> perfect sense to just pass in the 2 or 3 arguments directly instead of >> having a datatype declared. I see the advantage of having a unified >> typeclass/dispatch function for dealing with large, nested applications. >> > > I can see how declaring a datatype (typically a record) can be useful when > you are passing a larger number of arguments to a subhandler. In fact, I > already have real code based on URLT where I do that. In the existing > example, I can call the version with the wrapped up arguments just fine with > out dispatch: > > run 3000 $ handleWaiU (mySiteD (SiteArgs (BlogArgs now))) " > http://localhost:3000" > > If I call it using dispatch, then it is one token shorter: > > run 3000 $ handleWaiD (SiteArgs (BlogArgs now)) " > http://localhost:3000" > > except I also am forced to add all these tokens: > > instance Dispatch SiteArgs where > type Routes SiteArgs =3D SiteURL > type App SiteArgs =3D Application > dispatch =3D mySiteD > > even though I am only going to call dispatch on SiteArgs one place in my > code. > > So, without dispatch you get the option of using data-types to bundle up > arguments if you want to. I don't see how dispatch improves on that portion. > > With dispatch you are forced to whether you want to or not. The reason you > are forced to is because dispatch requires a uniquely named type so it can > determine which function to call. > > One advantage of Dispatch, is that you can write polymorphic functions that > call dispatch: > > myFunc :: (Dispatch a) =3D> a -> ... > > Is that something we are likely to exploit? > > >> That said, your example and my example are not exactly the same. I find >> the final line of mine to be *much* more concise than your Dispatch versio= n. >> Let's compare them directly: >> >> Mine: >> run 3000 $ plugToWai (MySite $ Blog now) "http://localhost:3000/" >> Your dispatch version: >> run 3000 $ handleWai mkAbs fromAbs (dispatch (SiteArgs (BlogArgs >> now))) >> Your handleWai version: >> run 3000 $ handleWai mkAbs fromAbs (mySite now) >> > > > True. If I had a version of handleWai that uses AsURL (similar to how > plugToWai works). Then we have: > > Yours: > run 3000 $ plugToWai (MySite $ Blog now) "http://localhost:3000/" > Mine (no dispatch): > run 3000 $ handleWaiU (mySite now) "http://localhost:3000" > Mine (dispatch) > run 3000 $ handleWaiD (MySite $ Blog now) "http://localhost:3000" > > which are essentially the same. Without dispatch, mine could potentially be > one token longer. Though in this case it is one token shorter. The version > with dispatch is, of course, the same length. > > I think a lot of the boilerplate you experienced comes from your >> implementation of my idea, not the idea itself. >> > > I guess at this point I just feel like it is easier and more > straightforward to call the handlers by unique names than to create an > instance of Dispatch so I can call the handler using a general name. So, I > am looking for some compelling examples where I am going to benefit from > having a function like, dispatch :: (Dispatch a) =3D> a -> (Routes a -> > String) -> Routes a -> App a, hanging around. > > Though, as I also mentioned. I don't mind having the Dispatch class in the > library as long as I am not required to use it. > > >> However, let's try to deal with some of the other important issues. >> Firstly, Failing versus Maybe: I can't really see a case when you'd need to >> specify why the path is not a valid URL. It would seem that either it's a >> theoretically valid path, or it's not. Issues like "that object doesn't >> exist" wouldn't be handled at the dispatch level usually. >> > > I have founding the Failing class to be very useful when using URLT for > implementing a REST API. The links within my Haskell app won't fail, but > links generated by non-Haskell clients can fail. For example, if some php > programmer accidentally tries to get, /mysite/myblog/foobar/bolg/1 -- they > are going to be a lot happier to see: > > expecting, 'blog', 'images', 'foo', but got 'bolg', than they would be > if they just got 'invalid url'. (Even better would be if it gave the > character offset to the bogus path component). > > Also, if you are writing the toURL / fromURL functions by hand instead of > deriving them automatically somehow, then you are going to get it wrong > sometimes (in my experience, often). I provide a QuickCheck function that > can be used to ensure that your toURL / fromURL functions are inverses. But > when the test fails, it is nice to get a more specific error message. > > I still think we need to reconsider relying on one or the other monad >> transformer library. I notice now that you're using mtl; Yesod uses >> transformers. I don't really have a strong preference on this, but it's >> immediately divisive. >> > > I refactored so that it does not really depend on either now. I did this by > basically reimplementing URLT as a native Reader-like monad instead of > wrapping around ReaderT. I added URLT.MTL and URLT.Transformers which > contain the MonadTrans and MonadIO instances. But they are not used by any > of the code. > > Happstack is currently mtl based. I think I like transformers better, > though I am saddened to see they do not have the classes like MonadReader, > MonadWriter, etc. > > >> There's one other major difference between URLT and my gist: my gist >> splits a path into pieces and hands that off for parsing. Your code allows >> each function to handle that itself. In your example, you use the default >> Read instance (I assume for simplicity). Splitting into pieces the way I d= id >> allowed for easy pattern matching; what would URLT code look like that >> handled "real" URLs? >> > > I like the String over the [String] because it is the most general form of > representing a URL. If you wanted to use URLT to handle both the pathInfo > and the query string parameters, then [String] isn't really the correct > type. Though there could be something better than String as well... > > As for handling, "real" URLs, there are a variety of solutions. If you > don't care too much about the prettiness of the URLs you can use template > haskell to generate AsURL instances: > > $(deriveAsURL ''BlogURL) > $(deriveAsURL ''SiteURL) > > main1b :: IO () > main1b =3D > do now <- getCurrentTime > run 3000 $ handleWaiU (mySite now) "http://localhost:3000" > > Or if you prefer Regular over TH you can do something like this (we can > probably be cleaned up a little): > > $(deriveAll ''BlogURL "PFBlogURL") > type instance PF BlogURL =3D PFBlogURL > > instance AsURL BlogURL where > toURLS =3D gtoURLS . from > fromURLC =3D fmap (fmap to) gfromURLC > > $(deriveAll ''SiteURL "PFSiteURL") > type instance PF SiteURL =3D PFSiteURL > > instance AsURL SiteURL where > toURLS =3D gtoURLS . from > fromURLC =3D fmap (fmap to) gfromURLC > > that should also work with main1b. > > Or you could do it without AsURL at all using syb: > > gtoURL :: (Data url) =3D> url -> String > gfromURL :: (Data url) =3D> String -> Failing url > > run 3000 $ handleWai gtoURL gfromURL (mySite now) " > http://localhost:3000" > > Or you could add an AsURL instance that just called gtoURL / gfromURL, and > then you could use handleWaiU. > > If you want to write parsers by hand, you could do it using parsec: > > main1c :: IO () > main1c =3D > do now <- getCurrentTime > run 3000 $ handleWai toSiteURL (fromURLP pSiteURL) (mySite now) " > http://localhost:3000" > where > pBlogURL :: Parser BlogURL > pBlogURL =3D > do char '/' > (BlogPost <$> many1 (noneOf "/")) <|> pure BlogHome > pSiteURL :: Parser SiteURL > pSiteURL =3D > do char '/' > MyBlog <$> (string "blog" *> pBlogURL) <|> pure MyHome > > toBlogURL :: BlogURL -> String > toBlogURL BlogHome =3D "" > toBlogURL (BlogPost title) =3D title > > toSiteURL :: SiteURL -> String > toSiteURL MyHome =3D "" > toSiteURL (MyBlog blogURL) =3D "blog/" (toBlogURL blogURL) > > In this example, I call handleWai. But I could also create AsURL instances > and call handleWaiU. > > Parsec is perhaps not the best choice of parser combinators. A more > specialized URL parser combinator library might be nice. > > We could also add a helper function so that it is easier to do things via > straight pattern matching. But I think straight pattern patching may prove > tedious rather quickly? > > In general though, I am not a big fan of writing the converters by hand, > because there is no assurance that they are inverses of each other, and it's > annoying to have to basically express the same structure twice -- once to > parse it, and once to print it. > > But there does need to be someway where you can very explicitly map how the > datatype and string representation of the URL are related. > > It would be much better if there was a DSL that simultaneously expressed > how to parse and how to print. I have not worked out how to do that yet > though -- it is somewhat tricky. > > However, the quasiquote stuff looks potentially promising as a way of > expressing the parsing and printing in a single step... > > - jeremy > --===============5141106841182243109== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SSBzaG91bGQgbm90ZSB0aGF0IEkgcHVzaGVkIHVwZGF0ZXMgdG8gV2FpRXhhbXBsZSBhbmQgdGhl IFVSTFQgbGlicmFyeSBpbiByZWdhcmRzIHRvIHRoaXMgcG9zdC48ZGl2Pjxicj48L2Rpdj48ZGl2 Pi0gamVyZW15PGJyPjxicj48ZGl2IGNsYXNzPSJn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4Ij48ZGl2Pi0gamVyZW15PC9kaXY+PC9mb250PjwvZGl2 Pgo8L2Rpdj48L2Rpdj48L2Rpdj48L2Rpdj4KPC9ibG9ja3F1b3RlPjwvZGl2Pjxicj48L2Rpdj4K --===============5141106841182243109==-- From greg@gregorycollins.net Thu Mar 18 16:47:15 2010 From: Gregory Collins To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Thu, 18 Mar 2010 17:17:59 -0400 Message-ID: <87k4t91g8o.fsf@gregorycollins.net> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0337057111645349584==" --===============0337057111645349584== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Jeremy Shaw writes: > Happstack is currently mtl based. I think I like transformers better, > though I am saddened to see they do not have the classes like > MonadReader, MonadWriter, etc. http://hackage.haskell.org/packages/archive/monads-fd/0.0.0.1/doc/html/Contro= l-Monad-Reader-Class.html Transformers is intended to be used with either "monads-fd" (to get those instances using fundeps) or "monads-tf" (similar formulations with type families.) Monads-fd should be backwards-compatible w/ mtl. G --=20 Gregory Collins --===============0337057111645349584==-- From michael@snoyman.com Thu Mar 18 17:46:38 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Thu, 18 Mar 2010 15:17:23 -0700 Message-ID: <29bf512f1003181517u4ff68b4am1be0b54e35b5123c@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1952452205302058738==" --===============1952452205302058738== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 18, 2010 at 2:07 PM, Jeremy Shaw wrote: > On Wed, Mar 17, 2010 at 5:47 PM, Michael Snoyman wrote: > >> >> Now, as far as your concerns about boilerplate and hiding of types: you're >> correct on the small scale. When dealing with simple examples, it makes >> perfect sense to just pass in the 2 or 3 arguments directly instead of >> having a datatype declared. I see the advantage of having a unified >> typeclass/dispatch function for dealing with large, nested applications. >> > > I can see how declaring a datatype (typically a record) can be useful when > you are passing a larger number of arguments to a subhandler. In fact, I > already have real code based on URLT where I do that. In the existing > example, I can call the version with the wrapped up arguments just fine with > out dispatch: > > run 3000 $ handleWaiU (mySiteD (SiteArgs (BlogArgs now))) " > http://localhost:3000" > > If I call it using dispatch, then it is one token shorter: > > run 3000 $ handleWaiD (SiteArgs (BlogArgs now)) " > http://localhost:3000" > > except I also am forced to add all these tokens: > > instance Dispatch SiteArgs where > type Routes SiteArgs =3D SiteURL > type App SiteArgs =3D Application > dispatch =3D mySiteD > > even though I am only going to call dispatch on SiteArgs one place in my > code. > > So, without dispatch you get the option of using data-types to bundle up > arguments if you want to. I don't see how dispatch improves on that portion. > > With dispatch you are forced to whether you want to or not. The reason you > are forced to is because dispatch requires a uniquely named type so it can > determine which function to call. > > One advantage of Dispatch, is that you can write polymorphic functions that > call dispatch: > > myFunc :: (Dispatch a) =3D> a -> ... > > Is that something we are likely to exploit? > > >> That said, your example and my example are not exactly the same. I find >> the final line of mine to be *much* more concise than your Dispatch versio= n. >> Let's compare them directly: >> >> Mine: >> run 3000 $ plugToWai (MySite $ Blog now) "http://localhost:3000/" >> Your dispatch version: >> run 3000 $ handleWai mkAbs fromAbs (dispatch (SiteArgs (BlogArgs >> now))) >> Your handleWai version: >> run 3000 $ handleWai mkAbs fromAbs (mySite now) >> > > > True. If I had a version of handleWai that uses AsURL (similar to how > plugToWai works). Then we have: > > Yours: > run 3000 $ plugToWai (MySite $ Blog now) "http://localhost:3000/" > Mine (no dispatch): > run 3000 $ handleWaiU (mySite now) "http://localhost:3000" > Mine (dispatch) > run 3000 $ handleWaiD (MySite $ Blog now) "http://localhost:3000" > > which are essentially the same. Without dispatch, mine could potentially be > one token longer. Though in this case it is one token shorter. The version > with dispatch is, of course, the same length. > > I think a lot of the boilerplate you experienced comes from your >> implementation of my idea, not the idea itself. >> > > I guess at this point I just feel like it is easier and more > straightforward to call the handlers by unique names than to create an > instance of Dispatch so I can call the handler using a general name. So, I > am looking for some compelling examples where I am going to benefit from > having a function like, dispatch :: (Dispatch a) =3D> a -> (Routes a -> > String) -> Routes a -> App a, hanging around. > > Though, as I also mentioned. I don't mind having the Dispatch class in the > library as long as I am not required to use it. > > Based on everything you've said, and some thought I've had on my own, I agree that the base function should involve no typeclasses and not break up the path into pieces. Here's a proposal for the entire core: newtype AbsPath =3D AbsPath { unAbsPath :: String } newtype PathInfo =3D PathInfo { unPathInfo :: String } handleWai :: (PathInfo -> Failing url) -> (url -> PathInfo) -> (PathInfo -> AbsPath) -> (url -> (url -> AbsPath) -> Application) -> Application handleWai parsePI buildPI buildAbsPath dispatch req =3D do let pi =3D PathInfo $ S.unpack $ pathInfo req case parsePI pi of Success url -> dispatch url (buildAbsPath . buildPI) req Failure errors -> return $ Response Status404 [] $ Right $ fromLBS $ L.pack $ unlines errors I've gone ahead and gotten my previous plugToWai function to work on top of this (available in the gist), which should be enough of a proof-of-concept that this core is solid enough. I think it makes a lot of sense to define the two newtypes to keep a clear distinction between the two categories of "URLs". We could augment this further with a "[String] -> IO Response" failure handling function. If we *really* want to go overboard, we could even redefine it as this: handleWai :: (PathInfo -> Either err url) -> (err -> Application) -> (url -> PathInfo) -> (PathInfo -> AbsPath) -> (url -> (url -> AbsPath) -> Application) -> Application However, let's try to deal with some of the other important issues. >> Firstly, Failing versus Maybe: I can't really see a case when you'd need to >> specify why the path is not a valid URL. It would seem that either it's a >> theoretically valid path, or it's not. Issues like "that object doesn't >> exist" wouldn't be handled at the dispatch level usually. >> > > I have founding the Failing class to be very useful when using URLT for > implementing a REST API. The links within my Haskell app won't fail, but > links generated by non-Haskell clients can fail. For example, if some php > programmer accidentally tries to get, /mysite/myblog/foobar/bolg/1 -- they > are going to be a lot happier to see: > > expecting, 'blog', 'images', 'foo', but got 'bolg', than they would be > if they just got 'invalid url'. (Even better would be if it gave the > character offset to the bogus path component). > > Also, if you are writing the toURL / fromURL functions by hand instead of > deriving them automatically somehow, then you are going to get it wrong > sometimes (in my experience, often). I provide a QuickCheck function that > can be used to ensure that your toURL / fromURL functions are inverses. But > when the test fails, it is nice to get a more specific error message. > > I still think we need to reconsider relying on one or the other monad >> transformer library. I notice now that you're using mtl; Yesod uses >> transformers. I don't really have a strong preference on this, but it's >> immediately divisive. >> > > I refactored so that it does not really depend on either now. I did this by > basically reimplementing URLT as a native Reader-like monad instead of > wrapping around ReaderT. I added URLT.MTL and URLT.Transformers which > contain the MonadTrans and MonadIO instances. But they are not used by any > of the code. > > Happstack is currently mtl based. I think I like transformers better, > though I am saddened to see they do not have the classes like MonadReader, > MonadWriter, etc. > > I see that Gregory already responded on monads-fd and monads-tf. Which only further splits the community unfortunately. > There's one other major difference between URLT and my gist: my gist splits >> a path into pieces and hands that off for parsing. Your code allows each >> function to handle that itself. In your example, you use the default Read >> instance (I assume for simplicity). Splitting into pieces the way I did >> allowed for easy pattern matching; what would URLT code look like that >> handled "real" URLs? >> > > I like the String over the [String] because it is the most general form of > representing a URL. If you wanted to use URLT to handle both the pathInfo > and the query string parameters, then [String] isn't really the correct > type. Though there could be something better than String as well... > > In some ways, ByteString is more appropriate, since that *is* the actual data available. But I doubt this really makes much of a difference, especially if we just internally use Char8 unpacking. > As for handling, "real" URLs, there are a variety of solutions. If you > don't care too much about the prettiness of the URLs you can use template > haskell to generate AsURL instances: > > $(deriveAsURL ''BlogURL) > $(deriveAsURL ''SiteURL) > > main1b :: IO () > main1b =3D > do now <- getCurrentTime > run 3000 $ handleWaiU (mySite now) "http://localhost:3000" > > Or if you prefer Regular over TH you can do something like this (we can > probably be cleaned up a little): > > $(deriveAll ''BlogURL "PFBlogURL") > type instance PF BlogURL =3D PFBlogURL > > instance AsURL BlogURL where > toURLS =3D gtoURLS . from > fromURLC =3D fmap (fmap to) gfromURLC > > $(deriveAll ''SiteURL "PFSiteURL") > type instance PF SiteURL =3D PFSiteURL > > instance AsURL SiteURL where > toURLS =3D gtoURLS . from > fromURLC =3D fmap (fmap to) gfromURLC > > that should also work with main1b. > > Or you could do it without AsURL at all using syb: > > gtoURL :: (Data url) =3D> url -> String > gfromURL :: (Data url) =3D> String -> Failing url > > run 3000 $ handleWai gtoURL gfromURL (mySite now) " > http://localhost:3000" > > Or you could add an AsURL instance that just called gtoURL / gfromURL, and > then you could use handleWaiU. > > If you want to write parsers by hand, you could do it using parsec: > > main1c :: IO () > main1c =3D > do now <- getCurrentTime > run 3000 $ handleWai toSiteURL (fromURLP pSiteURL) (mySite now) " > http://localhost:3000" > where > pBlogURL :: Parser BlogURL > pBlogURL =3D > do char '/' > (BlogPost <$> many1 (noneOf "/")) <|> pure BlogHome > pSiteURL :: Parser SiteURL > pSiteURL =3D > do char '/' > MyBlog <$> (string "blog" *> pBlogURL) <|> pure MyHome > > toBlogURL :: BlogURL -> String > toBlogURL BlogHome =3D "" > toBlogURL (BlogPost title) =3D title > > toSiteURL :: SiteURL -> String > toSiteURL MyHome =3D "" > toSiteURL (MyBlog blogURL) =3D "blog/" (toBlogURL blogURL) > > In this example, I call handleWai. But I could also create AsURL instances > and call handleWaiU. > > Parsec is perhaps not the best choice of parser combinators. A more > specialized URL parser combinator library might be nice. > > We could also add a helper function so that it is easier to do things via > straight pattern matching. But I think straight pattern patching may prove > tedious rather quickly? > > In general though, I am not a big fan of writing the converters by hand, > because there is no assurance that they are inverses of each other, and it's > annoying to have to basically express the same structure twice -- once to > parse it, and once to print it. > > But there does need to be someway where you can very explicitly map how the > datatype and string representation of the URL are related. > > It would be much better if there was a DSL that simultaneously expressed > how to parse and how to print. I have not worked out how to do that yet > though -- it is somewhat tricky. > > However, the quasiquote stuff looks potentially promising as a way of > expressing the parsing and printing in a single step... > > - jeremy > I'm glad to hear someone else finds writing the same data twice to be error-prone and redundant. If we get this core out there, I'll happily split my mkResources quasi-quoter from Yesod and make it available as a standalone package. By the way, should we think of something more descriptive than urlt? Michael --===============1952452205302058738== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2I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2NrcXVvdGU+PC9kaXY+PGJyPgo8ZGl2PkkmIzM5O20gZ2xhZCB0byBoZWFy IHNvbWVvbmUgZWxzZSBmaW5kcyB3cml0aW5nIHRoZSBzYW1lIGRhdGEgdHdpY2UgdG8gYmUgZXJy b3ItcHJvbmUgYW5kIHJlZHVuZGFudC4gSWYgd2UgZ2V0IHRoaXMgY29yZSBvdXQgdGhlcmUsIEkm IzM5O2xsIGhhcHBpbHkgc3BsaXQgbXkgbWtSZXNvdXJjZXMgcXVhc2ktcXVvdGVyIGZyb20gWWVz b2QgYW5kIG1ha2UgaXQgYXZhaWxhYmxlIGFzIGEgc3RhbmRhbG9uZSBwYWNrYWdlLjwvZGl2Pgo8 ZGl2Pjxicj48L2Rpdj48ZGl2PkJ5IHRoZSB3YXksIHNob3VsZCB3ZSB0aGluayBvZiBzb21ldGhp bmcgbW9yZSBkZXNjcmlwdGl2ZSB0aGFuIHVybHQ/PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5N aWNoYWVsPC9kaXY+Cg== --===============1952452205302058738==-- From michael@snoyman.com Fri Mar 19 16:51:29 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Fri, 19 Mar 2010 14:22:15 -0700 Message-ID: <29bf512f1003191422h745ca323vbee00665e6e31324@mail.gmail.com> In-Reply-To: <29bf512f1003181517u4ff68b4am1be0b54e35b5123c@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3431555269713100949==" --===============3431555269713100949== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit As an example of both a unified URL creation framework and persistence framework, I've put together a little example of how we could create an "authentication plugin." For the purposes of our discussion here, we could ignore the persistence piece for now, though I would like to eventually discuss how we could make that better. I wrote a small blog post[1] describing the system. The code relevant for our discussion is broken into two files: WebPlug.hs[2] defines the interface and auth-example.hs[3] is the actual example. In this version of WebPlug.hs, I've included WebPlug as a datatype instead of a typeclass. I don't actually *use* that datatype here, but I think it would be very useful for higher-level utilities like the quasi-quoter to be able to access the three related functions together. Michael [1] http://www.snoyman.com/blog/entry/persistent-plugs/ [2] http://github.com/snoyberg/persistent/blob/master/WebPlug.hs [3] http://github.com/snoyberg/persistent/blob/master/auth-example.hs --===============3431555269713100949== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 QXMgYW4gZXhhbXBsZSBvZiBib3RoIGEgdW5pZmllZCBVUkwgY3JlYXRpb24gZnJhbWV3b3JrIGFu ZCBwZXJzaXN0ZW5jZSBmcmFtZXdvcmssIEkmIzM5O3ZlIHB1dCB0b2dldGhlciBhIGxpdHRsZSBl eGFtcGxlIG9mIGhvdyB3ZSBjb3VsZCBjcmVhdGUgYW4gJnF1b3Q7YXV0aGVudGljYXRpb24gcGx1 Z2luLiZxdW90OyBGb3IgdGhlIHB1cnBvc2VzIG9mIG91ciBkaXNjdXNzaW9uIGhlcmUsIHdlIGNv dWxkIGlnbm9yZSB0aGUgcGVyc2lzdGVuY2UgcGllY2UgZm9yIG5vdywgdGhvdWdoIEkgd291bGQg bGlrZSB0byBldmVudHVhbGx5IGRpc2N1c3MgaG93IHdlIGNvdWxkIG1ha2UgdGhhdCBiZXR0ZXIu PGRpdj4KPGJyPjwvZGl2PjxkaXY+SSB3cm90ZSBhIHNtYWxsIGJsb2cgcG9zdFsxXSBkZXNjcmli aW5nIHRoZSBzeXN0ZW0uIFRoZSBjb2RlIHJlbGV2YW50IGZvciBvdXIgZGlzY3Vzc2lvbiBpcyBi cm9rZW4gaW50byB0d28gZmlsZXM6IFdlYlBsdWcuaHNbMl0gZGVmaW5lcyB0aGUgaW50ZXJmYWNl IGFuZCBhdXRoLWV4YW1wbGUuaHNbM10gaXMgdGhlIGFjdHVhbCBleGFtcGxlLjwvZGl2PjxkaXY+ Cjxicj48L2Rpdj48ZGl2PkluIHRoaXMgdmVyc2lvbiBvZiBXZWJQbHVnLmhzLCBJJiMzOTt2ZSBp bmNsd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 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Fri, 19 Mar 2010 16:42:18 -0500 Message-ID: In-Reply-To: <29bf512f1003191422h745ca323vbee00665e6e31324@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7320681590526445938==" --===============7320681590526445938== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Fri, Mar 19, 2010 at 4:22 PM, Michael Snoyman wrote: > As an example of both a unified URL creation framework and persistence > framework, I've put together a little example of how we could create an > "authentication plugin." For the purposes of our discussion here, we could > ignore the persistence piece for now, though I would like to eventually > discuss how we could make that better. Yeah, I gotta finish the urlt stuff first before I think about something else ;) > I wrote a small blog post[1] describing the system. The code relevant for > our discussion is broken into two files: WebPlug.hs[2] defines the interface > and auth-example.hs[3] is the actual example. > > In this version of WebPlug.hs, I've included WebPlug as a datatype instead > of a typeclass. I don't actually *use* that datatype here, but I think it > would be very useful for higher-level utilities like the quasi-quoter to be > able to access the three related functions together. > Right. I already have a similar datatype in URLT.HandleT. My type also includes a 'defaultPage' type which can be used to specify what value "/" should be mapped to. Though, in mine, the dispatch / handleLink function is based on URLT, but that can probably be generalized. As a bonus you also get a Functor instance, and a runSite function that uses the type.. You should really check out URLT sometime :p I am not going to have time to look at this again until Saturday or Sunday. There are a few minor details that have been swept under the rug that need to be addressed. For example, when exactly does should url encoding / decoding take place. It's not good if that happens twice or not at all. - jeremy --===============7320681590526445938== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gRnJpLCBNYXIgMTksIDIwMTAgYXQgNDoyMiBQTSwgTWljaGFlbCBTbm95bWFuIDxzcGFuIGRp cj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFpbHRvOm1pY2hhZWxAc25veW1hbi5jb20iPm1pY2hhZWxA c25veW1hbi5jb208L2E+Jmd0Ozwvc3Bhbj4gd3JvdGU6PGJyPjxkaXYgY2xhc3M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HlvdSBhbHNvIGdldCBhIEZ1bmN0b3IgaW5zdGFuY2UsIGFuZCBhIHJ1blNpdGUgZnVuY3Rp b24gdGhhdCB1c2VzIHRoZSB0eXBlLi48L2Rpdj4KPGRpdj48YnI+PC9kaXY+PGRpdj5Zb3Ugc2hv dWxkIHJlYWxseSBjaGVjayBvdXQgVVJMVCBzb21ldGltZSA6cDwvZGl2PjxkaXY+PGJyPjwvZGl2 PjxkaXY+SSBhbSBub3QgZ29pbmcgdG8gaGF2ZSB0aW1lIHRvIGxvb2sgYXQgdGhpcyBhZ2FpbiB1 bnRpbCBTYXR1cmRheSBvciBTdW5kYXkuIFRoZXJlIGFyZSBhIGZldyBtaW5vciBkZXRhaWxzIHRo YXQgaGF2ZSBiZWVuIHN3ZXB0IHVuZGVyIHRoZSBydWcgdGhhdCBuZWVkIHRvIGJlIGFkZHJlc3Nl ZC4gRm9yIGV4YW1wbGUsIHdoZW4gZXhhY3RseSBkb2VzIHNob3VsZCB1cmwgZW5jb2RpbmcgLyBk ZWNvZGluZyB0YWtlIHBsYWNlLiBJdCYjMzk7cyBub3QgZ29vZCBpZiB0aGF0IGhhcHBlbnMgdHdp Y2Ugb3Igbm90IGF0IGFsbC48L2Rpdj4KPGRpdj48YnI+PC9kaXY+PGRpdj4tIGplcmVteTwvZGl2 PjwvZGl2Pgo= --===============7320681590526445938==-- From jeremy@n-heptane.com Fri Mar 19 17:12:32 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Fri, 19 Mar 2010 16:43:20 -0500 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1860674173478836318==" --===============1860674173478836318== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Fri, Mar 19, 2010 at 4:42 PM, Jeremy Shaw wrote: > Right. I already have a similar datatype in URLT.HandleT. My type also > includes a 'defaultPage' type which can be used to specify what value "/" > should be mapped to. Though, in mine, the dispatch / handleLink function is > based on URLT, but that can probably be generalized. As a bonus you also get > a Functor instance, and a runSite function that uses the type.. > > Actually, you already supply handleWebPlug, so the only real bonus is the Functor instance.. which is only there because it is based on URLT. - jeremy --===============1860674173478836318== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gRnJpLCBNYXIgMTksIDIwMTAgYXQgNDo0MiBQTSwgSmVyZW15IFNoYXcgPHNwYW4gZGlyPSJs dHIiPiZsdDs8YSBocmVmPSJtYWlsdG86amVyZW15QG4taGVwdGFuZS5jb20iPmplcmVteUBuLWhl cHRhbmUuY29tPC9hPiZndDs8L3NwYW4+IHdyb3RlOjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90 ZSI+PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0ibWFyZ2luOjAgMCAwIC44 ZXg7Ym9yZGVyLWxlZnQ6MXB4ICNjY2Mgc29saWQ7cGFkZGluZy1sZWZ0OjFleDsiPgo8ZGl2IGNs YXNzPSJpbSI+UmlnaHQuIEkgYWxyZWFkeSBoYXZlIGEgc2ltaWxhciBkYXRhdHlwZSBpbiBVUkxU LkhhbmRsZVQuIE15IHR5cGUgYWxzbyBpbmNsdWRlcyBhICYjMzk7ZGVmYXVsdFBhZ2UmIzM5OyB0 eXBlIHdoaWNoIGNhbiBiZSB1c2VkIHRvIHNwZWNpZnkgd2hhdCB2YWx1ZSAmcXVvdDsvJnF1b3Q7 IHNob3VsZCBiZSBtYXBwZWQgdG8uIFRob3VnaCwgaW4gbWluZSwgdGhlIGRpc3BhdGNoIC8gaGFu ZGxlTGluayBmdW5jdGlvbiBpcyBiYXNlZCBvbiBVUkxULCBidXQgdGhhdCBjYW4gcHJvYmFibHkg YmUgZ2VuZXJhbGl6ZWQuIEFzIGEgYm9udXMgeW91IGFsc28gZ2V0IGEgRnVuY3RvciBpbnN0YW5j ZSwgYW5kIGEgcnVuU2l0ZSBmdW5jdGlvbiB0aGF0IHVzZXMgdGhlIHR5cGUuLjwvZGl2Pgo8ZGl2 IGNsYXNzPSJnbWFpbF9xdW90ZSI+CjxkaXY+PGJyPjwvZGl2PjwvZGl2PjwvYmxvY2txdW90ZT48 ZGl2Pjxicj48L2Rpdj48ZGl2PkFjdHVhbGx5LCB5b3UgYWxyZWFkeSBzdXBwbHkgaGFuZGxlV2Vi UGx1Zywgc28gdGhlIG9ubHkgcmVhbCBib251cyBpcyB0aGUgRnVuY3RvciBpbnN0YW5jZS4uIHdo aWNoIGlzIG9ubHkgdGhlcmUgYmVjYXVzZSBpdCBpcyBiYXNlZCBvbiBVUkxULjwvZGl2PjxkaXY+ PGJyPjwvZGl2PjxkaXY+Ci0gamVyZW15oDwvZGl2PjwvZGl2Pgo= --===============1860674173478836318==-- From michael@snoyman.com Fri Mar 19 17:51:50 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Fri, 19 Mar 2010 15:22:37 -0700 Message-ID: <29bf512f1003191522x6735ec79l53c1a35f16cf39fa@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5881510314705312932==" --===============5881510314705312932== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Fri, Mar 19, 2010 at 2:42 PM, Jeremy Shaw wrote: > On Fri, Mar 19, 2010 at 4:22 PM, Michael Snoyman wrote: > >> As an example of both a unified URL creation framework and persistence >> framework, I've put together a little example of how we could create an >> "authentication plugin." For the purposes of our discussion here, we could >> ignore the persistence piece for now, though I would like to eventually >> discuss how we could make that better. > > > Yeah, I gotta finish the urlt stuff first before I think about something > else ;) > > I'd prefer to do that too in general, but I'm going to be doing a project next that involves a lot of DB code. I already did one site that used direct SQL generation, and I'd really rather avoid going that route again. I wrote a small blog post[1] describing the system. The code relevant for >> our discussion is broken into two files: WebPlug.hs[2] defines the interfa= ce >> and auth-example.hs[3] is the actual example. >> >> In this version of WebPlug.hs, I've included WebPlug as a datatype instead >> of a typeclass. I don't actually *use* that datatype here, but I think it >> would be very useful for higher-level utilities like the quasi-quoter to be >> able to access the three related functions together. >> > > Right. I already have a similar datatype in URLT.HandleT. My type also > includes a 'defaultPage' type which can be used to specify what value "/" > should be mapped to. Though, in mine, the dispatch / handleLink function is > based on URLT, but that can probably be generalized. As a bonus you also get > a Functor instance, and a runSite function that uses the type.. > > You should really check out URLT sometime :p > > I thought I had, just didn't realize that HandleT was relevant to the low-level bit. I'll try to get through the rest of urlt today. > I am not going to have time to look at this again until Saturday or Sunday. > There are a few minor details that have been swept under the rug that need > to be addressed. For example, when exactly does should url encoding / > decoding take place. It's not good if that happens twice or not at all. > > > Just to confuse the topic even more: if we do real URL encoding/decoding, I believe we would have to assume a certain character set. I had to deal with a site that was encoded in non-UTF8 just a bit ago, and dealing with query parameters is not fun. That said, perhaps we should consider making the type of PathInfo "PathInfo ByteString" so we make it clear that we're doing no character encoding. Another issue in the same vein is dealing with leading and trailing slashes, though I think this is fairly simple in practice: the web app knows what to do about the trailing slashes, and each plugin should always pass a leading slash. Michael --===============5881510314705312932== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gRnJpLCBNYXIgMTksIDIwMTAgYXQg Mjo0MiBQTSwgSmVyZW15IFNoYXcgPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWlsdG86 amVyZW15QG4taGVwdGFuZS5jb20iPmplcmVteUBuLWhlcHRhbmUuY29tPC9hPiZndDs8L3NwYW4+ IHdyb3RlOjxicj48YmxvY2txdW90ZSBjbGFzcz0iZ21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46 MCAwIDAgLjhleDtib3JkZXItbGVmdDoxcHggI2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4OyI+ CjxkaXYgY2xhc3M9ImltIj5PbiBGcmksIE1hciAxOSwgMj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JseSBzaW1wbGUgaW4gcHJhY3RpY2U6IHRoZSB3ZWIgYXBwIGtub3dzIHdoYXQgdG8gZG8gYWJv dXQgdGhlIHRyYWlsaW5nIHNsYXNoZXMsIGFuZCBlYWNoIHBsdWdpbiBzaG91bGQgYWx3YXlzIHBh c3MgYSBsZWFkaW5nIHNsYXNoLjwvZGl2Pgo8ZGl2Pjxicj48L2Rpdj48ZGl2Pk1pY2hhZWw8L2Rp dj48L2Rpdj4K --===============5881510314705312932==-- From jeremy@n-heptane.com Fri Mar 19 18:00:48 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Fri, 19 Mar 2010 17:31:36 -0500 Message-ID: In-Reply-To: <29bf512f1003181517u4ff68b4am1be0b54e35b5123c@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4573126343774716033==" --===============4573126343774716033== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Thu, Mar 18, 2010 at 5:17 PM, Michael Snoyman wrote: > Based on everything you've said, and some thought I've had on my own, I > agree that the base function should involve no typeclasses and not break up > the path into pieces. Here's a proposal for the entire core: > > newtype AbsPath = AbsPath { unAbsPath :: String } > newtype PathInfo = PathInfo { unPathInfo :: String } > Can you provide some simples examples of the types of mistakes we might make if we didn't use newtypes here? One potentially nice thing about having the function, showURL :: (url -> String) instead of (url -> AbsPath) is that it works with most of the html 'templating' solutions with out any extra fusing around. For example, with Text.Html a ! [href (showURL Foo)] Which is kind of nice. But I also like using newtypes when it helps avoid problems. handleWai :: (PathInfo -> Failing url) > -> (url -> PathInfo) > -> (PathInfo -> AbsPath) > -> (url -> (url -> AbsPath) -> Application) > -> Application > handleWai parsePI buildPI buildAbsPath dispatch req = do > let pi = PathInfo $ S.unpack $ pathInfo req > case parsePI pi of > Success url -> dispatch url (buildAbsPath . buildPI) req > Failure errors -> return $ Response Status404 [] $ Right $ fromLBS > $ L.pack $ unlines errors > Depends on which 'core' we are talking about. I still intend to use urlt with happstack, which does not yet have fully integration with Wai. So I will need: handleHappstack.. or some variant. And I can imagine other non-Wai people want to use urlt as well. So I imagine we will have: urlt-wai urlt-happstack etc so at the real core that would just leave, PathInfo and AbsPath ? Unless we get rid of them.. then there is nothing at the core, only optional things :p - jeremy --===============4573126343774716033== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gVGh1LCBNYXIgMTgsIDIwMTAgYXQgNToxNyBQTSwgTWljaGFlbCBTbm95bWFuIDxzcGFuIGRp cj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFpbHRvOm1pY2hhZWxAc25veW1hbi5jb20iPm1pY2hhZWxA c25veW1hbi5jb208L2E+Jmd0Ozwvc3Bhbj4gd3JvdGU6PGJyPjxkaXYgY2xhc3M9ImdtYWlsX3F1 b3RlIj48YmxvY2txdW90ZSBjbGFzcz0iZ21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46MCAwIDAg LjhleDtib3JkZXItbGVmdDoxcHggI2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4OyI+CjxkaXYg Y2xhc3M9ImdtYWlsX3F1b3RlIj48ZGl2PkJhc2VkIG9uIGV2ZXJ5dGhpbmcgeW91JiMzOTt2ZSBz YWlkLCBhbmQgc29tZSB0aG91Z2h0IEkmIzM5O3ZlIGhhZCBvbiBteSBvd24sIEkgYWdyZWUgdGhh dCB0aGUgYmFzZSBmdW5jdGlvbiBzaG91bGQgaW52b2x2ZSBubyB0eXBlY2xhc3NlcyBhbmQgbm90 IGJyZWFrIHVwIHRoZSBwYXRoIGludG8gcGllY2VzLiBIZXJlJiMzOTtzIGEgcHJvcG9zYWwgZm9y IHRoZSBlbnRpcmUgY29yZTo8L2Rpdj4KCjxkaXY+PGJyPjwvZGl2PjxkaXY+PGRpdj5uZXd0eXBl IEFic1BhdGggPSBBYnNQYXRoIHsgdW5BYnNQYXRoIDo6IFN0cmluZyB9PC9kaXY+PGRpd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wvZGl2PjxkaXY+RGVwZW5kcyBvbiB3aGljaCAmIzM5O2NvcmUmIzM5OyB3ZSBhcmUg dGFsa2luZyBhYm91dC4gSSBzdGlsbCBpbnRlbmQgdG8gdXNlIHVybHQgd2l0aCBoYXBwc3RhY2ss IHdoaWNoIGRvZXMgbm90IHlldCBoYXZlIGZ1bGx5IGludGVncmF0aW9uIHdpdGggV2FpLiBTbyBJ IHdpbGwgbmVlZDo8L2Rpdj4KPGRpdj48YnI+PC9kaXY+PGRpdj5oYW5kbGVIYXBwc3RhY2suLiBv ciBzb21lIHZhcmlhbnQuIEFuZCBJIGNhbiBpbWFnaW5lIG90aGVyIG5vbi1XYWkgcGVvcGxlIHdh bnQgdG8gdXNlIHVybHQgYXMgd2VsbC4gU28gSSBpbWFnaW5lIHdlIHdpbGwgaGF2ZTo8L2Rpdj48 ZGl2Pjxicj48L2Rpdj48ZGl2PnVybHQtd2FpPC9kaXY+PGRpdj51cmx0LWhhcHBzdGFjazwvZGl2 PjxkaXY+ZXRjPC9kaXY+CjxkaXY+PGJyPjwvZGl2PjxkaXY+c28gYXQgdGhlIHJlYWwgY29yZSB0 aGF0IHdvdWxkIGp1c3QgbGVhdmUsIFBhdGhJbmZvIGFuZCBBYnNQYXRoID8gVW5sZXNzIHdlIGdl dCByaWQgb2YgdGhlbS4uIHRoZW4gdGhlcmUgaXMgbm90aGluZyBhdCB0aGUgY29yZSwgb25seSBv cHRpb25hbCB0aGluZ3MgOnA8L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2Pi0gamVyZW15PC9kaXY+ PC9kaXY+Cg== --===============4573126343774716033==-- From jeremy@n-heptane.com Fri Mar 19 18:11:09 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Fri, 19 Mar 2010 17:41:55 -0500 Message-ID: In-Reply-To: <29bf512f1003191522x6735ec79l53c1a35f16cf39fa@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5862492376796079187==" --===============5862492376796079187== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Fri, Mar 19, 2010 at 5:22 PM, Michael Snoyman wrote: > I am not going to have time to look at this again until Saturday or Sunday. >> There are a few minor details that have been swept under the rug that need >> to be addressed. For example, when exactly does should url encoding / >> decoding take place. It's not good if that happens twice or not at all. >> >> >> Just to confuse the topic even more: if we do real URL encoding/decoding, > I believe we would have to assume a certain character set. I had to deal > with a site that was encoded in non-UTF8 just a bit ago, and dealing with > query parameters is not fun. > > That said, perhaps we should consider making the type of PathInfo "PathInfo > ByteString" so we make it clear that we're doing no character encoding. > Yeah. I dunno. I just know it needs to be solved :) > Another issue in the same vein is dealing with leading and trailing > slashes, though I think this is fairly simple in practice: the web app knows > what to do about the trailing slashes, and each plugin should always pass a > leading slash. > I am not quite sure what you mean 'each plugin should always pass a leading slash'. Pass to whom? If we have: MySite = MyHome | MyBlog Blog MyBlog = BlogHome | BlogPost String Then I would expect something like this: formatMySite MyHome = "MyHome" formatMySite (MyBlog blog) = "MyBlog/" ++ formatMyBlog blog formatMyBlog BlogHome = "BlogHome" formatMyBlog (BlogPost title) = "BlogPost/" ++ title mkAbs = ("http://localhost:3000/" ++) (ignoring any escaping that needs to happen in title, and ignoring an AbsPath / PathInfo stuff). But we could, of course, do it the other way: formatMySite MyHome = "/MyHome" formatMySite (MyBlog blog) = "/MyBlog" ++ formatMyBlog blog formatMyBlog BlogHome = "/BlogHome" formatMyBlog (BlogPost title) = "/BlogPost/" ++ title mkAbs = ("http://localhost:3000" ++) There definitely needs to be some policy. - jeremy --===============5862492376796079187== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gRnJpLCBNYXIgMTksIDIwMTAgYXQgNToyMiBQTSwgTWljaGFlbCBTbm95bWFuIDxzcGFuIGRp cj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFpbHRvOm1pY2hhZWxAc25veW1hbi5jb20iPm1pY2hh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vc3Q6MzAwMDwvYT4mcXVvdDsgKyspPC9kaXY+PGRpdj48 YnI+PC9kaXY+PC9kaXY+PGRpdj5UaGVyZSBkZWZpbml0ZWx5IG5lZWRzIHRvIGJlIHNvbWUgcG9s aWN5LjwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+LSBqZXJlbXk8L2Rpdj48L2Rpdj4K --===============5862492376796079187==-- From michael@snoyman.com Fri Mar 19 18:12:22 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Fri, 19 Mar 2010 14:43:09 -0800 Message-ID: <29bf512f1003191543x32f66521xcdf494dd87ac7d24@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0311546006296835605==" --===============0311546006296835605== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Fri, Mar 19, 2010 at 2:31 PM, Jeremy Shaw wrote: > On Thu, Mar 18, 2010 at 5:17 PM, Michael Snoyman wrote: > >> Based on everything you've said, and some thought I've had on my own, I >> agree that the base function should involve no typeclasses and not break up >> the path into pieces. Here's a proposal for the entire core: >> >> newtype AbsPath = AbsPath { unAbsPath :: String } >> newtype PathInfo = PathInfo { unPathInfo :: String } >> > > Can you provide some simples examples of the types of mistakes we might > make if we didn't use newtypes here? > > One potentially nice thing about having the function, showURL :: (url -> > String) instead of (url -> AbsPath) is that it works with most of the html > 'templating' solutions with out any extra fusing around. For example, with > Text.Html > > a ! [href (showURL Foo)] > > Which is kind of nice. > > But I also like using newtypes when it helps avoid problems. > > > I think I've said it before: I'm on the fence about this one. The newtypes are just doing what they usually do: prevent you from making silly mistakes and ensure more type safety. I have no incredibly persuasive examples. > handleWai :: (PathInfo -> Failing url) >> -> (url -> PathInfo) >> -> (PathInfo -> AbsPath) >> -> (url -> (url -> AbsPath) -> Application) >> -> Application >> handleWai parsePI buildPI buildAbsPath dispatch req = do >> let pi = PathInfo $ S.unpack $ pathInfo req >> case parsePI pi of >> Success url -> dispatch url (buildAbsPath . buildPI) req >> Failure errors -> return $ Response Status404 [] $ Right $ fromLBS >> $ L.pack $ unlines errors >> > > Depends on which 'core' we are talking about. I still intend to use urlt > with happstack, which does not yet have fully integration with Wai. So I > will need: > > handleHappstack.. or some variant. And I can imagine other non-Wai people > want to use urlt as well. So I imagine we will have: > > urlt-wai > urlt-happstack > etc > > so at the real core that would just leave, PathInfo and AbsPath ? Unless we > get rid of them.. then there is nothing at the core, only optional things :p > > > If all we're aiming for here is a method for type-safe URLs, then this would work. I'm trying to broaden the scope to including pluggable web pieces; for this, a unified request/response type are a must. That said, we *could* make the Application type be polymorphic and then provide handleWai, handleCgi, handleHappstack, etc, and then have plugins specific for each of those systems. But I'd rather see us standardize on WAI (that is the purpose of it) and provide compatibility wrappers. Michael --===============0311546006296835605== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gRnJpLCBNYXIgMTksIDIwMTAgYXQg MjozMSBQTSwgSmVyZW15IFNoYXcgPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWlsdG86 amVyZW15QG4taGVwdGFuZS5jb20iPmplcmVteUBuLWhlcHRhbmUuY29tPC9hPiZndDs8L3NwYW4+ IHdyb3RlOjxicj48YmxvY2txdW90ZSBjbGFzcz0iZ21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46 MCAwIDAgLjhleDtib3JkZXItbGVmdDoxcHggI2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4OyI+ CjxkaXYgY2xhc3M9ImltIj5PbiBUaHUsIE1hciAxOCwgMjAxMCBhdCA1OjE3IFBNLCBNaWNoYWVs IFNub3ltYW4gPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWlsdG86bWljaGFlbEBzbm95 bWFuLmNvbSIgdGFyZ2V0PSJfYmxhbmsiPm1pY2h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b2YgaXQpIGFuZCBwcm92aWRlIGNvbXBh dGliaWxpdHkgd3JhcHBlcnMuPC9kaXY+CjxkaXY+PGJyPjwvZGl2PjxkaXY+TWljaGFlbDwvZGl2 PjwvZGl2Pgo= --===============0311546006296835605==-- From michael@snoyman.com Fri Mar 19 18:24:32 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Fri, 19 Mar 2010 14:55:19 -0800 Message-ID: <29bf512f1003191555pccc059age3d2ff1e1b78eb3f@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3482058370092000475==" --===============3482058370092000475== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Fri, Mar 19, 2010 at 2:41 PM, Jeremy Shaw wrote: > On Fri, Mar 19, 2010 at 5:22 PM, Michael Snoyman wrote: > >> I am not going to have time to look at this again until Saturday or >>> Sunday. There are a few minor details that have been swept under the rug >>> that need to be addressed. For example, when exactly does should url >>> encoding / decoding take place. It's not good if that happens twice or not >>> at all. >>> >>> >>> Just to confuse the topic even more: if we do real URL encoding/decoding, >> I believe we would have to assume a certain character set. I had to deal >> with a site that was encoded in non-UTF8 just a bit ago, and dealing with >> query parameters is not fun. >> >> That said, perhaps we should consider making the type of PathInfo >> "PathInfo ByteString" so we make it clear that we're doing no character >> encoding. >> > > Yeah. I dunno. I just know it needs to be solved :) > > >> Another issue in the same vein is dealing with leading and trailing >> slashes, though I think this is fairly simple in practice: the web app kno= ws >> what to do about the trailing slashes, and each plugin should always pass a >> leading slash. >> > > I am not quite sure what you mean 'each plugin should always pass a leading > slash'. Pass to whom? > > If we have: > > MySite =3D MyHome | MyBlog Blog > MyBlog =3D BlogHome | BlogPost String > > Then I would expect something like this: > > formatMySite MyHome =3D "MyHome" > formatMySite (MyBlog blog) =3D "MyBlog/" ++ formatMyBlog blog > > formatMyBlog BlogHome =3D "BlogHome" > formatMyBlog (BlogPost title) =3D "BlogPost/" ++ title > > mkAbs =3D ("http://localhost:3000/" ++) > > (ignoring any escaping that needs to happen in title, and ignoring an > AbsPath / PathInfo stuff). > > But we could, of course, do it the other way: > > > formatMySite MyHome =3D "/MyHome" > formatMySite (MyBlog blog) =3D "/MyBlog" ++ formatMyBlog blog > > formatMyBlog BlogHome =3D "/BlogHome" > formatMyBlog (BlogPost title) =3D "/BlogPost/" ++ title > > mkAbs =3D ("http://localhost:3000" ++) > > There definitely needs to be some policy. > > - jeremy > Then here's a proposal for both issues at once: * PathInfo is a ByteString * handleWai strips the leading slash from the path-info * every component parses and generates URLs without a leading slash. Trailing slash is application's choice. Regarding URL encoding, let me point out that the following are two different URLs (just try clicking on them): http://www.snoyman.com/blog/entry/persistent-plugs/ http://www.snoyman.com/blog/entry%2Fpersistent-plugs/ In other words, if we ever URL-decode the string before it reaches the application, we will have conflated unique URLs. I see two options here: * We specify that PathInfo contains URL-encoded values. Any fromUrl/toUrl functions must be aware of this fact. * We change the type of PathInfo to [ByteString], where we split the PathInfo by slashes, and specify that the pieces of *not* URL-encoded. In order to preserve perfectly the original value, we should not combine adjacent delimiters. In other words: /foo/bar/baz/ -> ["foo", "bar", "baz", ""] -- note the trailing empty string /foo/bar/baz -> ["foo", "bar", "baz"] -- we don't need a leading empty string; *every* pathinfo begins with a slash /foo%2Fbar/baz/ -> ["foo/bar", "baz", ""] /foo//bar/baz -> ["foo", "", "bar", "baz] I'm not strongly attached to any of this. Also, my original motivation for breaking up the pieces (easier pattern matching) will be mitigated by the usage of ByteStrings. Michael --===============3482058370092000475== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gRnJpLCBNYXIgMTksIDIwMTAgYXQg Mjo0MSBQTSwgSmVyZW15IFNoYXcgPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWlsdG86 amVyZW15QG4taGVwdGFuZS5jb20iPmpl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bm90IHN0cm9uZ2x5 IGF0dGFjaGVkIHRvIGFueSBvZiB0aGlzLiBBbHNvLCBteSBvcmlnaW5hbCBtb3RpdmF0aW9uIGZv ciBicmVha2luZyB1cCB0aGUgcGllY2VzIChlYXNpZXIgcGF0dGVybiBtYXRjaGluZykgd2lsbCBi ZSBtaXRpZ2F0ZWQgYnkgdGhlIHVzYWdlIG9mIEJ5dGVTdHJpbmdzLjwvZGl2Pgo8ZGl2Pjxicj48 L2Rpdj48ZGl2Pk1pY2hhZWw8L2Rpdj4K --===============3482058370092000475==-- From jeremy@n-heptane.com Sat Mar 20 21:05:27 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Sat, 20 Mar 2010 20:36:18 -0500 Message-ID: In-Reply-To: <29bf512f1003191555pccc059age3d2ff1e1b78eb3f@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8492531659492435876==" --===============8492531659492435876== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable ok, here is what I have found out so far. First, I tested 3 html generation libraries to see if they do any escaping on the arguments passed to href (Text.Html, Text.XHtml, and HSP): {-# OPTIONS -F -pgmFtrhsx #-} module Main where import System.IO import qualified Text.Html as H import qualified Text.XHtml as X import HSP import HSP.Identity import HSP.HTML main :: IO () main =3D do hSetEncoding stdout utf8 let nihongo =3D "=E6=97=A5=E6=9C=AC=E8=AA=9E" putStrLn nihongo putStrLn $ H.renderHtml $ H.anchor H.! [H.href nihongo] H.<< (H.toHtml "nihongo") putStrLn $ X.renderHtml $ X.anchor X.! [X.href nihongo] X.<< (X.toHtml "nihongo") putStrLn $ renderAsHTML $ evalIdentity $ nihongo The output produced was: *Main Text.Html System.IO> main =E6=97=A5=E6=9C=AC=E8=AA=9E nihongo nihongo nihongo So, none of them attempted to convert the String into a valid URL. The XHtml library did make an attempt to encode the string, but that encoding does not really make it a valid URL. (And the other two utf-8 encoded the string, because they utf-8 encoded the whole document -- which is the correct thing to do). The behavior of these libraries seems correct -- if they attempted to do more url encoding, I think that would just make things worse. Next there is the question of what are you supposed to do with non-ASCII characters in a URI? This is describe in section 2.1 of RFC 2396: http://www.ietf.org/rfc/rfc2396.txt The relationship between URI and characters has been a source of confusion for characters that are not part of US-ASCII. To describe the relationship, it is useful to distinguish between a "character" (as a distinguishable semantic entity) and an "octet" (an 8-bit byte). There are two mappings, one from URI characters to octets, and a second from octets to original characters: URI character sequence->octet sequence->original character sequence A URI is represented as a sequence of characters, not as a sequence of octets. That is because URI might be "transported" by means that are not through a computer network, e.g., printed on paper, read over the radio, etc. So a URI is a character sequence (of a restricted set of characters that are found in ASCII). A URI does not have a 'binary representation', because it could be transmitted via non-binary forms, such as a business card, etc. It is the characters that matter. A uri that has been utf-8 encoded and utf-16 encoded is still the same uri because the characters represented by those encodings are the same. So, there is actually another little piece missing in that sequence when data is transmitted via the computer. Namely, extracting the URI from the raw octets. raw octets for uri -> URI character sequence -> octet sequence -> original character sequence For example, let's pretend a web page was sent as: Content-type: text/html; charset=3Dutf-32 The utf-32 octets representing the uri must first be decoded to characters (aka the uri character sequence). That seems outside the scope of URLT .. that stage of decoding should be done before URLT gets the data because it requires looking at HTTP headers, the meta-equiv tag, etc. Next we can convert the uri sequence into a new sequence of octets representing 8-bit encoded data. That is done by converting normal ascii characters to their 8-bit ascii equivalent, and by converting % encoded values to their equivalent 8-bit values. so the character 'a' in the URI would be converted to 0x61, and the sequence %35 would be converted to 0x35. Next the binary data is converted to the original character sequence. There are a few things that make this tricky. 1. the encoding of the octet sequence in the middle is not specified in the uri. So when you are converting back to the original character sequence you don't know if octet sequence represents ascii, utf-8, or something else. 2. normalization and reserved characters Every character *can* be percent encoded, though your are only supposed to percent encode a limited set. URL normalization dictates that the following three URIs are equivalent: http://example.com:80/~smith/home.html http://EXAMPLE.com/%7Esmith/home.html http://EXAMPLE.com:/%7esmith/home.html The %7E and ~ are equal, because ~ is *not* a reserved character. But /foo/bar/baz/ /foo%2Fbar/baz/ are *not* equal because / is a reserved character. RFC3986 has this to say about when to encode and decode: 2.4. When to Encode or Decode Under normal circumstances, the only time when octets within a URI are percent-encoded is during the process of producing the URI from its component parts. This is when an implementation determines which of the reserved characters are to be used as subcomponent delimiters and which can be safely used as data. Once produced, a URI is always in its percent-encoded form. When a URI is dereferenced, the components and subcomponents significant to the scheme-specific dereferencing process (if any) must be parsed and separated before the percent-encoded octets within those components can be safely decoded, as otherwise the data may be mistaken for component delimiters. The only exception is for percent-encoded octets corresponding to characters in the unreserved set, which can be decoded at any time. For example, the octet corresponding to the tilde ("~") character is often encoded as "%7E" by older URI processing implementations; the "%7E" can be replaced by "~" without changing its interpretation. Because the percent ("%") character serves as the indicator for percent-encoded octets, it must be percent-encoded as "%25" for that octet to be used as data within a URI. Implementations must not percent-encode or decode the same string more than once, as decoding an already decoded string might lead to misinterpreting a percent data octet as the beginning of a percent-encoding, or vice versa in the case of percent-encoding an already percent-encoded string. It also has this to say about encoding Unicode data: When a new URI scheme defines a component that represents textual data consisting of characters from the Universal Character Set [UCS], the data should first be encoded as octets according to the UTF-8 character encoding [STD63]; then only those octets that do not correspond to characters in the unreserved set should be percent- encoded. For example, the character A would be represented as "A", the character LATIN CAPITAL LETTER A WITH GRAVE would be represented as "%C3%80", and the character KATAKANA LETTER A would be represented as "%E3%82%A2". I can't find an official stamp of approval, but I believe the http scheme now specifies that the octets in the middle step are utf-8 encoded. So, here is a starting example of what I think should happen for encoding, and then decoding. 1. We start with a list of path components ["foo/bar","baz"] 2. We then convert the sequence to a String containing the utf-8 encoded octets (a String not a bytestring) 3. We percent encode everything that is not an unreserved character 4. We add the delimiters We now have a proper URI. Note that we have a String and that the URI is made up of the characters in that String. The final step happens when the URI is actually used: 5. the URI is inserted into an HTML document (etc). The document is this encoded according to whatever encoding the document is supposed to have (could be anything), converting the URI into some encoding. So a URI is actually encoded twice. We use a similar process to decode the URI. Here is some code that does what I described: import Codec.Binary.UTF8.String (encodeString, decodeString) import Network.URI import System.FilePath.Posix (joinPath, splitDirectories) encodeUrl :: [String] -> String encodeUrl paths =3D let step1 =3D map encodeString paths -- utf-8 encode the data characters in path components (we have not added any delimiters yet) step2 =3D map (escapeURIString isUnreserved) step1 -- percent encode the characters step3 =3D joinPath step2 -- add in the delimiters in step3 decodeUrl :: String -> [String] decodeUrl str =3D let step1 =3D splitDirectories str -- split path on delimiters step2 =3D map unEscapeString step1 -- decode any percent encoded characters step3 =3D map decodeString step2 -- decode octets in step3 f =3D encodeString "=E6=97=A5=E6=9C=AC=E8=AA=9E" test =3D let p =3D ["foo/bar", "=E6=97=A5=E6=9C=AC=E8=AA=9E"] e =3D encodeUrl p d =3D decodeUrl e in (d =3D=3D p, p, e ,d) The problem with using [String] is that it assumes the only delimiter we care about is '/'. But we might also want to deal with the other delimiters such as : # ?. (For example, if we want to use the urlt system to generate the query string as well as the path..). But [String] does not give us a way to do that. Instead it seems like we would need a type that would allow us to specify the path, the query string, the fragment, etc. namely a real uri type? Perhaps there is something on hackage we can leverage. I think that having each individual set of toUrl / fromUrl functions deal with the encoding / decoding is not a good way to go. Makes it too easy to get it wrong. Having it all done correctly in one place makes life easier for people adding new instances or methods of generating instances. I think that urlt dealing with ByteString or [ByteString] is never the right thing. The only time that the URI is a 'byte string' is when it is encoded in an html document, or encoded in the http headers. But at the URLT level, we don't know what encoding that is. Instead we want the bytestring decoded, and we want to receive a 'URI character sequence.' Or we want to give a 'URI character sequence' to a the html library, and let it worry about the encoding of the document. At present, I think I am still ok with the fromURL and toURL functions producing and consuming String values. But, what we need is an intermediate URL type like: data URL =3D URL { paths :: [String], queryString :: String :: frag :: String } and functions that properly do, encodeURL :: URL -> String, decodeURL :: String -> URL. The AsURL class would look like: class AsURL u where toURLC :: u -> URL fromURLC :: URL -> Failing u instance AsURL URL where toURLC =3D id fromURLC =3D Success And then toURL / fromURL would be like: toURL :: (AsURL u) =3D> u -> String toURL =3D encodeURL . toURLC fromURL :: (AsURL u) =3D> String -> u fromURL =3D fromURLC . decodeURL The Strings in the URL type would not require any special encoding/decoding. The encoding / decoding would be handled by the encodeURL / decodeURL functions. In other words, when the user creates a URL type by hand, they do not have to know anything about url encoding rules, it just happens like magic. That should make it much easier to write AsURL instances by hand. Does this makes sense to you? The key now is seeing if someone has already create a suitable URL type that we can use... - jeremy On Fri, Mar 19, 2010 at 5:55 PM, Michael Snoyman wrote: > http://www.ietf.org/rfc/rfc2396.txt > > On Fri, Mar 19, 2010 at 2:41 PM, Jeremy Shaw wrote: > >> On Fri, Mar 19, 2010 at 5:22 PM, Michael Snoyman wrot= e: >> >>> I am not going to have time to look at this again until Saturday or >>>> Sunday. There are a few minor details that have been swept under the rug >>>> that need to be addressed. For example, when exactly does should url >>>> encoding / decoding take place. It's not good if that happens twice or n= ot >>>> at all. >>>> >>>> >>>> Just to confuse the topic even more: if we do real URL >>> encoding/decoding, I believe we would have to assume a certain character >>> set. I had to deal with a site that was encoded in non-UTF8 just a bit ag= o, >>> and dealing with query parameters is not fun. >>> >>> That said, perhaps we should consider making the type of PathInfo >>> "PathInfo ByteString" so we make it clear that we're doing no character >>> encoding. >>> >> >> Yeah. I dunno. I just know it needs to be solved :) >> >> >>> Another issue in the same vein is dealing with leading and trailing >>> slashes, though I think this is fairly simple in practice: the web app kn= ows >>> what to do about the trailing slashes, and each plugin should always pass= a >>> leading slash. >>> >> >> I am not quite sure what you mean 'each plugin should always pass a >> leading slash'. Pass to whom? >> >> If we have: >> >> MySite =3D MyHome | MyBlog Blog >> MyBlog =3D BlogHome | BlogPost String >> >> Then I would expect something like this: >> >> formatMySite MyHome =3D "MyHome" >> formatMySite (MyBlog blog) =3D "MyBlog/" ++ formatMyBlog blog >> >> formatMyBlog BlogHome =3D "BlogHome" >> formatMyBlog (BlogPost title) =3D "BlogPost/" ++ title >> >> mkAbs =3D ("http://localhost:3000/" ++) >> >> (ignoring any escaping that needs to happen in title, and ignoring an >> AbsPath / PathInfo stuff). >> >> But we could, of course, do it the other way: >> >> >> formatMySite MyHome =3D "/MyHome" >> formatMySite (MyBlog blog) =3D "/MyBlog" ++ formatMyBlog blog >> >> formatMyBlog BlogHome =3D "/BlogHome" >> formatMyBlog (BlogPost title) =3D "/BlogPost/" ++ title >> >> mkAbs =3D ("http://localhost:3000" ++) >> >> There definitely needs to be some policy. >> >> - jeremy >> > > Then here's a proposal for both issues at once: > > * PathInfo is a ByteString > * handleWai strips the leading slash from the path-info > * every component parses and generates URLs without a leading slash. > Trailing slash is application's choice. > > Regarding URL encoding, let me point out that the following are two > different URLs (just try clicking on them): > > http://www.snoyman.com/blog/entry/persistent-plugs/ > http://www.snoyman.com/blog/entry%2Fpersistent-plugs/ > > In other words, if we ever URL-decode the string before it reaches the > application, we will have conflated unique URLs. I see two options here: > > * We specify that PathInfo contains URL-encoded values. Any fromUrl/toUrl > functions must be aware of this fact. > * We change the type of PathInfo to [ByteString], where we split the > PathInfo by slashes, and specify that the pieces of *not* URL-encoded. In > order to preserve perfectly the original value, we should not combine > adjacent delimiters. In other words: > > /foo/bar/baz/ -> ["foo", "bar", "baz", ""] -- note the trailing empty > string > /foo/bar/baz -> ["foo", "bar", "baz"] -- we don't need a leading empty > string; *every* pathinfo begins with a slash > /foo%2Fbar/baz/ -> ["foo/bar", "baz", ""] > /foo//bar/baz -> ["foo", "", "bar", "baz] > > I'm not strongly attached to any of this. Also, my original motivation for > breaking up the pieces (easier pattern matching) will be mitigated by the > usage of ByteStrings. > > Michael > --===============8492531659492435876== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 b2ssIGhlcmUgaXMgd2hhdCBJIGhhdmUgZm91bmQgb3V0IHNvIGZhci4gRmlyc3QsIEkgdGVzdGVk IDMgaHRtbCBnZW5lcmF0aW9uIGxpYnJhcmllcyB0byBzZWUgaWYgdGhleSBkbyBhbnkgZXNjYXBp bmcgb24gdGhlIGFyZ3VtZW50cyBwYXNzZWQgdG8gaHJlZiAoVGV4dC5IdG1sLCBUZXh0LlhIdG1s LCBhbmQgS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+SSYjMzk7bSBub3Qgc3Ryb25n bHkgYXR0YWNoZWQgdG8gYW55IG9mIHRoaXMuIEFsc28sIG15IG9yaWdpbmFsIG1vdGl2YXRpb24g Zm9yIGJyZWFraW5nIHVwIHRoZSBwaWVjZXMgKGVhc2llciBwYXR0ZXJuIG1hdGNoaW5nKSB3aWxs IGJlIG1pdGlnYXRlZCBieSB0aGUgdXNhZ2Ugb2YgQnl0ZVN0cmluZ3MuPC9kaXY+Cgo8ZGl2Pjxi cj48L2Rpdj48Zm9udCBjb2xvcj0iIzg4ODg4OCI+PGRpdj5NaWNoYWVsPC9kaXY+CjwvZm9udD48 L2Jsb2NrcXVvdGU+PC9kaXY+PGJyPjwvZGl2Pgo= --===============8492531659492435876==-- From michael@snoyman.com Sun Mar 21 00:33:24 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Sat, 20 Mar 2010 22:04:16 -0700 Message-ID: <29bf512f1003202204h6f54bce9wf98a14d515ff3f6d@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7125840141781115206==" --===============7125840141781115206== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 2010/3/20 Jeremy Shaw > ok, here is what I have found out so far. First, I tested 3 html generation > libraries to see if they do any escaping on the arguments passed to href > (Text.Html, Text.XHtml, and HSP): > > {-# OPTIONS -F -pgmFtrhsx #-} > module Main where > > import System.IO > import qualified Text.Html as H > import qualified Text.XHtml as X > import HSP > import HSP.Identity > import HSP.HTML > > main :: IO () > main = > do hSetEncoding stdout utf8 > let nihongo = "日本語" > putStrLn nihongo > putStrLn $ H.renderHtml $ H.anchor H.! [H.href nihongo] H.<< (H.toHtml > "nihongo") > putStrLn $ X.renderHtml $ X.anchor X.! [X.href nihongo] X.<< (X.toHtml > "nihongo") > putStrLn $ renderAsHTML $ evalIdentity $ nihongo > > The output produced was: > > *Main Text.Html System.IO> main > 日本語 > > > > >nihongo > > > > http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > > >nihongo > > > > >nihongo > > > So, none of them attempted to convert the String into a valid URL. The > XHtml library did make an attempt to encode the string, but that encoding > does not really make it a valid URL. (And the other two utf-8 encoded the > string, because they utf-8 encoded the whole document -- which is the > correct thing to do). > > The behavior of these libraries seems correct -- if they attempted to do > more url encoding, I think that would just make things worse. > > Next there is the question of what are you supposed to do with non-ASCII > characters in a URI? This is describe in section 2.1 of RFC 2396: > > http://www.ietf.org/rfc/rfc2396.txt > > The relationship between URI and characters has been a source of > confusion for characters that are not part of US-ASCII. To describe > the relationship, it is useful to distinguish between a "character" > (as a distinguishable semantic entity) and an "octet" (an 8-bit > byte). There are two mappings, one from URI characters to octets, and > a second from octets to original characters: > > URI character sequence->octet sequence->original character sequence > > A URI is represented as a sequence of characters, not as a sequence > of octets. That is because URI might be "transported" by means that > are not through a computer network, e.g., printed on paper, read over > the radio, etc. > > So a URI is a character sequence (of a restricted set of characters that > are found in ASCII). A URI does not have a 'binary representation', because > it could be transmitted via non-binary forms, such as a business card, etc. > It is the characters that matter. A uri that has been utf-8 encoded and > utf-16 encoded is still the same uri because the characters represented by > those encodings are the same. > > So, there is actually another little piece missing in that sequence when > data is transmitted via the computer. Namely, extracting the URI from the > raw octets. > > raw octets for uri -> URI character sequence -> octet sequence -> original > character sequence > > For example, let's pretend a web page was sent as: Content-type: text/html; > charset=utf-32 > > The utf-32 octets representing the uri must first be decoded to characters > (aka the uri character sequence). That seems outside the scope of URLT .. > that stage of decoding should be done before URLT gets the data because it > requires looking at HTTP headers, the meta-equiv tag, etc. Next we can > convert the uri sequence into a new sequence of octets representing 8-bit > encoded data. That is done by converting normal ascii characters to their > 8-bit ascii equivalent, and by converting % encoded values to their > equivalent 8-bit values. so the character 'a' in the URI would be converted > to 0x61, and the sequence %35 would be converted to 0x35. Next the binary > data is converted to the original character sequence. > > There are a few things that make this tricky. > > 1. the encoding of the octet sequence in the middle is not specified in > the uri. So when you are converting back to the original character sequence > you don't know if octet sequence represents ascii, utf-8, or something else. > > 2. normalization and reserved characters > > Every character *can* be percent encoded, though your are only supposed > to percent encode a limited set. URL normalization dictates that the > following three URIs are equivalent: > > http://example.com:80/~smith/home.html > http://EXAMPLE.com/%7Esmith/home.html > http://EXAMPLE.com:/%7esmith/home.html > > The %7E and ~ are equal, because ~ is *not* a reserved character. But > > /foo/bar/baz/ > /foo%2Fbar/baz/ > > are *not* equal because / is a reserved character. > > RFC3986 has this to say about when to encode and decode: > > 2.4. When to Encode or Decode > > Under normal circumstances, the only time when octets within a URI > are percent-encoded is during the process of producing the URI from > its component parts. This is when an implementation determines which > of the reserved characters are to be used as subcomponent delimiters > and which can be safely used as data. Once produced, a URI is always > in its percent-encoded form. > > When a URI is dereferenced, the components and subcomponents > significant to the scheme-specific dereferencing process (if any) > must be parsed and separated before the percent-encoded octets within > those components can be safely decoded, as otherwise the data may be > mistaken for component delimiters. The only exception is for > percent-encoded octets corresponding to characters in the unreserved > set, which can be decoded at any time. For example, the octet > corresponding to the tilde ("~") character is often encoded as "%7E" > by older URI processing implementations; the "%7E" can be replaced by > "~" without changing its interpretation. > > Because the percent ("%") character serves as the indicator for > percent-encoded octets, it must be percent-encoded as "%25" for that > octet to be used as data within a URI. Implementations must not > percent-encode or decode the same string more than once, as decoding > an already decoded string might lead to misinterpreting a percent > data octet as the beginning of a percent-encoding, or vice versa in > the case of percent-encoding an already percent-encoded string. > > > It also has this to say about encoding Unicode data: > > When a new URI scheme defines a component that represents textual > data consisting of characters from the Universal Character Set [UCS], > the data should first be encoded as octets according to the UTF-8 > character encoding [STD63]; then only those octets that do not > correspond to characters in the unreserved set should be percent- > encoded. For example, the character A would be represented as "A", > the character LATIN CAPITAL LETTER A WITH GRAVE would be represented > as "%C3%80", and the character KATAKANA LETTER A would be represented > as "%E3%82%A2". > > I can't find an official stamp of approval, but I believe the http scheme > now specifies that the octets in the middle step are utf-8 encoded. > > So, here is a starting example of what I think should happen for encoding, > and then decoding. > > 1. We start with a list of path components ["foo/bar","baz"] > 2. We then convert the sequence to a String containing the utf-8 encoded > octets (a String not a bytestring) > 3. We percent encode everything that is not an unreserved character > 4. We add the delimiters > > We now have a proper URI. Note that we have a String and that the URI is > made up of the characters in that String. The final step happens when the > URI is actually used: > > 5. the URI is inserted into an HTML document (etc). The document is this > encoded according to whatever encoding the document is supposed to have > (could be anything), converting the URI into some encoding. > > So a URI is actually encoded twice. We use a similar process to decode the > URI. Here is some code that does what I described: > > import Codec.Binary.UTF8.String (encodeString, decodeString) > import Network.URI > import System.FilePath.Posix (joinPath, splitDirectories) > > encodeUrl :: [String] -> String > encodeUrl paths = > let step1 = map encodeString paths -- utf-8 encode the data characters in > path components (we have not added any delimiters yet) > step2 = map (escapeURIString isUnreserved) step1 -- percent encode > the characters > step3 = joinPath step2 -- add in the delimiters > in step3 > > decodeUrl :: String -> [String] > decodeUrl str = > let step1 = splitDirectories str -- split path on delimiters > step2 = map unEscapeString step1 -- decode any percent encoded > characters > step3 = map decodeString step2 -- decode octets > in step3 > > f = encodeString "日本語" > > test = > let p = ["foo/bar", "日本語"] > e = encodeUrl p > d = decodeUrl e > in (d == p, p, e ,d) > > The problem with using [String] is that it assumes the only delimiter we > care about is '/'. But we might also want to deal with the other delimiters > such as : # ?. (For example, if we want to use the urlt system to generate > the query string as well as the path..). But [String] does not give us a way > to do that. Instead it seems like we would need a type that would allow us > to specify the path, the query string, the fragment, etc. namely a real uri > type? Perhaps there is something on hackage we can leverage. > > I think that having each individual set of toUrl / fromUrl functions deal > with the encoding / decoding is not a good way to go. Makes it too easy to > get it wrong. Having it all done correctly in one place makes life easier > for people adding new instances or methods of generating instances. > > I think that urlt dealing with ByteString or [ByteString] is never the > right thing. The only time that the URI is a 'byte string' is when it is > encoded in an html document, or encoded in the http headers. But at the URLT > level, we don't know what encoding that is. Instead we want the bytestring > decoded, and we want to receive a 'URI character sequence.' Or we want to > give a 'URI character sequence' to a the html library, and let it worry > about the encoding of the document. > > At present, I think I am still ok with the fromURL and toURL functions > producing and consuming String values. But, what we need is an intermediate > URL type like: > > data URL = URL { paths :: [String], queryString :: String :: frag :: String > } > > and functions that properly do, encodeURL :: URL -> String, decodeURL :: > String -> URL. > > The AsURL class would look like: > > class AsURL u where > toURLC :: u -> URL > fromURLC :: URL -> Failing u > > instance AsURL URL where > toURLC = id > fromURLC = Success > > And then toURL / fromURL would be like: > > toURL :: (AsURL u) => u -> String > toURL = encodeURL . toURLC > > fromURL :: (AsURL u) => String -> u > fromURL = fromURLC . decodeURL > > The Strings in the URL type would not require any special > encoding/decoding. The encoding / decoding would be handled by the encodeURL > / decodeURL functions. > > In other words, when the user creates a URL type by hand, they do not have > to know anything about url encoding rules, it just happens like magic. That > should make it much easier to write AsURL instances by hand. > > Does this makes sense to you? > > The key now is seeing if someone has already create a suitable URL type > that we can use... > > > That made perfect sense, thank you for doing such thorough research on this. I've attached two files; test1.html is UTF-8 encoded, test3.html is windows-1255 (Hebrew). On my system, both links point to the same location, implying to me that you are spot on that UTF-8 should always be used for URLs. I had made a mistake with my test on Friday; apparently we only have the encoding issue with the query string. Now, back to your point: I'm not sure why you want to include the query string and fragment as part of the URL. Regarding the fragment: it will never be passed to the server, so it's *impossible* to consider it for parsing URLs. I understand that you might want to generate URLs with a fragment, but we would then need to have parse and render functions which do not parallel each other properly. Regarding the query string, I can see more of an argument being made to include it, but it feels wrong to me. Precedence in most places does not allow you to route requests based on the query string, and this seems like a Good Idea. I know it would be nice to be guaranteed that there is a certain GET parameter present, but I really think this should be dealt with at the handler level. In other words, I like the idea of using [String]. My only argument in favor of [ByteString] instead was the character encoding issue, and you've convinced me that it's a non-issue. If we can agree on this, I don't see a necessity to rely on an external package to provide the URL datatype (since we would just be using [String]). I can provide the encodeURL/decodeURL functions in web-encodings if that's acceptable- your implementation seems correct to me. However, since it does not function on fully-qualified URLs, perhaps we should call it encodePathInfo/decodePathInfo? Michael --===============7125840141781115206== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment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vZGVVUkwvZGVjb2Rl VVJMIGZ1bmN0aW9ucyBpbiB3ZWItZW5jb2RpbmdzIGlmIHRoYXQmIzM5O3MgYWNjZXB0YWJsZS0g eW91ciBpbXBsZW1lbnRhdGlvbiBzZWVtcyBjb3JyZWN0IHRvIG1lLiBIb3dldmVyLCBzaW5jZSBp dCBkb2VzIG5vdCBmdW5jdGlvbiBvbiBmdWxseS1xdWFsaWZpZWQgVVJMcywgcGVyaGFwcyB3ZSBz aG91bGQgY2FsbCBpdCBlbmNvZGVQYXRoSW5mby9kZWNvZGVQYXRoSW5mbz88L2Rpdj4KPGRpdj48 YnI+PC9kaXY+PGRpdj5NaWNoYWVsPC9kaXY+PC9kaXY+Cg== --===============7125840141781115206== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="test1.html" MIME-Version: 1.0 PGh0bWw+CiAgPGhlYWQ+CiAgPG1ldGEgY2hhcnNldD0idXRmLTgiPgo8L2hlYWQ+Cjxib2R5Pgog IDxhIGhyZWY9Itep15zXldedLmh0bWwiPmhlbGxvPC9hPgo8L2JvZHk+CjwvaHRtbD4K --===============7125840141781115206== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="test3.html" MIME-Version: 1.0 PGh0bWw+CiAgPGhlYWQ+CiAgPG1ldGEgY2hhcnNldD0id2luZG93cy0xMjU1Ij4KPC9oZWFkPgo8 Ym9keT4KICA8YSBocmVmPSLvv73vv73vv73vv70uaHRtbCI+77+977+977+977+9PC9hPgo8L2Jv ZHk+CjwvaHRtbD4K --===============7125840141781115206==-- From chris@eidhof.nl Sun Mar 21 05:44:04 2010 From: Chris Eidhof To: web-devel@haskell.org Subject: [web-devel] ANN: regular-web 0.1 | generic web programming in Haskell Date: Sun, 21 Mar 2010 11:14:55 +0100 Message-ID: <3E29485B-21EC-46E3-8ABD-20C82EFE5B64@eidhof.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6029065544594826497==" --===============6029065544594826497== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable >From the ZuriHac hackathon, I am happy to announce the first release of the r= egular-web package [1]. The package contains functions for generic web progra= mming: generating HTML, JSON and Formlets. It is based on the regular generic= programming library [2]. Generic HTML and forms are often not sufficient for real purposes, so we enco= urage the use of regular-web in combination with the fclabels package [3]. T= here is an example in the documentation of the Formlets module. Furthermore, = there is a slightly larger example [4] on github that shows off some more fea= tures of the package. This is a preliminary release and the API will probably change. I am interest= ed to see what other people think of this. So please send me your comments or= fork the project on github. =20 [1]: http://hackage.haskell.org/package/regular-web [2]: http://hackage.haskell.org/package/regular [3]: http://hackage.haskell.org/package/fclabels [4]: http://github.com/chriseidhof/regular-web/blob/master/Example.lhs --===============6029065544594826497==-- From sfvisser@cs.uu.nl Sun Mar 21 11:36:09 2010 From: Sebastiaan Visser To: web-devel@haskell.org Subject: [web-devel] ANN: Salvia-1.0.0 Date: Sun, 21 Mar 2010 17:07:01 +0100 Message-ID: <2AB621EC-AA20-4C62-9BCB-C5646EB21BB4@cs.uu.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2153130215380545839==" --===============2153130215380545839== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi all, Straight from Zurihac: I'm very pleased to announce the 1.0.0 release of the = Salvia web server. Salvia is a feature rich web server and web application framework that can be= used to write dynamic websites in Haskell. From the lower level protocol cod= e up to the high level application code, everything is written as a Salvia ha= ndler. This approach makes the framework extremely modular and extensible. This release include the following stack of packages: * salvia-protocol: Protocol stack containing URI, HTTP, Cookie and Mime. * salvia: Basic server interface and implementation. * salvia-extras: Additional server handlers and back end implementation. * salvia-sessions: Session and user management support. * salvia-websocket: Cutting edge HTML5 web socket support. * salvia-demo: Demo servers showing how to use Salvia. All the code is on Hackage[1] and the source repositories can be found on Git= Hub[2]. Most of the basic ideas of the previous Salvia release are still in these pac= kage, but all the code has been cleaned up considerably. There is now a very = strong separation between interface and implementation making it more easy to= plug-in new back-ends for your web application. To do a full install first run `cabal update' followed by `cabal install salv= ia-demo'. Now you can run the salvia-demo command and point your browser to h= ttp://localhost:8080/ . Thanks to the people that helped me with coding, suggestions and bug-reports.= Any comments/suggestions are welcome! Have fun, -- Sebatiaan Visser [1] http://hackage.haskell.org/package/salvia (-protocol, -demo, etc) [2] http://github.com/sebastiaanvisser/salvia (-protocol, -demo, etc) --===============2153130215380545839==-- From gour@gour-nitai.com Sun Mar 21 12:09:48 2010 From: Gour To: web-devel@haskell.org Subject: [web-devel] Re: ANN: Salvia-1.0.0 Date: Sun, 21 Mar 2010 17:41:26 +0100 Message-ID: <20100321174126.2e650095@gaura-nitai.no-ip.org> In-Reply-To: <2AB621EC-AA20-4C62-9BCB-C5646EB21BB4@cs.uu.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4435410643403133926==" --===============4435410643403133926== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Sun, 21 Mar 2010 17:07:01 +0100 >>>>>> "Sebastiaan" == wrote: Sebastiaan> Straight from Zurihac: I'm very pleased to announce the Sebastiaan> 1.0.0 release of the Salvia web server. Congrats for the "new kid on the haskell's web block". :-) Sebastiaan> Salvia is a feature rich web server and web application Sebastiaan> framework that can be used to write dynamic websites in Sebastiaan> Haskell. From the lower level protocol code up to the high Sebastiaan> level application code, everything is written as a Salvia Sebastiaan> handler. This approach makes the framework extremely Sebastiaan> modular and extensible. Am I right, that it uses its own protocol, i.e. no WAI? Sebastiaan> * salvia-demo: Demo servers showing how to use Salvia. Is there some docs available besides the above package? Sebastiaan> Most of the basic ideas of the previous Salvia release are Sebastiaan> still in these package, but all the code has been cleaned Sebastiaan> up considerably. There is now a very strong separation Sebastiaan> between interface and implementation making it more easy to Sebastiaan> plug-in new back-ends for your web application. Any info how much resources it requires, i.e. is it in the category of Happs or one can deploy it on shared hosting? Does it play with other servers as proxy? Any support for database back-end? Sebastiaan> Thanks to the people that helped me with coding, Sebastiaan> suggestions and bug-reports. Any comments/suggestions are Sebastiaan> welcome! Excuse me for maybe dumb questions, but I'd like to hear more before venturing into installing several apps. Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- --===============4435410643403133926== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuNC4xMCAoR05V L0xpbnV4KQoKaUVZRUFSRUNBQVlGQWt1bVREWUFDZ2tRVThlRThmbHY5ZmE5NlFDYUFqd3JvMlhO OWZFRXZUb0VzUjV0RDZ5MwpTek1BblJRTklDelBDQWpuY0RyVDBua3l1WFdFWVhyVQo9Rm9mVAot LS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============4435410643403133926==-- From sfvisser@cs.uu.nl Mon Mar 22 10:28:33 2010 From: Sebastiaan Visser To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANN: Salvia-1.0.0 Date: Mon, 22 Mar 2010 15:59:24 +0100 Message-ID: <25913FBF-E5CE-4FA8-B163-C99A0D1915FE@cs.uu.nl> In-Reply-To: <20100321174126.2e650095@gaura-nitai.no-ip.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9049899970052749458==" --===============9049899970052749458== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mar 21, 2010, at 5:41 PM, Gour wrote: > On Sun, 21 Mar 2010 17:07:01 +0100 >>=20 >> "Sebastiaan" =3D=3D wrote: >> Straight from Zurihac: I'm very pleased to announce the >> 1.0.0 release of the Salvia web server. >>=20 >=20 > Congrats for the "new kid on the haskell's web block". :-) Thanks! :-) >> Salvia is a feature rich web server and web application >> framework that can be used to write dynamic websites in >> Haskell. From the lower level protocol code up to the high >> level application code, everything is written as a Salvia >> handler. This approach makes the framework extremely >> modular and extensible. >>>=20 >>=20 >=20 > Am I right, that it uses its own protocol, i.e. no WAI? To answer your question: yes, Salvia uses its own protocol. Athough the term = `protocol' might mean different things when looked at from different perspect= ives. How do I put this delicately? I do not think WAI is the way to go. On the Hackage page of WAI I read: "Provides a common protocol for communicat= ion between web aplications and web servers." This means that WAI is a propos= ed standardized interface intended to sit between server and a web applicatio= n. There several reasons why I don't like the idea of a standardized interfac= e between the application server and the web application. First of all, no one will ever agree on this type of interface. Not on the le= vel of abstraction, not on the actual naming of the datatypes, not on the amo= unt of documentation, not on the placement of the parenthesis. I, for example= , don't like WAI at all: I do not want be forced to use enumerators for the o= utput, ByteStrings for the input, only 10 predefined response codes, etc.=20 Secondly, this type of interface will degrade projects like Happstack and Sal= via to be mere `back-ends', which they are not. They are both server implemen= tations _and_ interfaces to the programmer. Salvia for example is designed to= be a combinator library (not a fixed API) in which some low-level protocol a= spects, like keep-alive, http-range support, REST, serving HEAD requests are = implemented in the same paradigm as the higher level web controllers. I truly= like this idea and this will be totally invalidated by something like WAI of= Hack. What I do like to see though, is something like the Ruby Rack interface, whic= h calls itself a "a Ruby Webserver Interface". This is an interface between t= he actual OS/network and the application server, not an interface between an = application server and the web application. Call it WSI not WAI, this subtle = difference actually means a lot. This WSI would just give me file handle/socket and possible a pre-parsed HTTP= message, but that is all. A Rack-like interface would allow me to run my Sal= via web applications on any backend, like CGI, or in mod_haskell, in the blaz= ingly fast iteratee based Hyena or behind an Apache proxy. But still, the web= application is written against Salvia (or the framework you like most) and c= an piggy bag on all the neat features it supplies. Salvia itself has such a WSI, although I'm pretty sure this one is to abstrac= t and high level to be a true candidate for any form of standardization. >> * salvia-demo: Demo servers showing how to use Salvia. >=20 > Is there some docs available besides the above package? No unfortunately, there is currently only the examples and the haddock docume= ntation. We are working on a tutorial, but that will have to wait for a while= . Sorry for that. >> Most of the basic ideas of the previous Salvia release are >> still in these package, but all the code has been cleaned >> up considerably. There is now a very strong separation >> between interface and implementation making it more easy to >> plug-in new back-ends for your web application. >>=20 >=20 > Any info how much resources it requires, i.e. is it in the category of > Happs or one can deploy it on shared hosting? It can run on its own server (like Happs) or as CGI. Whether you can easily d= eploy it probably depends on your hosting party, not on Salvia. > Does it play with other servers as proxy? It can run as CGI or behind existing apache proxies without any problem. The = codebase has some experimental support for running Salvia itself as a proxy s= erver, but this code is not released yet because it needs some additional cod= ing/polish/testing. > Any support for database back-end? No, this is a web server package not a database. Off course you can use it to= build database backed web applications, using any datastore you like. The Sa= lvia project will never have built-in support for any form of data storage, I= prefer to keep these aspects totally separated. >> Thanks to the people that helped me with coding, >> suggestions and bug-reports. Any comments/suggestions are >> welcome! >>=20 >=20 > Excuse me for maybe dumb questions, but I'd like to hear more before > venturing into installing several apps. At TypLAB[1] we use Happstack as our server back-end which works `pretty well= ', but we are sometimes a bit disappointed by it lack of matureness. The code= base is a bit messy and lacks some important features that you'll need when b= uilding `real applications'. I feel that Haskell is the true candidate for being the perfect web language,= but we still have a long way to go. We should just keep on playing with new = ideas and abstractions until we all see the big picture. Some standards will = arise eventually. > Sincerely, > Gour Sincerely, -- Sebastiaan Visser [1] https://blog.typlab.com/ --===============9049899970052749458==-- From cdsmith@gmail.com Mon Mar 22 11:09:53 2010 From: Chris Smith To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANN: Salvia-1.0.0 Date: Mon, 22 Mar 2010 09:40:40 -0600 Message-ID: <1269272440.14911.484.camel@dell-desktop.example.com> In-Reply-To: <25913FBF-E5CE-4FA8-B163-C99A0D1915FE@cs.uu.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4560573702549305168==" --===============4560573702549305168== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, 2010-03-22 at 15:59 +0100, Sebastiaan Visser wrote: > We should just keep on playing with new ideas and abstractions until we all > see the big picture. Some standards will arise eventually. Absolutely! It certainly strikes me as being too early to try to build the "one web framework/API" in Haskell. I share some reservations about WAI. It's certainly better than using lazy I/O for high-volume web servers, but the enumerator/iteratee stuff is far less obvious than lazy I/O as an abstraction. Let's spend some more time playing before building up pressure to rewrite web code using WAI. There's just no way we can know what other ideas people will come up with in the next few months or years. -- Chris Smith --===============4560573702549305168==-- From list@phaedrusdeinus.org Mon Mar 22 12:18:36 2010 From: John Melesky To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANN: Salvia-1.0.0 Date: Mon, 22 Mar 2010 09:49:21 -0700 Message-ID: <6A11868C-7FB7-4978-8BF7-D14E777D940F@phaedrusdeinus.org> In-Reply-To: <25913FBF-E5CE-4FA8-B163-C99A0D1915FE@cs.uu.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4001909284463018111==" --===============4001909284463018111== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mar 22, 2010, at 7:59 AM, Sebastiaan Visser wrote: >> Am I right, that it uses its own protocol, i.e. no WAI? > > To answer your question: yes, Salvia uses its own protocol. Athough > the term `protocol' might mean different things when looked at from > different perspectives. > > How do I put this delicately? I do not think WAI is the way to go. ... > First of all, no one will ever agree on this type of interface. Not > on the level of abstraction, not on the actual naming of the > datatypes, not on the amount of documentation, not on the placement > of the parenthesis. I don't entirely agree. The python community, for example, eventually standardized on WSGI for exactly that role (standard interface between webserver and webapp or framework). The difference, of course, is that Python had a decade-long history of dozens and dozens of different web app frameworks. There were a handful of different possible targets, though: mod_python, cgi, fastcgi, scgi, bespoke stuff. If you implemented one, you'd get constant feature requests for others. Eventually WSGI happened, and it's all been a good deal calmer since. It's very much in the haskell way of thinking to try and learn from other languages' problems. WAI, though, seems to be addressing a community problem instead of a language problem. In other words, i think it's a fine idea, but it won't be widely used until the haskell community actually goes through the sort of pain and suffering that forged the resolve to use WSGI in python. We have to learn that lesson the hard way. That's my take on it, anyhow, having watched the WSGI process firsthand. -john --===============4001909284463018111==-- From michael@snoyman.com Mon Mar 22 14:21:00 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANN: Salvia-1.0.0 Date: Mon, 22 Mar 2010 11:51:56 -0700 Message-ID: <29bf512f1003221151o67fc2ed2s223f1049c5037eba@mail.gmail.com> In-Reply-To: <25913FBF-E5CE-4FA8-B163-C99A0D1915FE@cs.uu.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1260482731056821959==" --===============1260482731056821959== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, Mar 22, 2010 at 7:59 AM, Sebastiaan Visser wrote: > > Am I right, that it uses its own protocol, i.e. no WAI? > > To answer your question: yes, Salvia uses its own protocol. Athough the > term `protocol' might mean different things when looked at from different > perspectives. > > How do I put this delicately? I do not think WAI is the way to go. > > On the Hackage page of WAI I read: "Provides a common protocol for > communication between web aplications and web servers." This means that WAI > is a proposed standardized interface intended to sit between server and a > web application. There several reasons why I don't like the idea of a > standardized interface between the application server and the web > application. > > First of all, no one will ever agree on this type of interface. Not on the > level of abstraction, not on the actual naming of the datatypes, not on the > amount of documentation, not on the placement of the parenthesis. I, for > example, don't like WAI at all: I do not want be forced to use enumerators > for the output, ByteStrings for the input, only 10 predefined response > codes, etc. > > [..] What I do like to see though, is something like the Ruby Rack interface, > which calls itself a "a Ruby Webserver Interface". This is an interface > between the actual OS/network and the application server, not an interface > between an application server and the web application. Call it WSI not WAI, > this subtle difference actually means a lot. > > This WSI would just give me file handle/socket and possible a pre-parsed > HTTP message, but that is all. A Rack-like interface would allow me to run > my Salvia web applications on any backend, like CGI, or in mod_haskell, in > the blazingly fast iteratee based Hyena or behind an Apache proxy. But > still, the web application is written against Salvia (or the framework you > like most) and can piggy bag on all the neat features it supplies. > > Salvia itself has such a WSI, although I'm pretty sure this one is to > abstract and high level to be a true candidate for any form of > standardization. > > I'm not really sure what distinction you're trying to make here. Hack is (as I understand it) a direct port of Rack to Haskell. (I've never used Rack, so correct me if I'm wrong.) WAI is at the same level of abstraction as Hack, so it seems strange to say Rack == Good, Hack/WAI == Bad. I'm also not certain what you mean by Rack being an interface between the OS and the webserver. I would think of POSIX as being an interface between the OS and the webserver. And yes, no one will ever agree on the right interface; but WAI (I believe) is general enough to work with most web programming approaches without sacrificing performance. Want to produce responses as lazy bytestrings? Go ahead, there's a built-in converter from a lazy bytestring to an enumerator. Finally, I think it's not that case that WAI degrades Happstack or Salvia to mere backends; instead, it *splits* them into backends and frontends. Happstack is experimenting with a WAI port right now, and if it works, the result will be a Happstack WAI-compliant server and a Happstack WAI-compliant application framework*. Michael * I know it's not exactly true to classify Happstack as that since they are really splitting it into a set of libraries, but it's a close approximation. --===============1260482731056821959== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gTW9uLCBNYXIgMjIsIDIwMTAgYXQg Nzo1OSBBTSwgU2ViYXN0aWFhbiBWaXNzZXIgPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJt YWlsdG86c2Z2aXNzZXJAY3MudXUubmwiPnNmdmlzc2VyQGNzLnV1Lm5sPC9hPiZndDs8L3NwYW4+ IHdyb3RlOjxicj48YmxvY2txdW90ZSBjbGFzcz0iZ21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46 MCAwIDAgLjhleDtib3JkZXItbGVmdDoxcHggI2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4OyI+ CjxkaXYgY2xhc3M9ImltIj4mZ3Q7IEFtIEkgcmlnaHQsIHRoYXQgaXQgdXNlcyBpdHMgb3duIHBy b3RvY29sLCBpLmUuIG5vIFdBST88L2Rpdj48ZGl2IGNsYXNzPSJpbSI+Cjxicj4KPC9kaXY+VG8g YW5zd2VyIHlvdXIgcXVlc3Rpb246IHllcywgU2FsdmlhIHVzZXMgaXRzIG93biBwcm90b2NvbC4g QXRob3VnaCB0aGUgdGVybSBgcHJvdG9jb2wmIzM5OyBtaWdodCBtZWFuIGRpZmZlcmVudCB0aGlu Z3Mgd2hlbiBsb29rZWQgYXQgZnJvbSBkaWZmZXJlbnQgcGVyc3BlY3RpdmVzLjxicj4KPGJyPgpI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0YWNrIFdBSS1jb21wbGlhbnQgYXBwbGljYXRpb24gZnJhbWV3b3JrKi48L2Rpdj4KPGRp dj48YnI+PC9kaXY+PGRpdj5NaWNoYWVsPC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj4qIEkga25v dyBpdCYjMzk7cyBub3QgZXhhY3RseSB0cnVlIHRvIGNsYXNzaWZ5IEhhcHBzdGFjayBhcyB0aGF0 IHNpbmNlIHRoZXkgYXJlIHJlYWxseSBzcGxpdHRpbmcgaXQgaW50byBhIHNldCBvZiBsaWJyYXJp ZXMsIGJ1dCBpdCYjMzk7cyBhIGNsb3NlIGFwcHJveGltYXRpb24uPC9kaXY+PC9kaXY+Cg== --===============1260482731056821959==-- From jeremy@n-heptane.com Mon Mar 22 18:49:51 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Mon, 22 Mar 2010 18:20:47 -0500 Message-ID: In-Reply-To: <29bf512f1003202204h6f54bce9wf98a14d515ff3f6d@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0165550724172718241==" --===============0165550724172718241== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Sun, Mar 21, 2010 at 12:04 AM, Michael Snoyman wrote: > That made perfect sense, thank you for doing such thorough research on > this. > > I've attached two files; test1.html is UTF-8 encoded, test3.html is > windows-1255 (Hebrew). On my system, both links point to the same location, > implying to me that you are spot on that UTF-8 should always be used for > URLs. I had made a mistake with my test on Friday; apparently we only have > the encoding issue with the query string. > Hmm. Those files do not contain value urls. The strings in the hrefs contain characters that are not in the limited set allowed by the URI spec. The part that is true is that even though the files have different encodings (utf-8 vs windows-1255) the characters in the strings are the same, so the urls are the same. I guess maybe the reason you put in invalid characters is because it is hard to test whether different encodings matter if you are only testing characters that are represented by the same octets in both encodings. Regarding your encoding issue with the query string. I believe there may have been 'nothing wrong'. At the URI level there is no specification as to how the query string is to be interpreted, or what underlying charset it should be associated with. It does have the requirement that it can only contain a limited set up characters, and that other characters must be converted to octets and then percent encoded. Now, things get interesting when you look at forms and application/x-www-form-urlencoded. When you create a form you have a form element that looks something like this:
    ...
    Except internet explorer, and a bunch of servers get stupid if you actually set the charset=utf-8. So the de facto standard is that the form is submitted using the same character encoding as the page it came from. So if the contains , then the form data will be encoded as windows-1255, converted to octets, and then percent encoded, plus the other things that url encoding does (such as + for spaces). You can also add the, accept-charset="utf-8" if you want to override the default and have the form submit some other character encoding. Not sure how widely supported that is. Now, if we were to change the method=POST to method=GET, then the urlencoded data would be passed as a query string, with its windows-1255 encoded payload. And that is perfectly valid. So, the choice of how to encode the pathInfo and query string is pretty much application specific. For the URLT stuff we are both generating and parsing the path components, so we can choose whatever encoding we want -- with utf-8 being a good choice. > Now, back to your point: I'm not sure why you want to include the query > string and fragment as part of the URL. Regarding the fragment: it will > never be passed to the server, so it's *impossible* to consider it for > parsing URLs. I understand that you might want to generate URLs with a > fragment, but we would then need to have parse and render functions which do > not parallel each other properly. > Right. I forgot about how fragments actually work. > Regarding the query string, I can see more of an argument being made to > include it, but it feels wrong to me. Precedence in most places does not > allow you to route requests based on the query string, and this seems like a > Good Idea. I know it would be nice to be guaranteed that there is a certain > GET parameter present, but I really think this should be dealt with at the > handler level. > What do you mean by 'precedence' ? Including query string in urlt is certainly nice for some contexts. For example: data UserURL = AllUsers SortOrder data SortOrder = Asc | Desc Here the sort order is required. But the sort order does not really add hiearchy to the system, so it belongs more in the query string and less in the path. We might want a URL like: /allusers?sortOrder=asc Now let's say we wrap that up in a larger site: data SiteURL = Users UserURL The Users constructor is adding hierarchy, so it shouldn't be modifying the query string. So it will just add something like: /users/allusers?sortOrder=asc So only the last component gets to add a query string. The big trip up would be forms with method GET. The form submission is handled by taking the form set data, encoding it as application/x-www-form-urlencoded, and then append ? and the encoded data to the end of the action. If the action already contained a ?, that would not work out. So, the toUrl / fromUrl instances would have to know if the url was going to be used as the target for an action and prohibit the use of a query string. That could be tricky :-/ Also, in my example, I am handling parameters that are url specific. But many sites might have some sort of global parameters that can be tacked on to every query string. Not really sure how that would work out either. > If we can agree on this, I don't see a necessity to rely on an external > package to provide the URL datatype (since we would just be using [String]). > I can provide the encodeURL/decodeURL functions in web-encodings if that's > acceptable- your implementation seems correct to me. However, since it does > not function on fully-qualified URLs, perhaps we should call it > encodePathInfo/decodePathInfo? > encodePathInfo / decodePathInfo is probably a good choice of names. Adding them to web-encodings is likely useful, but I will just use local copies in urlt, because web-encodings brings in too many extra dependencies that I don't want at that level. I don't think I will export them though, so it should not cause a conflict. Also, my implementation is not quite right. It escapes more characters than is strictly required. path segments have the following ABNF: path_segments = segment *( "/" segment ) segment = *pchar *( ";" param ) param = *pchar pchar = unreserved | escaped | ":" | "@" | "&" | "=" | "+" | "$" | "," Also, . and .. are allowed in a path segment, but have special meaning. Not sure what we want to do about those. I like the property that *any* String value is automatically escaped and has no special meaning. So the same should be true for '.' and '..'. But if you do need to use '.' and '..' for some reason, there is no mechanism to do it in the current system. Though I am not sure what a compelling use case would be, so I am ok with just not allowing them for now. --===============0165550724172718241== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gU3VuLCBNYXIgMjEsIDIwMTAgYXQgMTI6MDQgQU0sIE1pY2hhZWwgU25veW1hbiA8c3BhbiBk aXI9Imx0ciI+Jmx0OzxhIGhyZWY9Im1haWx0bzptaWNoYWVsQHNub3ltYW4uY29tIj5taWNoYWVs QHNub3ltYW4uY29tPC9hPiZndDs8L3NwYW4+IHdyb3RlOjxkaXYgY2xhc3M9ImdtYWlsX3F1b3Rl Ij48YmxvY2txdW90ZSBjbGFzcz0iZ21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46MCAwIDAgLjhl eDtib3JkZXItbGVmdDoxcHggI2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4OyI+CjxkaXYgY2xh c3M9ImdtYWlsX3F1b3RlIj48ZGl2PlRoYXQgbWFkZSBwZXJmZWN0IHNlbn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aGUg Y3VycmVudCBzeXN0ZW0uIFRob3VnaCBJIGFtIG5vdCBzdXJlIHdoYXQgYSBjb21wZWxsaW5nIHVz ZSBjYXNlIHdvdWxkIGJlLCBzbyBJIGFtIG9rIHdpdGgganVzdCBub3QgYWxsb3dpbmcgdGhlbSBm b3Igbm93LqA8L2Rpdj4KPC9kaXY+PGRpdj48YnI+PC9kaXY+PC9kaXY+Cg== --===============0165550724172718241==-- From michael@snoyman.com Mon Mar 22 21:40:06 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Mon, 22 Mar 2010 19:11:02 -0700 Message-ID: <29bf512f1003221911h53336c2av156e939a08c6c81@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5189769072512685989==" --===============5189769072512685989== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 22, 2010 at 4:20 PM, Jeremy Shaw wrote: > On Sun, Mar 21, 2010 at 12:04 AM, Michael Snoyman wrot= e: > >> That made perfect sense, thank you for doing such thorough research on >> this. >> >> I've attached two files; test1.html is UTF-8 encoded, test3.html is >> windows-1255 (Hebrew). On my system, both links point to the same location, >> implying to me that you are spot on that UTF-8 should always be used for >> URLs. I had made a mistake with my test on Friday; apparently we only have >> the encoding issue with the query string. >> > > Hmm. Those files do not contain value urls. The strings in the hrefs > contain characters that are not in the limited set allowed by the URI spec. > The part that is true is that even though the files have different encodings > (utf-8 vs windows-1255) the characters in the strings are the same, so the > urls are the same. I guess maybe the reason you put in invalid characters is > because it is hard to test whether different encodings matter if you are > only testing characters that are represented by the same octets in both > encodings. > > Well, you guessed correctly at my reason for constructing the files as I did. Not this is actually relevant to the discussion at hand, I believe that it is valid HTML to put values in the HREF fields that are not in the appropriate character range and assume the web browser will take care of things. > Regarding your encoding issue with the query string. I believe there may > have been 'nothing wrong'. At the URI level there is no specification as to > how the query string is to be interpreted, or what underlying charset it > should be associated with. It does have the requirement that it can only > contain a limited set up characters, and that other characters must be > converted to octets and then percent encoded. > > Now, things get interesting when you look at forms > and application/x-www-form-urlencoded. When you create a form you have a > form element that looks something like this: > >
    enctype=3D"application/x-www-form-urlencoded;charset=3Dutf-8">...
    > > Except internet explorer, and a bunch of servers get stupid if you actually > set the charset=3Dutf-8. So the de facto standard is that the form is > submitted using the same character encoding as the page it came from. So if > the contains , then the form data will > be encoded as windows-1255, converted to octets, and then percent encoded, > plus the other things that url encoding does (such as + for spaces). You can > also add the, accept-charset=3D"utf-8" if you want to override the default = and > have the form submit some other character encoding. Not sure how widely > supported that is. > > Now, if we were to change the method=3DPOST to method=3DGET, then the > urlencoded data would be passed as a query string, with its windows-1255 > encoded payload. And that is perfectly valid. > > So, the choice of how to encode the pathInfo and query string is pretty > much application specific. For the URLT stuff we are both generating and > parsing the path components, so we can choose whatever encoding we want -- > with utf-8 being a good choice. > > I agree; the issue of query-string encoding not being under our control is further reason to discourage its inclusion in URLT. > Now, back to your point: I'm not sure why you want to include the query >> string and fragment as part of the URL. Regarding the fragment: it will >> never be passed to the server, so it's *impossible* to consider it for >> parsing URLs. I understand that you might want to generate URLs with a >> fragment, but we would then need to have parse and render functions which = do >> not parallel each other properly. >> > > Right. I forgot about how fragments actually work. > > >> Regarding the query string, I can see more of an argument being made to >> include it, but it feels wrong to me. Precedence in most places does not >> allow you to route requests based on the query string, and this seems like= a >> Good Idea. I know it would be nice to be guaranteed that there is a certain >> GET parameter present, but I really think this should be dealt with at the >> handler level. >> > > What do you mean by 'precedence' ? > > I mean I've never seen a system that allows routing based on the query string. In PHP, you create files that match the pathinfo; in Django, you match regexs on the path info; I believe the same is true for Rails. This isn't a proof that this is the Right Thing, merely an observation. Including query string in urlt is certainly nice for some contexts. For > example: > > data UserURL =3D AllUsers SortOrder > > data SortOrder =3D Asc | Desc > > Here the sort order is required. But the sort order does not really add > hiearchy to the system, so it belongs more in the query string and less in > the path. We might want a URL like: > > /allusers?sortOrder=3Dasc > > On the other hand, those two possible URLs are not really *unique resources* (to use more RESTful terminology). The sortOrder is not really specifying *what* to return, just *how* to return it. Most well-designed URL schemes would work that way. The badly designed ones, like /user.php?id=3D5&name=3Dmichael&... shouldn't really be considered I think. Now let's say we wrap that up in a larger site: > > data SiteURL =3D Users UserURL > > The Users constructor is adding hierarchy, so it shouldn't be modifying the > query string. So it will just add something like: > > /users/allusers?sortOrder=3Dasc > > So only the last component gets to add a query string. > > Not quite sure how we should enforce something like that. > The big trip up would be forms with method GET. The form submission is > handled by taking the form set data, encoding it as > application/x-www-form-urlencoded, and then append ? and the encoded data to > the end of the action. If the action already contained a ?, that would not > work out. > > You can't have a URL containing a ?; the closest you can come is a URL containing an *escaped* ?, which will simply be absorbed by the [String] piece of the URL. Unless I'm missing your point here. So, the toUrl / fromUrl instances would have to know if the url was going to > be used as the target for an action and prohibit the use of a query string. > That could be tricky :-/ > > Also, in my example, I am handling parameters that are url specific. But > many sites might have some sort of global parameters that can be tacked on > to every query string. Not really sure how that would work out either. > > >> If we can agree on this, I don't see a necessity to rely on an external >> package to provide the URL datatype (since we would just be using [String]= ). >> I can provide the encodeURL/decodeURL functions in web-encodings if that's >> acceptable- your implementation seems correct to me. However, since it does >> not function on fully-qualified URLs, perhaps we should call it >> encodePathInfo/decodePathInfo? >> > > encodePathInfo / decodePathInfo is probably a good choice of names. Adding > them to web-encodings is likely useful, but I will just use local copies in > urlt, because web-encodings brings in too many extra dependencies that I > don't want at that level. I don't think I will export them though, so it > should not cause a conflict. > > I have no problem with that decision, but out of curiosity which dependencies are problematic? The only non-HP packages are failure, safe, text and wai. The only ones which could in theory be eliminated are failure and safe; if there is desire for me to do so, I'll look into it. > Also, my implementation is not quite right. It escapes more characters than > is strictly required. path segments have the following ABNF: > > path_segments =3D segment *( "/" segment ) > segment =3D *pchar *( ";" param ) > param =3D *pchar > > pchar =3D unreserved | escaped | > ":" | "@" | "&" | "=3D" | "+" | "$" | "," > > Also, . and .. are allowed in a path segment, but have special meaning. Not > sure what we want to do about those. I like the property that *any* String > value is automatically escaped and has no special meaning. So the same > should be true for '.' and '..'. But if you do need to use '.' and '..' for > some reason, there is no mechanism to do it in the current system. Though I > am not sure what a compelling use case would be, so I am ok with just not > allowing them for now. > > I'm not sure if they have meaning at the HTTP level. At the HTML level, they specify relative paths, but I don't think they mean anything once it enters HTTP. Michael --===============5189769072512685989== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gTW9uLCBNYXIgMjIsIDIwMTAgYXQg NDoyMCBQTSwgSmVyZW15IFNoYXcgPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWlsdG86 amVyZW15QG4taGVwdGFuZS5jb20iPmplcmVteUBuLWhlcHRhbmUuY29tPC9hPiZndDs8L3NwYW4+ IHdyb3RlOjxicj48YmxvY2txdW90ZSBjbGFzcz0iZ21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46 MCAwIDAgLjhleDtib3JkZXItbGVmdDoxcHggI2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4OyI+ CjxkaXYgY2xhc3M9ImltIj5PbiBTdW4sIE1hciAyMSwgMjAxMCBhdCAxMjowNCBBTSwgTWljaGFl bCBTbm95bWFuIDxzcGFuIGRpcj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFpbHRvOm1pY2hhZWxAc25v eW1hbi5jb20iIHRhcmdldD0iX2JsYW5rIj5taWNoYWVsQHNub3ltYW4uY29tPC9hPiZndDs8L3Nw YW4+IHdyb3RlOjwvZGl2PjxkaXYgY2xhc3M9ImdtYWlsX3F1b3RlIj48ZGl2IGNsYXNzPSJpbSI+ CjxibG9ja3F1b3RlIGNsYXNzPSJnbWFpbF9xdW90ZSIgc3R5bGU9Im1hcmdpbjowIDAgMCAuOGV4 O2JvcmRlci1sZWZ0OjFweCAjY2NjIHNvbGlkO3BhZGRpbmctbGVmdDoxZ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HNwZWNpYWwgbWVhbmluZy4gU28gdGhlIHNhbWUgc2hvdWxkIGJlIHRy dWUgZm9yICYjMzk7LiYjMzk7IGFuZCAmIzM5Oy4uJiMzOTsuIEJ1dCBpZiB5b3UgZG8gbmVlZCB0 byB1c2UgJiMzOTsuJiMzOTsgYW5kICYjMzk7Li4mIzM5OyBmb3Igc29tZSByZWFzb24sIHRoZXJl IGlzIG5vIG1lY2hhbmlzbSB0byBkbyBpdCBpbiB0aGUgY3VycmVudCBzeXN0ZW0uIFRob3VnaCBJ IGFtIG5vdCBzdXJlIHdoYXQgYSBjb21wZWxsaW5nIHVzZSBjYXNlIHdvdWxkIGJlLCBzbyBJIGFt IG9rIHdpdGgganVzdCBub3QgYWxsb3dpbmcgdGhlbSBmb3Igbm93LsKgPC9kaXY+Cgo8L2Rpdj48 ZGl2Pjxicj48L2Rpdj48L2Rpdj4KPC9ibG9ja3F1b3RlPjwvZGl2PkkmIzM5O20gbm90IHN1cmUg aWYgdGhleSBoYXZlIG1lYW5pbmcgYXQgdGhlIEhUVFAgbGV2ZWwuIEF0IHRoZSBIVE1MIGxldmVs LCB0aGV5IHNwZWNpZnkgcmVsYXRpdmUgcGF0aHMsIGJ1dCBJIGRvbiYjMzk7dCB0aGluayB0aGV5 IG1lYW4gYW55dGhpbmcgb25jZSBpdCBlbnRlcnMgSFRUUC48ZGl2Pjxicj48L2Rpdj48ZGl2Pk1p Y2hhZWw8L2Rpdj4K --===============5189769072512685989==-- From jeremy@n-heptane.com Mon Mar 22 22:06:06 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Mon, 22 Mar 2010 21:37:04 -0500 Message-ID: In-Reply-To: <29bf512f1003221911h53336c2av156e939a08c6c81@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7932503930933352470==" --===============7932503930933352470== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 22, 2010 at 9:11 PM, Michael Snoyman wrote: > > > On Mon, Mar 22, 2010 at 4:20 PM, Jeremy Shaw wrote: > >> On Sun, Mar 21, 2010 at 12:04 AM, Michael Snoyman wro= te: >> >>> That made perfect sense, thank you for doing such thorough research on >>> this. >>> >>> I've attached two files; test1.html is UTF-8 encoded, test3.html is >>> windows-1255 (Hebrew). On my system, both links point to the same locatio= n, >>> implying to me that you are spot on that UTF-8 should always be used for >>> URLs. I had made a mistake with my test on Friday; apparently we only have >>> the encoding issue with the query string. >>> >> >> Hmm. Those files do not contain value urls. The strings in the hrefs >> contain characters that are not in the limited set allowed by the URI spec. >> The part that is true is that even though the files have different encodin= gs >> (utf-8 vs windows-1255) the characters in the strings are the same, so the >> urls are the same. I guess maybe the reason you put in invalid characters = is >> because it is hard to test whether different encodings matter if you are >> only testing characters that are represented by the same octets in both >> encodings. >> >> Well, you guessed correctly at my reason for constructing the files as I > did. Not this is actually relevant to the discussion at hand, I believe that > it is valid HTML to put values in the HREF fields that are not in the > appropriate character range and assume the web browser will take care of > things. > I believe the html 4.0 explicitly states that it is illegal here (though it recommends that user agents do something sensible anyway): http://www.w3.org/TR/REC-html40/appendix/notes.html#non-ascii-chars The big trip up would be forms with method GET. The form submission is >> handled by taking the form set data, encoding it as >> application/x-www-form-urlencoded, and then append ? and the encoded data = to >> the end of the action. If the action already contained a ?, that would not >> work out. >> >> You can't have a URL containing a ?; the closest you can come is a URL > containing an *escaped* ?, which will simply be absorbed by the [String] > piece of the URL. Unless I'm missing your point here. > > What I meant is that if the url supplied to the action already had a query string, then something undesirable would probably happen. encodePathInfo / decodePathInfo is probably a good choice of names. Adding >> them to web-encodings is likely useful, but I will just use local copies in >> urlt, because web-encodings brings in too many extra dependencies that I >> don't want at that level. I don't think I will export them though, so it >> should not cause a conflict. >> >> I have no problem with that decision, but out of curiosity which > dependencies are problematic? The only non-HP packages are failure, safe, > text and wai. The only ones which could in theory be eliminated are failure > and safe; if there is desire for me to do so, I'll look into it. > Well, I see no reason to make all of urlt depend on failure, safe, text, wai, and web encodings when two small local functions would do the trick. Using the functions from web-encodings would not really increase compatibility / interoperability in any way, and I don't expect a lot a bug fixes that will have to be applied to multiple locations. Remember that I plan to split urlt up into a few pieces soon. I don't want happstack users complaining they have to install wai, or wai users complaining they have to install happstack. Even if happstack is ported to wai, there are extra layers that happstack adds which might benefit from some extra functions in urlt. > Also, my implementation is not quite right. It escapes more characters than >> is strictly required. path segments have the following ABNF: >> >> path_segments =3D segment *( "/" segment ) >> segment =3D *pchar *( ";" param ) >> param =3D *pchar >> >> pchar =3D unreserved | escaped | >> ":" | "@" | "&" | "=3D" | "+" | "$" | "," >> >> Also, . and .. are allowed in a path segment, but have special meaning. >> Not sure what we want to do about those. I like the property that *any* >> String value is automatically escaped and has no special meaning. So the >> same should be true for '.' and '..'. But if you do need to use '.' and '.= .' >> for some reason, there is no mechanism to do it in the current system. >> Though I am not sure what a compelling use case would be, so I am ok with >> just not allowing them for now. >> >> I'm not sure if they have meaning at the HTTP level. At the HTML level, > they specify relative paths, but I don't think they mean anything once it > enters HTTP. I'm not sure what to do with this information. It is true that they may be normalized by the browser before they are passed to the server. But urlt is being used primarily to create URLs that will be used in HTML pages. So, I think will still have to decide what to do with them.. Also, we shouldn't assume that the client normalized the .. stuff. Perhaps a malicious client won't in the hopes that it can retrieve http://example.com/../../../../etc/passwd or something. - jeremy --===============7932503930933352470== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gTW9uLCBNYXIgMjIsIDIwMTAgYXQgOToxMSBQTSwgTWljaGFlbCBTbm95bWFuIDxzcGFuIGRp cj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFpbHRvOm1pY2hhZWxAc25veW1hbi5jb20iPm1pY2hhZWxA c25veW1hbi5jb208L2E+Jmd0Ozwvc3Bhbj4gd3JvdGU6PGJyPjxkaXYgY2xhc3M9ImdtYWlsX3F1 b3RlIj48YmxvY2txdW90ZSBjbGFzcz0iZ21haWxfcXVv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ZXJ2ZXIuIEJ1dCB1cmx0IGlzIGJlaW5nIHVzZWQgcHJpbWFyaWx5 IHRvIGNyZWF0ZSBVUkxzIHRoYXQgd2lsbCBiZSB1c2VkIGluIEhUTUwgcGFnZXMuIFNvLCBJIHRo aW5rIHdpbGwgc3RpbGwgaGF2ZSB0byBkZWNpZGUgd2hhdCB0byBkbyB3aXRoIHRoZW0uLiBBbHNv LCB3ZSBzaG91bGRuJiMzOTt0IGFzc3VtZSB0aGF0IHRoZSBjbGllbnQgbm9ybWFsaXplZCB0aGUg Li4gc3R1ZmYuIFBlcmhhcHMgYSBtYWxpY2lvdXMgY2xpZW50IHdvbiYjMzk7dCBpbiB0aGUgaG9w ZXMgdGhhdCBpdCBjYW4gcmV0cmlldmUgPGEgaHJlZj0iaHR0cDovL2V4YW1wbGUuY29tLy4uLy4u Ly4uLy4uL2V0Yy9wYXNzd2QiPmh0dHA6Ly9leGFtcGxlLmNvbS8uLi8uLi8uLi8uLi9ldGMvcGFz c3dkPC9hPiBvciBzb21ldGhpbmcuoDwvZGl2Pgo8ZGl2Pjxicj48L2Rpdj48ZGl2Pi0gamVyZW15 PC9kaXY+PC9kaXY+Cg== --===============7932503930933352470==-- From michael@snoyman.com Mon Mar 22 22:10:54 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Mon, 22 Mar 2010 19:41:51 -0700 Message-ID: <29bf512f1003221941u232e1bd2ia65b3b35ed863935@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3729362374627466547==" --===============3729362374627466547== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 22, 2010 at 7:37 PM, Jeremy Shaw wrote: > On Mon, Mar 22, 2010 at 9:11 PM, Michael Snoyman wrote: > >> >> >> On Mon, Mar 22, 2010 at 4:20 PM, Jeremy Shaw wrote: >> >>> On Sun, Mar 21, 2010 at 12:04 AM, Michael Snoyman wr= ote: >>> >>>> That made perfect sense, thank you for doing such thorough research on >>>> this. >>>> >>>> I've attached two files; test1.html is UTF-8 encoded, test3.html is >>>> windows-1255 (Hebrew). On my system, both links point to the same locati= on, >>>> implying to me that you are spot on that UTF-8 should always be used for >>>> URLs. I had made a mistake with my test on Friday; apparently we only ha= ve >>>> the encoding issue with the query string. >>>> >>> >>> Hmm. Those files do not contain value urls. The strings in the hrefs >>> contain characters that are not in the limited set allowed by the URI spe= c. >>> The part that is true is that even though the files have different encodi= ngs >>> (utf-8 vs windows-1255) the characters in the strings are the same, so the >>> urls are the same. I guess maybe the reason you put in invalid characters= is >>> because it is hard to test whether different encodings matter if you are >>> only testing characters that are represented by the same octets in both >>> encodings. >>> >>> Well, you guessed correctly at my reason for constructing the files as I >> did. Not this is actually relevant to the discussion at hand, I believe th= at >> it is valid HTML to put values in the HREF fields that are not in the >> appropriate character range and assume the web browser will take care of >> things. >> > > > I believe the html 4.0 explicitly states that it is illegal here (though it > recommends that user agents do something sensible anyway): > > http://www.w3.org/TR/REC-html40/appendix/notes.html#non-ascii-chars > > The big trip up would be forms with method GET. The form submission is >>> handled by taking the form set data, encoding it as >>> application/x-www-form-urlencoded, and then append ? and the encoded data= to >>> the end of the action. If the action already contained a ?, that would not >>> work out. >>> >>> You can't have a URL containing a ?; the closest you can come is a URL >> containing an *escaped* ?, which will simply be absorbed by the [String] >> piece of the URL. Unless I'm missing your point here. >> >> > What I meant is that if the url supplied to the action already had a query > string, then something undesirable would probably happen. > > encodePathInfo / decodePathInfo is probably a good choice of names. Adding >>> them to web-encodings is likely useful, but I will just use local copies = in >>> urlt, because web-encodings brings in too many extra dependencies that I >>> don't want at that level. I don't think I will export them though, so it >>> should not cause a conflict. >>> >>> I have no problem with that decision, but out of curiosity which >> dependencies are problematic? The only non-HP packages are failure, safe, >> text and wai. The only ones which could in theory be eliminated are failure >> and safe; if there is desire for me to do so, I'll look into it. >> > > Well, I see no reason to make all of urlt depend on failure, safe, text, > wai, and web encodings when two small local functions would do the trick. > Using the functions from web-encodings would not really increase > compatibility / interoperability in any way, and I don't expect a lot a bug > fixes that will have to be applied to multiple locations. > > Remember that I plan to split urlt up into a few pieces soon. I don't want > happstack users complaining they have to install wai, or wai users > complaining they have to install happstack. Even if happstack is ported to > wai, there are extra layers that happstack adds which might benefit from > some extra functions in urlt. > > I was asking more in general if people took issue with the dependency list. I agree that URLT should not depend on web-encodings. > Also, my implementation is not quite right. It escapes more characters than >>> is strictly required. path segments have the following ABNF: >>> >>> path_segments =3D segment *( "/" segment ) >>> segment =3D *pchar *( ";" param ) >>> param =3D *pchar >>> >>> pchar =3D unreserved | escaped | >>> ":" | "@" | "&" | "=3D" | "+" | "$" | "," >>> >>> Also, . and .. are allowed in a path segment, but have special meaning. >>> Not sure what we want to do about those. I like the property that *any* >>> String value is automatically escaped and has no special meaning. So the >>> same should be true for '.' and '..'. But if you do need to use '.' and '= ..' >>> for some reason, there is no mechanism to do it in the current system. >>> Though I am not sure what a compelling use case would be, so I am ok with >>> just not allowing them for now. >>> >>> I'm not sure if they have meaning at the HTTP level. At the HTML level, >> they specify relative paths, but I don't think they mean anything once it >> enters HTTP. > > > I'm not sure what to do with this information. It is true that they may be > normalized by the browser before they are passed to the server. But urlt is > being used primarily to create URLs that will be used in HTML pages. So, I > think will still have to decide what to do with them.. Also, we shouldn't > assume that the client normalized the .. stuff. Perhaps a malicious client > won't in the hopes that it can retrieve > http://example.com/../../../../etc/passwd or something. > > - jeremy > What I meant to say is I think we should just leave the . and .. in the data and let the client deal with it, which I *think* is what you're saying. If I'm not mistaken, I think that addresses all the issues on the table; is there anything left to decide? I look forward to seeing a sample URLT :). Michael --===============3729362374627466547== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gTW9uLCBNYXIgMjIsIDIwMTAgYXQg NzozNyBQTSwgSmVyZW15IFNoYXcgPHNwYW4gZGlyP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3JlIHNheWluZy48L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2Pklm IEkmIzM5O20gbm90IG1pc3Rha2VuLCBJIHRoaW5rIHRoYXQgYWRkcmVzc2VzIGFsbCB0aGUgaXNz dWVzIG9uIHRoZSB0YWJsZTsgaXMgdGhlcmUgYW55dGhpbmcgbGVmdCB0byBkZWNpZGU/IEkgbG9v ayBmb3J3YXJkIHRvIHNlZWluZyBhIHNhbXBsZSBVUkxUIDopLjwvZGl2Pgo8ZGl2Pjxicj48L2Rp dj48ZGl2Pk1pY2hhZWw8L2Rpdj4K --===============3729362374627466547==-- From gour@gour-nitai.com Tue Mar 23 02:04:46 2010 From: Gour To: web-devel@haskell.org Subject: [web-devel] Re: ANN: Salvia-1.0.0 Date: Tue, 23 Mar 2010 07:36:00 +0100 Message-ID: <20100323073600.20dc9573@gaura-nitai.no-ip.org> In-Reply-To: <25913FBF-E5CE-4FA8-B163-C99A0D1915FE@cs.uu.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6012196547970531987==" --===============6012196547970531987== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, 22 Mar 2010 15:59:24 +0100 >>>>>> "Sebastiaan" == Sebastiaan Visser >>>>>> wrote: Sebastiaan> How do I put this delicately? I do not think WAI is the way Sebastiaan> to go. OK. Sebastiaan> Secondly, this type of interface will degrade projects like Sebastiaan> Happstack and Salvia to be mere `back-ends', which they are Sebastiaan> not. I saw there is a recent thread in Happs mailing list entitled "experimental port of happstack-server to wai", and although I cannot comment on technical issues, it looks that they do not consider that Happs will become degraded? Sebastiaan> What I do like to see though, is something like the Ruby Sebastiaan> Rack interface, which calls itself a "a Ruby Webserver Sebastiaan> Interface". This is an interface between the actual Sebastiaan> OS/network and the application server, not an interface Sebastiaan> between an application server and the web application. Call Sebastiaan> it WSI not WAI, this subtle difference actually means a lot. Well, I'm not attached whether it is called WSI or WAI, just to see that the web-development market is not so fragmented, so that we can get some decent frameworks in order to make it easier to do web programming in Haskell. Sebastiaan> No unfortunately, there is currently only the examples and Sebastiaan> the haddock documentation. We are working on a tutorial, Sebastiaan> but that will have to wait for a while. Sorry for that. Heh, this is common scenario. :-) Sebastiaan> It can run on its own server (like Happs) or as CGI. What about FastCGI? Sebastiaan> Whether you can easily deploy it probably depends on your Sebastiaan> hosting party, not on Salvia. Well, I'm curious if one can deploy it on shared-hosting like e.g. Webfaction since not everyone can afford or like to admin VPS. Sebastiaan> It can run as CGI or behind existing apache proxies without Sebastiaan> any problem. The codebase has some experimental support for Sebastiaan> running Salvia itself as a proxy server, but this code is Sebastiaan> not released yet because it needs some additional Sebastiaan> coding/polish/testing. Good. I use Cherokee on webfaction - that's why I'm asking. Sebastiaan> No, this is a web server package not a database. Off course Sebastiaan> you can use it to build database backed web applications, Sebastiaan> using any datastore you like. The Salvia project will never Sebastiaan> have built-in support for any form of data storage, I Sebastiaan> prefer to keep these aspects totally separated. Ahh, I read announcement where it says that "Salvia is a feature rich web server and web application framework", so based on my experiences with e.g. Python frameworks, there is usually some kind of ORM support so that one can plug database easily. That's why I am expecting to see the easy way to e.g. use HDBC or something. Sebastiaan> I feel that Haskell is the true candidate for being the Sebastiaan> perfect web language, but we still have a long way to go. Heh, I've similar feeling...lot of potential, but (too) many different solutions. Sebastiaan> We should just keep on playing with new ideas and Sebastiaan> abstractions until we all see the big picture. Some Sebastiaan> standards will arise eventually. Well, I know some people who object about HP thinking that it is not good that some libs (from the same category) were preferred ove the others, but I still feel that having HP or Haskell's 'batteries included' is good stuff to consolidate things a bit and provide assurance there is some 'standard set' of libs playing nicely together and that it will be supported. That's why I fail to understand why joining the forces and trying to evolve some 'standard practice' for web development is considered pre-mature? Similarly to HP, nobody is forced to use it and there is always free choise to choose whatever is suitable for someone, but HP is appreciated by many who wants stable & supported development platform. Although I'd like that it does not happen, it seems there is (some) truth in words of John who wrote in another reply: "...i think it's a fine idea, but it won't be widely used until the haskell community actually goes through the sort of pain and suffering that forged the resolve to use WSGI in python. We have to learn that lesson the hard way." Until then, Ruby & Python will continue increasing their web 'share' - "Avoid success at all costs." :-D Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- --===============6012196547970531987== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuNC4xMCAoR05V L0xpbnV4KQoKaUVZRUFSRUNBQVlGQWt1b1lWQUFDZ2tRVThlRThmbHY5ZmJ4UGdDZmZ5RWlvSFdJ RlZERE9ETG9WajBsYmNLUgpjZG9Bbmp4K1BUYk5OeEdVTWppbVVFdC90WDFaZjV2Uwo9QzM1Ygot LS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============6012196547970531987==-- From sfvisser@cs.uu.nl Tue Mar 23 03:40:01 2010 From: Sebastiaan Visser To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANN: Salvia-1.0.0 Date: Tue, 23 Mar 2010 09:10:36 +0100 Message-ID: <4B9B8F3B-0F46-4EED-A996-B3BE108DFB17@cs.uu.nl> In-Reply-To: <29bf512f1003221151o67fc2ed2s223f1049c5037eba@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5033972033411053299==" --===============5033972033411053299== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mar 22, 2010, at 7:51 PM, Michael Snoyman wrote: On Mon, Mar 22, 2010 at 7:59 AM, Sebastiaan Visser wrote: >> ... >>=20 >> Salvia itself has such a WSI, although I'm pretty sure this one is to abst= ract and high level to be a true candidate for any form of standardization. >=20 > I'm not really sure what distinction you're trying to make here. Hack is (a= s I understand it) a direct port of Rack to Haskell. (I've never used Rack, s= o correct me if I'm wrong.) WAI is at the same level of abstraction as Hack, = so it seems strange to say Rack =3D=3D Good, Hack/WAI =3D=3D Bad. Isn't Hack the other way around? When I look at Hack.Handler.Happstack, I see the function `appToServerPart' w= hich allows you to convert Hack applications to Happstack server parts. This means that it allows me to run my Hack applications on Happstack. That e= xactly the opposite of what I want, I want to run my Happstack applications o= n Hack. So I can use my favorite interface and my app will be deployable anyw= here. Please correct me if I totally miss the point here. -- Sebastiaan Visser --===============5033972033411053299==-- From nfjinjing@gmail.com Tue Mar 23 03:41:32 2010 From: Jinjing Wang To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANN: Salvia-1.0.0 Date: Tue, 23 Mar 2010 16:12:30 +0800 Message-ID: <81ea7d401003230112r65b899b6lfe27d0cc55519e78@mail.gmail.com> In-Reply-To: <4B9B8F3B-0F46-4EED-A996-B3BE108DFB17@cs.uu.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5804434844208803548==" --===============5804434844208803548== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable great question! check hack-frontend-happstack :) On Tue, Mar 23, 2010 at 4:10 PM, Sebastiaan Visser wrote: > On Mar 22, 2010, at 7:51 PM, Michael Snoyman wrote: > On Mon, Mar 22, 2010 at 7:59 AM, Sebastiaan Visser wrot= e: >>> ... >>> >>> Salvia itself has such a WSI, although I'm pretty sure this one is to abs= tract and high level to be a true candidate for any form of standardization. >> >> I'm not really sure what distinction you're trying to make here. Hack is (= as I understand it) a direct port of Rack to Haskell. (I've never used Rack, = so correct me if I'm wrong.) WAI is at the same level of abstraction as Hack,= so it seems strange to say Rack =3D=3D Good, Hack/WAI =3D=3D Bad. > > Isn't Hack the other way around? > > When I look at Hack.Handler.Happstack, I see the function `appToServerPart'= which allows you to convert Hack applications to Happstack server parts. > > This means that it allows me to run my Hack applications on Happstack. That= exactly the opposite of what I want, I want to run my Happstack applications= on Hack. So I can use my favorite interface and my app will be deployable an= ywhere. > > > Please correct me if I totally miss the point here. > > -- > Sebastiaan Visser > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > --=20 jinjing --===============5804434844208803548==-- From nfjinjing@gmail.com Tue Mar 23 04:29:06 2010 From: Jinjing Wang To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANN: Salvia-1.0.0 Date: Tue, 23 Mar 2010 17:00:03 +0800 Message-ID: <81ea7d401003230200q1e24c864we3fd4d409a8ac066@mail.gmail.com> In-Reply-To: <81ea7d401003230112r65b899b6lfe27d0cc55519e78@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3342682578880191438==" --===============3342682578880191438== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Just wanna point out it was MIchael Snoyman who came up with the frontend idea and the first implementation: hack-handler-cgi. It's simple but wasn't that obvious. On Tue, Mar 23, 2010 at 4:12 PM, Jinjing Wang wrote: > great question! check hack-frontend-happstack :) > > On Tue, Mar 23, 2010 at 4:10 PM, Sebastiaan Visser wrot= e: >> On Mar 22, 2010, at 7:51 PM, Michael Snoyman wrote: >> On Mon, Mar 22, 2010 at 7:59 AM, Sebastiaan Visser wro= te: >>>> ... >>>> >>>> Salvia itself has such a WSI, although I'm pretty sure this one is to ab= stract and high level to be a true candidate for any form of standardization. >>> >>> I'm not really sure what distinction you're trying to make here. Hack is = (as I understand it) a direct port of Rack to Haskell. (I've never used Rack,= so correct me if I'm wrong.) WAI is at the same level of abstraction as Hack= , so it seems strange to say Rack =3D=3D Good, Hack/WAI =3D=3D Bad. >> >> Isn't Hack the other way around? >> >> When I look at Hack.Handler.Happstack, I see the function `appToServerPart= ' which allows you to convert Hack applications to Happstack server parts. >> >> This means that it allows me to run my Hack applications on Happstack. Tha= t exactly the opposite of what I want, I want to run my Happstack application= s on Hack. So I can use my favorite interface and my app will be deployable a= nywhere. >> >> >> Please correct me if I totally miss the point here. >> >> -- >> Sebastiaan Visser >> >> _______________________________________________ >> web-devel mailing list >> web-devel@haskell.org >> http://www.haskell.org/mailman/listinfo/web-devel >> > > > > -- > jinjing > --=20 jinjing --===============3342682578880191438==-- From simon@joyful.com Tue Mar 23 09:19:13 2010 From: Simon Michael To: web-devel@haskell.org Subject: [web-devel] Re: ANN: Salvia-1.0.0 Date: Tue, 23 Mar 2010 06:34:40 -0700 Message-ID: In-Reply-To: <81ea7d401003230200q1e24c864we3fd4d409a8ac066@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7380381300950825419==" --===============7380381300950825419== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Well, my thanks to you both. I have found Hack useful for - switching between happstack, hyena, simpleserver back ends to compare perfo= rmance and identify bugs. - clarifying the boundary between my app and the web stack, reducing learning= costs (better docs would have helped) - somewhat future-proofing my code, reducing churn as web stacks evolve - providing new options for my app almost for free via middleware and handler= s (webkit handler!) I assume WAI would provide similar benefits in time, and more. Jinjing, what'= s your position on WAI ? Will you keep=20 working on Hack, or should WAI replace it ? --===============7380381300950825419==-- From nfjinjing@gmail.com Tue Mar 23 09:55:44 2010 From: Jinjing Wang To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANN: Salvia-1.0.0 Date: Tue, 23 Mar 2010 22:26:42 +0800 Message-ID: <81ea7d401003230726m4d0188b2p1c6693b37f752ea7@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7215115359129157666==" --===============7215115359129157666== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit I'm pretty satisfied with Hack, actually I have no complain at all. The only thing the interface might change is to use bytestring through out, but the performance benefit has not been properly measured, and the current string interface is not entirely slow for general web apps anyway, so until further benchmark provides concrete evidence in real world applications, the interface is likely to stay as is. I am personally using and probably will continue to use Hack, since I don't need O(1) memory ( I use reverse proxy to serve static files, and my html aren't that big ), I also don't need precise control over resources ( wishful thinking here, hoping to solve it by using strictness annotation ), so an enumerator approach, even thought it provides great potentials, is not what I need right now. But still, any development on WAI or WSI other interfaces are extremely welcome, as those will not be wasted at all, at least from my point of view, since the only thing I need is either a frontend or a backend, and I can be sure that all my code will continue to work or even benefit from other development. I am only speaking for myself though and the website I made are not high tech apps, just some stupid blog, some facebook apps and some remote services for iphone and stuff like that. So if you are lazy like me, then Hack is not a bad choice, in my opinion, it's the best, why else would I make it like that? simple and easy. If you need something else, then well you have to use something else, or improve Hack, whatever ... Best regards, On Tue, Mar 23, 2010 at 9:34 PM, Simon Michael wrote: > Well, my thanks to you both. I have found Hack useful for > > - switching between happstack, hyena, simpleserver back ends to compare > performance and identify bugs. > - clarifying the boundary between my app and the web stack, reducing > learning costs (better docs would have helped) > - somewhat future-proofing my code, reducing churn as web stacks evolve > - providing new options for my app almost for free via middleware and > handlers (webkit handler!) > > I assume WAI would provide similar benefits in time, and more. Jinjing, > what's your position on WAI ? Will you keep working on Hack, or should WAI > replace it ? > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > -- jinjing --===============7215115359129157666==-- From jeremy@n-heptane.com Tue Mar 23 12:29:12 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANN: Salvia-1.0.0 Date: Tue, 23 Mar 2010 12:00:11 -0500 Message-ID: In-Reply-To: <25913FBF-E5CE-4FA8-B163-C99A0D1915FE@cs.uu.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2022773651335480796==" --===============2022773651335480796== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 22, 2010 at 9:59 AM, Sebastiaan Visser wrote: > How do I put this delicately? I do not think WAI is the way to go. > > On the Hackage page of WAI I read: "Provides a common protocol for > communication between web aplications and web servers." This means that WAI > is a proposed standardized interface intended to sit between server and a > web application. There several reasons why I don't like the idea of a > standardized interface between the application server and the web > application. > > First of all, no one will ever agree on this type of interface. Not on the > level of abstraction, not on the actual naming of the datatypes, not on the > amount of documentation, not on the placement of the parenthesis. I, for > example, don't like WAI at all: I do not want be forced to use enumerators > for the output, ByteStrings for the input, only 10 predefined response > codes, etc. I am not thrilled about certain aspects of Wai. For example, the Status type names the constructors after their numeric value instead of their more human friendly names. But at the same time, happstack users are not really going to know the difference. If you look at: http://patch-tag.com/r/mae/happstack/snapshot/current/content/pretty/happstac= k-wai/Happstack/Server/Filters.hs you will see that happstack provides it's own combinators for handling the response code -- so the end user won't even see a difference between the normal happstack server and the wai based one. In a similar vain, being 'forced to use enumerators for the output' is not really a big deal for happstack. Responses are often created by calling toResponse from the ToMessage class: http://patch-tag.com/r/mae/happstack/snapshot/current/content/pretty/happstac= k-wai/Happstack/Server/ToMessage.hs It is easy to just stick in a call to fromLBS (from lazy bytestring) to convert the existing lazy bytestring classes to use enumerators. (You don't get the fully power of enumerators that way, but it does mean that enumerators don't have to be invasive). I don't see the bytestring input as being an issue either.. the network libraries are giving us either Strings or ByteStrings, so it seems like a good starting point. Once again, the happstack libraries already provide abstractions so that you can get the processed data in a variety of different formats. The low-level representation is not often seen directly by the end the user. > Secondly, this type of interface will degrade projects like Happstack and > Salvia to be mere `back-ends', which they are not. They are both server > implementations _and_ interfaces to the programmer. Salvia for example is > designed to be a combinator library (not a fixed API) in which some > low-level protocol aspects, like keep-alive, http-range support, REST, > serving HEAD requests are implemented in the same paradigm as the higher > level web controllers. I truly like this idea and this will be totally > invalidated by something like WAI of Hack. > I think Wai has a lot to offer to Happstack. As I have demonstrated already, swapping out the lazy I/O server in happstack with Wai is almost not noticeable to the end user. But we get a few nice things 'for free'. The user now has the option of constructing responses that use enumerators instead of only being able to use lazy ByteStrings. And we can get other middleware for free. At present, happstack has it's own private code for supporting compressed output. But with wai, would we get that for free and could have spent the time doing something new instead. It should also make it easier for non-happstack projects to use happstack things like ServerMonad with out being tied to the happstack lazy I/O server. Seems like there are still a lot of people interested in CGI and shared servers. In happstack-wai the ServerMonad module does not depend on any other happstack specific modules. So we could actually split that into a standalone library that is usuable with any Wai based app. This would allow people to get a taste of happstack with out having to commit to our whole framework. What I do like to see though, is something like the Ruby Rack interface, > which calls itself a "a Ruby Webserver Interface". This is an interface > between the actual OS/network and the application server, not an interface > between an application server and the web application. Call it WSI not WAI, > this subtle difference actually means a lot. > > This WSI would just give me file handle/socket and possible a pre-parsed > HTTP message, but that is all. A Rack-like interface would allow me to run > my Salvia web applications on any backend, like CGI, or in mod_haskell, in > the blazingly fast iteratee based Hyena or behind an Apache proxy. But > still, the web application is written against Salvia (or the framework you > like most) and can piggy bag on all the neat features it supplies. > I am not really clear on what your vision here is. A file handle/socket sounds pretty low-level. CGI passes information differently than a direct HTTP connection. Would you want your application to have to know about those differences and to handle them specifically? In what ways does the Request type in Wai not meet your desire for a pre-parsed HTTP message ? If you wanted to use your app with Hyena, then wouldn't your app need to return an iteratee based response? My apps run unmodified when I stick them behind an Apache proxy.. what does Wai / Rack need to provide? I think the interesting part of happstack server is what it does to build functions of the type Request -> IO Response. The low-level part where it actually has to talk to a socket and parse something into a Request or send the Response over the network is not a very innovative part of happstack-server. I would much prefer to let a project like hyena focus on that aspect. Your goals for Salvia are likely different than happstack's and so wai may not be good for you. I just wanted to give you a picture of why the happstack project might be excited by Wai rather than feeling like it is being relegated to a boring backend. If anything I think that is backwards -- Wai is providing the 'backend' and happstack is the frontend. Wai gives us the ability to swap in different backends with no changes to a happstack application. That means we can get out of the business of backends and focus on the parts of happstack that deliver unique value. - jeremy --===============2022773651335480796== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gTW9uLCBNYXIgMjIsIDIwMTAgYXQgOTo1OSBBTSwgU2ViYXN0aWFhbiBWaXNzZXIgPHNwYW4g ZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWlsdG86c2Z2aXNzZXJAY3MudXUubmwiPnNmdmlzc2Vy QGNzLnV1Lm5sPC9hPiZndDs8L3NwYW4+IHdyb3RlOjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90 ZSI+PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0ibWFyZ2luOjAgMCAwIC44 ZXg7Ym9yZGVyLWxlZ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Glz IHRoZSBmcm9udGVuZC4gV2FpIGdpdmVzIHVzIHRoZSBhYmlsaXR5IHRvIHN3YXAgaW4gZGlmZmVy ZW50IGJhY2tlbmRzIHdpdGggbm8gY2hhbmdlcyB0byBhIGhhcHBzdGFjayBhcHBsaWNhdGlvbi4g VGhhdCBtZWFucyB3ZSBjYW4gZ2V0IG91dCBvZiB0aGUgYnVzaW5lc3Mgb2YgYmFja2VuZHMgYW5k IGZvY3VzIG9uIHRoZSBwYXJ0cyBvZiBoYXBwc3RhY2sgdGhhdCBkZWxpdmVyIHVuaXF1ZSB2YWx1 ZS48L2Rpdj4KPGRpdj48YnI+PC9kaXY+PGRpdj4tIGplcmVteTwvZGl2PjwvZGl2Pgo= --===============2022773651335480796==-- From jeremy@n-heptane.com Tue Mar 23 15:05:28 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Tue, 23 Mar 2010 14:36:28 -0500 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1539183285750048333==" --===============1539183285750048333== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit What happens if you have, data UserRoute = Find Int Int you need a instance: instance (GToURL f, GToURL g) => GToURL (f :*: g) I think? But the fromURL / gfromURL functions do not have a way to indicate how much of the input they consumed -- which I think will be a problem? I believe the current code works because it assumes that each call to gfromURL will consume all the remaining input. But when your constructor has two arguments, the first one better not consume all the rest of the input.. - jeremy On Tue, Mar 16, 2010 at 3:52 AM, Chris Eidhof wrote: > Hey everyone, > > I just wrote down some of my ideas about type-safe URL handling on github, > it's at http://gist.github.com/333769 > > I think it's similar to what Jeremy is doing with his urlt package [1]. > > -chris > > [1]: http://src.seereason.com/~jeremy/SimpleSite1.html > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > --===============1539183285750048333== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 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aHR0cDovL3d3dy5oYXNrZWxsLm9y Zy9tYWlsbWFuL2xpc3RpbmZvL3dlYi1kZXZlbCIgdGFyZ2V0PSJfYmxhbmsiPmh0dHA6Ly93d3cu aGFza2VsbC5vcmcvbWFpbG1hbi9saXN0aW5mby93ZWItZGV2ZWw8L2E+PGJyPgo8L2Jsb2NrcXVv dGU+PC9kaXY+PGJyPjwvZGl2Pgo= --===============1539183285750048333==-- From jeremy@n-heptane.com Tue Mar 23 15:28:17 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Tue, 23 Mar 2010 14:59:17 -0500 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7294428973464638172==" --===============7294428973464638172== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit My solution, by the way was to change fromURL to have a type more like: fromURL :: [String] -> (Failing a, [String]) so that it returns the unconsumed portion of the path segments. If you get the latest urlt from darcs: darcs get http://src.seereason.com/urlt/ I have ported the regular stuff over already. Someone needs to add the missing instance for :*:. In that code I am using the Consumer monad, which is just a wrapped up version of ([c] -> (a, [c])). The URLT library as a whole does not build at the moment, but he parts needed to fix URLT.Regular do. - jeremy On Tue, Mar 23, 2010 at 2:36 PM, Jeremy Shaw wrote: > What happens if you have, > > data UserRoute = Find Int Int > > you need a instance: > > instance (GToURL f, GToURL g) => GToURL (f :*: g) > > I think? > > But the fromURL / gfromURL functions do not have a way to indicate how much > of the input they consumed -- which I think will be a problem? > > I believe the current code works because it assumes that each call to > gfromURL will consume all the remaining input. But when your constructor has > two arguments, the first one better not consume all the rest of the input.. > > - jeremy > > On Tue, Mar 16, 2010 at 3:52 AM, Chris Eidhof wrote: > >> Hey everyone, >> >> I just wrote down some of my ideas about type-safe URL handling on github, >> it's at http://gist.github.com/333769 >> >> I think it's similar to what Jeremy is doing with his urlt package [1]. >> >> -chris >> >> [1]: http://src.seereason.com/~jeremy/SimpleSite1.html >> >> _______________________________________________ >> web-devel mailing list >> web-devel@haskell.org >> http://www.haskell.org/mailman/listinfo/web-devel >> > > --===============7294428973464638172== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 TXkgc29sdXRpb24sIGJ5IHRoZSB3YXkgd2FzIHRvIGNoYW5nZSBmcm9tVVJMIHRvIGhhdmUgYSB0 eXBlIG1vcmUgbGlrZTo8ZGl2Pjxicj48L2Rpdj48ZGl2PqBmcm9tVVJMIDo6IFtTdHJpbmddIC0m Z3Q7IChGYWlsaW5nIGEsIFtTdHJpbmddKTwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+c28gdGhh dCBpdCByZXR1cm5zIHRoZSB1bmNvbnN1bWVkIHBvcnRpb24gb2YgdGhlIHBhdGggc2VnbWVudHMu PC9kaXY+CjxkaXY+PGJyPjwvZGl2PjxkaXY+SWYgeW91IGdldCB0aGUgbGF0ZXN0IHVybHQgZnJv bSBkYXJjczo8L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PmRhcmNzIGdldCA8YSBocmVmPSJodHRw Oi8vc3JjLnNlZXJlYXNvbi5jb20vdXJsdC8iPmh0dHA6Ly9zcmMuc2VlcmVhc29uLmNvbS91cmx0 LzwvYT48L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PkkgaGF2ZSBwb3J0ZWQgdGhlIHJlZ3VsYXIg c3R1ZmYgb3ZlciBhbHJlYWR5LiBTb21lb25lIG5lZWRzIHRvIGFkZCB0aGUgbWlzc2luZyBpbnN0 YW5jZSBmb3IgOio6LjwvZGl2Pgo8ZGl2Pjxicj48L2Rpdj48ZGl2PkluIHRoYXQgY29kZSBJIGFt IHVzaW5nIHRoZSBDb25zdW1lciBtb25hZCwgd2hpY2ggaXMganVzdCBhIHdyYXBwZWQgdXAgdmVy c2lvbiBvZiAoW2NdIC0mZ3Q7IChhLCBbY10pKS48L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PlRo ZSBVUkxU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ocmVmPSJodHRwOi8v Z2lzdC5naXRodWIuY29tLzMzMzc2OSIgdGFyZ2V0PSJfYmxhbmsiPmh0dHA6Ly9naXN0LmdpdGh1 Yi5jb20vMzMzNzY5PC9hPjxicj4KPGJyPgpJIHRoaW5rIGl0JiMzOTtzIHNpbWlsYXIgdG8gd2hh dCBKZXJlbXkgaXMgZG9pbmcgd2l0aCBoaXMgdXJsdCBwYWNrYWdlIFsxXS48YnI+Cjxicj4KLWNo cmlzPGJyPgo8YnI+ClsxXTogPGEgaHJlZj0iaHR0cDovL3NyYy5zZWVyZWFzb24uY29tL35qZXJl bXkvU2ltcGxlU2l0ZTEuaHRtbCIgdGFyZ2V0PSJfYmxhbmsiPmh0dHA6Ly9zcmMuc2VlcmVhc29u LmNvbS9+amVyZW15L1NpbXBsZVNpdGUxLmh0bWw8L2E+PGJyPgo8YnI+Cl9fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fPGJyPgp3ZWItZGV2ZWwgbWFpbGluZyBs aXN0PGJyPgo8YSBocmVmPSJtYWlsdG86d2ViLWRldmVsQGhhc2tlbGwub3JnIiB0YXJnZXQ9Il9i bGFuayI+d2ViLWRldmVsQGhhc2tlbGwub3JnPC9hPjxicj4KPGEgaHJlZj0iaHR0cDovL3d3dy5o YXNrZWxsLm9yZy9tYWlsbWFuL2xpc3RpbmZvL3dlYi1kZXZlbCIgdGFyZ2V0PSJfYmxhbmsiPmh0 dHA6Ly93d3cuaGFza2VsbC5vcmcvbWFpbG1hbi9saXN0aW5mby93ZWItZGV2ZWw8L2E+PGJyPgo8 L2Jsb2NrcXVvdGU+PC9kaXY+PGJyPjwvZGl2Pgo8L2Rpdj48L2Rpdj48L2Jsb2NrcXVvdGU+PC9k aXY+PGJyPjwvZGl2Pgo= --===============7294428973464638172==-- From michael@snoyman.com Tue Mar 23 16:22:26 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANN: Salvia-1.0.0 Date: Tue, 23 Mar 2010 13:53:25 -0700 Message-ID: <29bf512f1003231353h1e7b693cgfb58d438bd6129c5@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9192156885710135070==" --===============9192156885710135070== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Tue, Mar 23, 2010 at 10:00 AM, Jeremy Shaw wrote: > > I am not thrilled about certain aspects of Wai. For example, the Status > type names the constructors after their numeric value instead of their more > human friendly names. But at the same time, happstack users are not really > going to know the difference. If you look at: > > > http://patch-tag.com/r/mae/happstack/snapshot/current/content/pretty/happst= ack-wai/Happstack/Server/Filters.hs > > you will see that happstack provides it's own combinators for handling the > response code -- so the end user won't even see a difference between the > normal happstack server and the wai based one. > > I would just like to make two comments on this. Firstly, I think layering a library on top of WAI is a perfect method for interacting with it the way you want to. Secondly, WAI is not yet entrenched enough to be "set in stone," and there are most definitely design decisions which are sub-optimal. If anyone is interested in changing the interface for WAI, I suggest they bring up the ideas sooner rather than later. I can think of a few issues that have been broached so far: * "I don't like enumerators." Well, that one is going to be sticking around, sorry. It's the whole impetus for WAI. If you want lazy bytestrings, use Hack, it's a great package. Or even better: just layer your lazy bytestrings on top of WAI; the reason the request body is a Source instead of an Enumerator is so that it can be easily converted to a lazy bytestring. * "It's using the wrong type of enumerators." I don't think it makes sense at this point to add an iteratee dependency, since it appears that package is young and unstable. If someone wants to suggest a different definition for the Enumerator type *and explain why it's better,* I'm all ears. * "Request and response headers should not have their own data types." I'm open to discussion on this issue, though it's very pertinent to the next point. * "Request and response headers should have case-insensitive match for the Eq instance." I'm thinking that this is the correct approach to take, and would like input on it. (Thanks Gregory. * "Status200 -> StatusOK." Once again, I have no strong feelings on this, but I thought it was less debatable to use numeric codes than to pick a name. For example, can anyone agree on what we should call code 302? I'll make sure that WAI follows the PVP, so making these changes should not affect code in use. Michael --===============9192156885710135070== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 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aXY+PGJyPjwvZGl2PjxkaXY+SSYjMzk7bGwgbWFrZSBzdXJlIHRoYXQgV0FJ IGZvbGxvd3MgdGhlIFBWUCwgc28gbWFraW5nIHRoZXNlIGNoYW5nZXMgc2hvdWxkIG5vdCBhZmZl Y3QgY29kZSBpbiB1c2UuPC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5NaWNoYWVsPC9kaXY+PC9k aXY+Cg== --===============9192156885710135070==-- From cdsmith@gmail.com Tue Mar 23 16:47:24 2010 From: Chris Smith To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANN: Salvia-1.0.0 Date: Tue, 23 Mar 2010 15:18:12 -0600 Message-ID: <1269379092.14911.536.camel@dell-desktop.example.com> In-Reply-To: <29bf512f1003231353h1e7b693cgfb58d438bd6129c5@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2706816357457511522==" --===============2706816357457511522== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Tue, 2010-03-23 at 13:53 -0700, Michael Snoyman wrote: > If anyone is interested in changing the interface for WAI, I suggest > they bring up the ideas sooner rather than later. For my part, since I did say something about this, my concern wasn't really anything I'd like to see changed in WAI, so much as to say that it seems a tad early to be spreading an expectation that web app stuff in Haskell will be done via WAI. So I was not objecting to WAI itself; but rather to seeing the announcement of Salvia greeted with a nearly-immediate "is it WAI compliant?" I also won't hide my distaste for the enumerator-based approach; but it's a distaste that is so far not accompanied by having a better alternative. -- Chris Smith --===============2706816357457511522==-- From greg@gregorycollins.net Tue Mar 23 16:51:07 2010 From: Gregory Collins To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANN: Salvia-1.0.0 Date: Tue, 23 Mar 2010 17:22:05 -0400 Message-ID: <87iq8m91j6.fsf@gregorycollins.net> In-Reply-To: <29bf512f1003231353h1e7b693cgfb58d438bd6129c5@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0385555220912376781==" --===============0385555220912376781== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Michael Snoyman writes: > * "Request and response headers should have case-insensitive match for > the Eq instance." I'm thinking that this is the correct approach to > take, and would like input on it. (Thanks Gregory. Here's our (dead simple) code for this: ------------------------------------------------------------------------ {-# LANGUAGE BangPatterns #-} {-# LANGUAGE OverloadedStrings #-} module Data.CIByteString ( CIByteString , toCI , unCI ) where -- for IsString instance import Data.ByteString.Char8 () import Data.ByteString (ByteString) import Data.ByteString.Internal (c2w, w2c) import qualified Data.ByteString as S import Data.Char import Data.String -- | A case-insensitive newtype wrapper for ByteString data CIByteString = CIByteString { unCI :: !ByteString , _lowercased :: !ByteString } toCI :: ByteString -> CIByteString toCI s = CIByteString s t where t = lowercase s instance Show CIByteString where show (CIByteString s _) = show s lowercase :: ByteString -> ByteString lowercase = S.map (c2w . toLower . w2c) instance Eq CIByteString where (CIByteString _ a) == (CIByteString _ b) = a == b (CIByteString _ a) /= (CIByteString _ b) = a /= b instance Ord CIByteString where (CIByteString _ a) <= (CIByteString _ b) = a <= b instance IsString CIByteString where fromString = toCI . fromString ------------------------------------------------------------------------ Note that we store the downcased version in the datatype, otherwise Eq/Ord has to perform the downcase a zillion times, only to throw it away afterwards. Note also that we ignore any encoding issues -- we can get away w/ this because HTTP header names are constrained by the protocol to be ASCII-only. This datatype also has an "IsString" instance so you can use string literals with "{-# LANGUAGE OverloadedStrings #-}" turned on. G. -- Gregory Collins --===============0385555220912376781==-- From chris@eidhof.nl Tue Mar 23 16:53:54 2010 From: Chris Eidhof To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Tue, 23 Mar 2010 22:24:44 +0100 Message-ID: <8EAABF9D-F09C-4A15-8A78-7FCE74A72EE2@eidhof.nl> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1681777357996913460==" --===============1681777357996913460== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Jeremy, Yes, that's why I didn't provide the instance. It should be a real (lightweig= ht) parser. My implementation is just a sketch, not a real implementation. -chris On 23 mrt 2010, at 20:36, Jeremy Shaw wrote: > What happens if you have, >=20 > data UserRoute =3D Find Int Int >=20 > you need a instance: >=20 > instance (GToURL f, GToURL g) =3D> GToURL (f :*: g) >=20 > I think? >=20 > But the fromURL / gfromURL functions do not have a way to indicate how much= of the input they consumed -- which I think will be a problem? >=20 > I believe the current code works because it assumes that each call to gfrom= URL will consume all the remaining input. But when your constructor has two a= rguments, the first one better not consume all the rest of the input.. >=20 > - jeremy >=20 > On Tue, Mar 16, 2010 at 3:52 AM, Chris Eidhof wrote: > Hey everyone, >=20 > I just wrote down some of my ideas about type-safe URL handling on github, = it's at http://gist.github.com/333769 >=20 > I think it's similar to what Jeremy is doing with his urlt package [1]. >=20 > -chris >=20 > [1]: http://src.seereason.com/~jeremy/SimpleSite1.html >=20 > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel >=20 --===============1681777357996913460==-- From jeremy@n-heptane.com Tue Mar 23 20:12:52 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANN: Salvia-1.0.0 Date: Tue, 23 Mar 2010 19:43:52 -0500 Message-ID: In-Reply-To: <29bf512f1003231353h1e7b693cgfb58d438bd6129c5@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8589842031475065407==" --===============8589842031475065407== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Tue, Mar 23, 2010 at 3:53 PM, Michael Snoyman wrote: > I would just like to make two comments on this. Firstly, I think layering a > library on top of WAI is a perfect method for interacting with it the way > you want to. Secondly, WAI is not yet entrenched enough to be "set in > stone," and there are most definitely design decisions which are > sub-optimal. > Right. I figured the only way it was going to actually get good is if people were using it :) Some people have suggested it is not the right thing and we should wait until we have more experience before creating something like WAI. But I figure WAI is a good start, and trying to actually use it is what will uncover the problems. My only complaint would be if it *was* set in stone to early. > If anyone is interested in changing the interface for WAI, I suggest they > bring up the ideas sooner rather than later. I can think of a few issues > that have been broached so far: > > * "Request and response headers should not have their own data types." I'm > open to discussion on this issue, though it's very pertinent to the next > point. > It does feel a bit weird that some headers will have constructors, and other won't. Uniformity feels pretty. Unfortunately, there is no way to extend data types in 3rd party libraries. But we could add functions that add new headers in other libraries. For example, if you look at FilterT in happstack-wai, it has a bunch of functions for the different status codes. If a user wants to add additional functions in their own library, they can -- and they will feel just like the built-in functions. No idea if something similar would make sense for wai and the http headers. > * "Request and response headers should have case-insensitive match for the > Eq instance." I'm thinking that this is the correct approach to take, and > would like input on it. (Thanks Gregory. > I have dealt with this at all, so no idea. * "Status200 -> StatusOK." Once again, I have no strong feelings on this, > but I thought it was less debatable to use numeric codes than to pick a > name. For example, can anyone agree on what we should call code 302? > Found? I would just camel case all the names provided on this page: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html Though, I don't really care all that much, because the code for FilterT has already been written, so I'll never have to see the constructors again :p - jeremy --===============8589842031475065407== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gVHVlLCBNYXIgMjMsIDIwMTAgYXQgMzo1MyBQTSwgTWljaGFlbCBTbm95bWFuIDxzcGFuIGRp cj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFpbHRvOm1pY2hhZWxAc25veW1hbi5jb20iPm1pY2hhZWxA c25veW1hbi5jb208L2E+Jmd0Ozwvc3Bhbj4gd3JvdGU6PGJyPjxkaXYgY2xhc3M9ImdtYWlsX3F1 b3RlIj48YmxvY2txdW90ZSBjbGFzcz0iZ21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46MCAwIDAg LjhleDtib3JkZXItbGVmdDoxcHggI2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4OyI+CjxkaXYg Y2xhc3M9ImdtYWlsX3F1b3RlIj48ZGl2Pkkgd291bGQganVzdCBsaWtlIHRvIG1ha2UgdHdvIGNv bW1lbnRzIG9uIHRoaXMuI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3VnaCwgSSBkb24mIzM5O3QgcmVhbGx5IGNhcmUgYWxsIHRoYXQgbXVjaCwgYmVjYXVzZSB0 aGUgY29kZSBmb3IgRmlsdGVyVCBoYXMgYWxyZWFkeSBiZWVuIHdyaXR0ZW4sIHNvIEkmIzM5O2xs IG5ldmVyIGhhdmUgdG8gc2VlIHRoZSBjb25zdHJ1Y3RvcnMgYWdhaW4gOnA8L2Rpdj48ZGl2Pjxi cj48L2Rpdj48ZGl2Pi0gamVyZW15PC9kaXY+PGRpdj4KoDwvZGl2PjwvZGl2Pgo= --===============8589842031475065407==-- From gour@gour-nitai.com Wed Mar 24 02:23:18 2010 From: Gour To: web-devel@haskell.org Subject: [web-devel] Re: ANN: Salvia-1.0.0 Date: Wed, 24 Mar 2010 07:54:28 +0100 Message-ID: <20100324075428.4929a9db@gaura-nitai.no-ip.org> In-Reply-To: <1269379092.14911.536.camel@dell-desktop.example.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4170157452170583246==" --===============4170157452170583246== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Tue, 23 Mar 2010 15:18:12 -0600 >>>>>> "Chris" == Chris Smith wrote: Hello Chris, Chris> So I was not objecting to WAI itself; but rather to seeing the Chris> announcement of Salvia greeted with a nearly-immediate "is it Chris> WAI compliant?" Hmm, you wrote: "I share some reservations about WAI. It's certainly better than using lazy I/O for high-volume web servers, but the enumerator/iteratee stuff is far less obvious than lazy I/O as an abstraction.", so it might be (due to not being native speaker) that I do not understand it properly, but, otoh, my reasoning is that if Happstack which is kind of veteran in the young Haskell web-development scene sees the value of having WAI and providing port for it, then it I believe my question is not so much off. Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- --===============4170157452170583246== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuNC4xMCAoR05V L0xpbnV4KQoKaUVZRUFSRUNBQVlGQWt1cHR5UUFDZ2tRVThlRThmbHY5ZmFaZ3dDZmVJRVgzbE12 SEtNa2swZEFOQkFUemRmVwpQeHdBbjNYN1JhbjVEejFja1NZRHVPOVk0VEw4OHBxaAo9U05ONAot LS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============4170157452170583246==-- From jeremy@n-heptane.com Wed Mar 24 18:05:37 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Wed, 24 Mar 2010 17:36:39 -0500 Message-ID: In-Reply-To: <29bf512f1003221941u232e1bd2ia65b3b35ed863935@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3481482361569009907==" --===============3481482361569009907== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, Mar 22, 2010 at 9:41 PM, Michael Snoyman wrote: > If I'm not mistaken, I think that addresses all the issues on the table; is > there anything left to decide? I look forward to seeing a sample URLT :). > > There were other issues that came up, but nothing exciting enough to talk about. I have pushed a patch which I think brings the code up to date in terms of functionality. See WaiExample for a detail of everything that is currently supported (aside from the happstack / hsp stuff). The next steps are to: 1. change the names of any functions or types that we do not currently like 2. add the haddock documentation 3. split the package into separate packages so that you don't have to pull in extra dependencies that you aren't going to use 4. turn the WaiExample into a literate tutorial / blog post 5. add a (simple) happstack example as well So take a look and let me know what you think. Especially in regards to #1. Then we can also look into how to extend the yesod mkResources stuff to work with this new code. from a parsing point of view, we almost don't have to do anything, we could just do: [mkResource| "/foo/:int/:int" = \i j -> mySite (Foo i j) |] or whatever the syntax is. But that does not solve the issue of how to go from (Foo 1 2) back to /foo/1/2 and ensure that it is the inverse operation. - jeremy --===============3481482361569009907== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gTW9uLCBNYXIgMjIsIDIwMTAgYXQgOTo0M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Bjb3VsZCBq dXN0IGRvOjwvZGl2Pgo8ZGl2Pjxicj48L2Rpdj48ZGl2PqBbbWtSZXNvdXJjZXwgoCZxdW90Oy9m b28vOmludC86aW50JnF1b3Q7ID0gXGkgaiAtJmd0OyBteVNpdGUgKEZvbyBpIGopIHxdPC9kaXY+ PGRpdj48YnI+PC9kaXY+PGRpdj5vciB3aGF0ZXZlciB0aGUgc3ludGF4IGlzLiBCdXQgdGhhdCBk b2VzIG5vdCBzb2x2ZSB0aGUgaXNzdWUgb2YgaG93IHRvIGdvIGZyb20gKEZvbyAxIDIpIGJhY2sg dG8gL2Zvby8xLzIgYW5kIGVuc3VyZSB0aGF0IGl0IGlzIHRoZSBpbnZlcnNlIG9wZXJhdGlvbi48 L2Rpdj4KPGRpdj48YnI+PC9kaXY+PGRpdj4tIGplcmVteTwvZGl2PjwvZGl2Pgo= --===============3481482361569009907==-- From michael@snoyman.com Wed Mar 24 23:17:21 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Wed, 24 Mar 2010 20:48:22 -0700 Message-ID: <29bf512f1003242048vab39b6awd3969b62dfe5954c@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8367465158881964597==" --===============8367465158881964597== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Wed, Mar 24, 2010 at 3:36 PM, Jeremy Shaw wrote: > On Mon, Mar 22, 2010 at 9:41 PM, Michael Snoyman wrote: > >> If I'm not mistaken, I think that addresses all the issues on the table; >> is there anything left to decide? I look forward to seeing a sample URLT := ). >> >> > There were other issues that came up, but nothing exciting enough to talk > about. > > I have pushed a patch which I think brings the code up to date in terms of > functionality. See WaiExample for a detail of everything that is currently > supported (aside from the happstack / hsp stuff). > > The next steps are to: > > 1. change the names of any functions or types that we do not currently > like > 2. add the haddock documentation > 3. split the package into separate packages so that you don't have to pull > in extra dependencies that you aren't going to use > 4. turn the WaiExample into a literate tutorial / blog post > 5. add a (simple) happstack example as well > > So take a look and let me know what you think. Especially in regards to #1. > > Then we can also look into how to extend the yesod mkResources stuff to > work with this new code. > > from a parsing point of view, we almost don't have to do anything, we could > just do: > > [mkResource| "/foo/:int/:int" =3D \i j -> mySite (Foo i j) |] > > or whatever the syntax is. But that does not solve the issue of how to go > from (Foo 1 2) back to /foo/1/2 and ensure that it is the inverse operation. > > > I don't have time right now to look at the code, but I will soon (I'm in the middle of traveling *again*). Regarding the mkResource issue, I think it's slightly more complicated, and what I was thinking of was a combination of TemplateHaskell and QuasiQuotes to address it: * The quasi-quoted content will follow mostly the same syntax, though allowing you to specify the name of the constructor you wish to assign to each resource pattern. * Since we now will need to have multiple top-level definitions being generated, quasi-quoting alone won't solve the issue. So I will have a quasi-quote function to convert the YAML syntax to a StringObject, and then a TH function to convert the StringObject to: 1) A datatype for the URL. 2) A pair to to/from functions. 3) A dispatch function. This is the point at which having WebPlug/HandleT becomes useful. If that was too vague, just let me know and I'll clarify ;). Michael --===============8367465158881964597== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gV2VkLCBNYXIgMjQsIDIwMTAgYXQg MzozNiBQTSwgSmVyZW15IFNoYXcgPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWlsdG86 amVyZW15QG4taGVwdGFuZS5jb20iPmplcmVteUBuLWhlcHRhbmUuY29tPC9hPiZndDs8L3NwYW4+ IHdyb3RlOjxicj48YmxvY2txdW90ZSBjbGFzcz0iZ21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46 MCAwIDAgLjhleDtib3JkZXItbGVmdDoxcHggI2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4OyI+ CjxkaXYgY2xhc3M9ImltIj5PbiBNb24sIE1hciAyMiwgMjAxMCBhdCA5OjQxIFBNLCBNaWNoYWVs IFNub3lt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hdCB3YXMgdG9vIHZhZ3VlLCBqdXN0 IGxldCBtZSBrbm93IGFuZCBJJiMzOTtsbCBjbGFyaWZ5IDspLjwvZGl2PjxkaXY+PGJyPjwvZGl2 PjxkaXY+TWljaGFlbMKgPC9kaXY+PC9kaXY+Cg== --===============8367465158881964597==-- From asviraspossible@gmail.com Thu Mar 25 12:40:08 2010 From: Victor Nazarov To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Thu, 25 Mar 2010 20:11:13 +0300 Message-ID: In-Reply-To: <29bf512f1003242048vab39b6awd3969b62dfe5954c@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9119929761200870014==" --===============9119929761200870014== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 25, 2010 at 6:48 AM, Michael Snoyman wrote: > > > On Wed, Mar 24, 2010 at 3:36 PM, Jeremy Shaw wrote: >> >> On Mon, Mar 22, 2010 at 9:41 PM, Michael Snoyman >> wrote: >>> >>> If I'm not mistaken, I think that addresses all the issues on the table; >>> is there anything left to decide? I look forward to seeing a sample URLT = :). >> >> There were other issues that came up, but nothing exciting enough to talk >> about. >> I have pushed a patch which I think brings the code up to date in terms of >> functionality. See WaiExample for a detail of everything that is currently >> supported (aside from the happstack / hsp stuff). >> The next steps are to: >> =C2=A01. change the names of any functions or types that we do not current= ly >> like >> =C2=A02. add the haddock documentation >> =C2=A03. split the package into separate packages so that you don't have to >> pull in extra dependencies that you aren't going to use >> =C2=A04. turn the WaiExample into a literate tutorial / blog post >> =C2=A05. add a (simple) happstack example as well >> So take a look and let me know what you think. Especially in regards to >> #1. >> Then we can also look into how to extend the yesod mkResources stuff to >> work with this new code. >> from a parsing point of view, we almost don't have to do anything, we >> could just do: >> =C2=A0[mkResource| =C2=A0"/foo/:int/:int" =3D \i j -> mySite (Foo i j) |] >> or whatever the syntax is. But that does not solve the issue of how to go >> from (Foo 1 2) back to /foo/1/2 and ensure that it is the inverse operatio= n. >> > I don't have time right now to look at the code, but I will soon (I'm in the > middle of traveling *again*). Regarding the mkResource issue, I think it's > slightly more complicated, and what I was thinking of was a combination of > TemplateHaskell and QuasiQuotes to address it: > * The quasi-quoted content will follow mostly the same syntax, though > allowing you to specify the name of the constructor you wish to assign to > each resource pattern. > * Since we now will need to have multiple top-level definitions being > generated, quasi-quoting alone won't solve the issue. So I will have a > quasi-quote function to convert the YAML syntax to a StringObject, and then > a TH function to convert the StringObject to: > =C2=A0=C2=A01) A datatype for the URL. > =C2=A0=C2=A02) A pair to to/from functions. > =C2=A0=C2=A03) A dispatch function. > This is the point at which having WebPlug/HandleT becomes useful. > If that was too vague, just let me know and I'll clarify ;). Hello, everybody. I haven't been following the entire thread. But I think that typed URLs are great. When I started thinking about typed URLs, I thought about using only data type definition and dropping quosi-quotation entirely in favour of template haskell. I wanted to write some template haskell function to work on data-type declaration, it would use data-constructors names and arguments and build path components from their names. So we will need no new notation to describe application resources, we will never be conserned with URL generator and parser, we will work with our own, carefully defined data-type as it IS a URL. --=20 Victor Nazarov --===============9119929761200870014==-- From michael@snoyman.com Thu Mar 25 12:58:15 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Thu, 25 Mar 2010 10:29:13 -0700 Message-ID: <29bf512f1003251029n5773d075g2f5ad05a122cb950@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6776386007888439545==" --===============6776386007888439545== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable OK, here are my initial code comments: * Do we want to move everything into Web.URLT? More to the point, I'm not sure I see the point of calling this URLT, since it doesn't really require any monad transformers; maybe we should call it web-routes and then the module would be Web.Routes? * I like the PathInfo class and to/fromPathSegments. Perhaps we should bundle that with the decode/encodePathInfo into a single module? * I'd like to minimize dependencies as much as possible for the basic package. The two dependencies I've noticed are Consumer and applicative-extras. I think the type signatures would be clearer *without* those packages included, eg: fromPathSegments :: [String] -> Either ErrMsg a I'm not certain what exactly the type of ErrMsg should be here; I don't really have a problem using [String], which would be close to the definition of Failing. * I think it's very important to allow users to supply customized 404 pages. Essentially, we need to augment handleWai (possibly others) with a (ErrMsg -> Application) parameter. * It might be nice to have "type WaiSite url =3D Site url String Application". By the way, are you certain you want to allow parameterization over the pathInfo type? The only packages that I feel qualified to speak about then are urlt and urlt-wai, and my recommendation would be: urlt contains decode/encodePathInfo, PathInfo class and related functions, Site and related functions. If you agree on allowing the parameterization of 404 errors, then also provide a default 404 error. urlt-wai contains WaiSite, handleWai and related functions. I have not actually tested the code to make sure it's doing the right thing, but I'm sure it's perfect and bug-free ;). I'll do thorough testing when I have more than 10 minutes at the computer. Michael PS: In case you're wondering, we're visiting my in-laws in northern California right now and are driving down to my parents in southern California in a few hours, thus the erratic schedule... On Wed, Mar 24, 2010 at 3:36 PM, Jeremy Shaw wrote: > On Mon, Mar 22, 2010 at 9:41 PM, Michael Snoyman wrote: > >> If I'm not mistaken, I think that addresses all the issues on the table; >> is there anything left to decide? I look forward to seeing a sample URLT := ). >> >> > There were other issues that came up, but nothing exciting enough to talk > about. > > I have pushed a patch which I think brings the code up to date in terms of > functionality. See WaiExample for a detail of everything that is currently > supported (aside from the happstack / hsp stuff). > > The next steps are to: > > 1. change the names of any functions or types that we do not currently > like > 2. add the haddock documentation > 3. split the package into separate packages so that you don't have to pull > in extra dependencies that you aren't going to use > 4. turn the WaiExample into a literate tutorial / blog post > 5. add a (simple) happstack example as well > > So take a look and let me know what you think. Especially in regards to #1. > > Then we can also look into how to extend the yesod mkResources stuff to > work with this new code. > > from a parsing point of view, we almost don't have to do anything, we could > just do: > > [mkResource| "/foo/:int/:int" =3D \i j -> mySite (Foo i j) |] > > or whatever the syntax is. But that does not solve the issue of how to go > from (Foo 1 2) back to /foo/1/2 and ensure that it is the inverse operation. > > - jeremy > --===============6776386007888439545== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T0ssIG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ibG9ja3F1b3Rl PjwvZGl2Pjxicj48L2Rpdj4K --===============6776386007888439545==-- From jeremy@n-heptane.com Thu Mar 25 16:00:52 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Thu, 25 Mar 2010 15:31:53 -0500 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1269270212609525207==" --===============1269270212609525207== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hello Victor, The current version of urlt already has template haskell code for automatically generating the url from the data type. There is an example of that in WaiExample.hs. I find that the TH is great when developing the application, because it 'just works'. But when the app gets closer to release, I sometimes want to customize the way the urls look. (for seo, etc). The nice part is that I can just write some custom instances of PathInfo instead of deriving them, and all of the other code just works. Is there something more that you wanted the TH code to do? - jeremy On Thu, Mar 25, 2010 at 12:11 PM, Victor Nazarov wrote: > On Thu, Mar 25, 2010 at 6:48 AM, Michael Snoyman > wrote: > > > > > > On Wed, Mar 24, 2010 at 3:36 PM, Jeremy Shaw > wrote: > >> > >> On Mon, Mar 22, 2010 at 9:41 PM, Michael Snoyman > >> wrote: > >>> > >>> If I'm not mistaken, I think that addresses all the issues on the > table; > >>> is there anything left to decide? I look forward to seeing a sample > URLT :). > >> > >> There were other issues that came up, but nothing exciting enough to > talk > >> about. > >> I have pushed a patch which I think brings the code up to date in terms > of > >> functionality. See WaiExample for a detail of everything that is > currently > >> supported (aside from the happstack / hsp stuff). > >> The next steps are to: > >> 1. change the names of any functions or types that we do not currently > >> like > >> 2. add the haddock documentation > >> 3. split the package into separate packages so that you don't have to > >> pull in extra dependencies that you aren't going to use > >> 4. turn the WaiExample into a literate tutorial / blog post > >> 5. add a (simple) happstack example as well > >> So take a look and let me know what you think. Especially in regards to > >> #1. > >> Then we can also look into how to extend the yesod mkResources stuff to > >> work with this new code. > >> from a parsing point of view, we almost don't have to do anything, we > >> could just do: > >> [mkResource| "/foo/:int/:int" = \i j -> mySite (Foo i j) |] > >> or whatever the syntax is. But that does not solve the issue of how to > go > >> from (Foo 1 2) back to /foo/1/2 and ensure that it is the inverse > operation. > >> > > I don't have time right now to look at the code, but I will soon (I'm in > the > > middle of traveling *again*). Regarding the mkResource issue, I think > it's > > slightly more complicated, and what I was thinking of was a combination > of > > TemplateHaskell and QuasiQuotes to address it: > > * The quasi-quoted content will follow mostly the same syntax, though > > allowing you to specify the name of the constructor you wish to assign to > > each resource pattern. > > * Since we now will need to have multiple top-level definitions being > > generated, quasi-quoting alone won't solve the issue. So I will have a > > quasi-quote function to convert the YAML syntax to a StringObject, and > then > > a TH function to convert the StringObject to: > > 1) A datatype for the URL. > > 2) A pair to to/from functions. > > 3) A dispatch function. > > This is the point at which having WebPlug/HandleT becomes useful. > > If that was too vague, just let me know and I'll clarify ;). > > Hello, everybody. > > I haven't been following the entire thread. But I think that typed > URLs are great. When I started thinking about typed URLs, I thought > about using only data type definition and dropping quosi-quotation > entirely in favour of template haskell. I wanted to write some > template haskell function to work on data-type declaration, it would > use data-constructors names and arguments and build path components > from their names. So we will need no new notation to describe > application resources, we will never be conserned with URL generator > and parser, we will work with our own, carefully defined data-type as > it IS a URL. > > -- > Victor Nazarov > --===============1269270212609525207== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SGVsbG8gVmljdG9yLDxkaXY+PGJyPjwvZGl2PjxkaXY+VGhlIGN1cnJlbnQgdmVyc2lvbiBvZiB1 cmx0IGFscmVhZHkgaGFzIHRlbXBsYXRlIGhhc2tlbGwgY29kZSBmb3IgYXV0b21hdGljYWxseSBn ZW5lcmF0aW5nIHRoZSB1cmwgZnJvbSB0aGUgZGF0YSB0eXBlLiBUaGVyZSBpcyBhbiBleGFtcGxl IG9mIHRoYXQgaW4gV2FpRXhhbXBsZS5ocy48L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PgpJIGZp bmQgdGhhdCB0aGUgVEggaXMgZ3JlYXQgd2hlbiBkZXZlbG9wa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PlZpY3RvciBOYXphcm92PGJy Pgo8L2ZvbnQ+PC9ibG9ja3F1b3RlPjwvZGl2Pjxicj48L2Rpdj4K --===============1269270212609525207==-- From jeremy@n-heptane.com Thu Mar 25 18:54:12 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Thu, 25 Mar 2010 18:25:17 -0500 Message-ID: In-Reply-To: <29bf512f1003251029n5773d075g2f5ad05a122cb950@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8074673287313873630==" --===============8074673287313873630== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Thu, Mar 25, 2010 at 12:29 PM, Michael Snoyman wrote: > OK, here are my initial code comments: > > * Do we want to move everything into Web.URLT? More to the point, I'm not > sure I see the point of calling this URLT, since it doesn't really require > any monad transformers; maybe we should call it web-routes and then the > module would be Web.Routes? > I think Web.Routes is a fine name. I'll make it happen. In the rest of this post I refer to things by the old names, but I do intend to change the module names and rename the package to web-routes. > * I like the PathInfo class and to/fromPathSegments. Perhaps we should > bundle that with the decode/encodePathInfo into a single module? > I put PathInfo in a separate module because I am a little dubious of classes these days. I find it a bit annoying that you can only have one PathInfo instance per type. And I think it helps show that using PathInfo is not actually required. But, in practice, I think having less modules is probably a good thing in this case, since it does not affect the dependency chain at all. Just because I *can* put every function in it's own module doesn't mean I should. ;) Also, we probably do want people to provide PathInfo instances, even if they don't have to.. * I'd like to minimize dependencies as much as possible for the basic > package. The two dependencies I've noticed are Consumer and > applicative-extras. I think the type signatures would be clearer *without* > those packages included, eg: > > fromPathSegments :: [String] -> Either ErrMsg a > Except that is not a usable type. fromPathSegments may consume, some, but not all of the path segments. Consider the type: data SiteURL = Foo Int Int fromPathSegments is going to receive the path segments: ["Foo","1","2"] If you wrote a parser by hand, you would want it to look a little something like: do string "Foo" slash i <- fromPathSegments slash j <- fromPathSegments eol return (Foo i j) The key concept here is that when you call fromPathSegments to get the first argument of Foo you need to know how many of the path segments were consumed / are remaining, so you can pass only those segments to the second fromPathSegments. So you really need a type like: fromPathSegments :: [String] -> (Either ErrMsg a, [String]) which outputs the unconsumed path segments. But this is obviously a ripe target for a monad of some sort -- trying keep track of the unconsumed portions by hand seems like it would asking for trouble... The Consumer monad takes care of that and provides the functions you would expect such as, next, peek, and poke. And it seems nice to be able to use Monad, MonadPlus, Applicative, Alternative, etc, for composing fromPathSegments into larger parsers ? But, perhaps there is a better choice of monad, or a better way of dealing with the problem? Or maybe it's not really a problem? I think Failing is a pretty nifty data-type for dealing with errors. But perhaps it is not a big win here.. The #1 thing that makes Failing better than (Either [String] a) is it's Applicative instance. Specifically, Failing will accumulate and return all the errors which have occurred, not the just first failure (which is the behavior for Applicative (Either e)). So for example, let's say you are doing are trying to lookup a bunch of keys from the query string. The key / value pairs in the query string are typically independent of each other. So let's say you do: (,) <$> lookup "foo" <*> lookup "bar" but neither of those keys exist. With Either you will only get the error 'could not find "foo"'. But with Failing you will get the error 'could not find "foo". could not find "bar"'. It is nice to get a report of all the things that are broken, instead of getting only one error at a time, fixing it, and then getting another error, etc. However, I am not sure if this property is all that useful which urlt. If you are trying to parse a url like: (string "Foo" *> Foo) <$> fromPathSegments <*> fromPathSegments And the parsing of "Foo" fails.. then there is no use in finding out if the other segments parse ok -- because they are likely to be garbage. Maybe it failed because it got the string "FOo" instead of "Foo", but more likely it got something completely unrelated like, /bar/c/2.4. So, perhaps Either is a better choice even with out considering dependencies... I think that Applicative / Alternative instances for Either are only defined in transformers in the Control.Monad.Error module -- which is a bit annoying. But we don't actually need those to implement urlt itself. This brings up another detail though. the fromPathSegments / Consumer stuff is basically implementing a parser. Except, unlike something like parsec, we do not keep track of the current position for reporting errors. I wonder if we should perhaps use a slightly richer parser environment. Within a web app, once you got your to/from instances debugged, you will never get a parse error, so having great error messages is not essential. But, for other people linking to your site it could be potentially helpful. Though, it seems like the current error messages out to be sufficient given how short the urls are.. I'm not certain what exactly the type of ErrMsg should be here; I don't > really have a problem using [String], which would be close to the definition > of Failing. > > * I think it's very important to allow users to supply customized 404 > pages. Essentially, we need to augment handleWai (possibly others) with a > (ErrMsg -> Application) parameter. > Yeah, there are (at least) two possibilities, add an extra param for the handler. Or bubble the error up to the top: handleWai_1 :: (url -> String) -> (String -> Failing url) -> String -> ([ErrorMsg] -> Application) -> ((url -> String) -> url -> Application) -> Application handleWai_1 fromUrl toUrl approot handleError handler = \request -> do let fUrl = toUrl $ stripOverlap approot $ S.unpack $ pathInfo request case fUrl of (Failure errs) -> handleError errs request (Success url) -> handler (showString approot . fromUrl) url request handleWai_2 :: (url -> String) -> (String -> Failing url) -> String -> ((url -> String) -> url -> Application) -> (Request -> IO (Failing Response)) handleWai_2 fromUrl toUrl approot handler = \request -> do let fUrl = toUrl $ stripOverlap approot $ S.unpack $ pathInfo request case fUrl of (Failure errs) -> return (Failure errs) (Success url) -> fmap Success $ handler (showString approot . fromUrl) url request The second choice is perhaps more flexible. Which do you prefer? In the first option, the handleError function could be a Maybe value -- and if you supply Nothing you get some default 404 page? In happstack we have a third possiblity. The ServerMonad is an instance of MonadPlus so we can throw out the error message and just call mzero: implSite :: (Functor m, Monad m, MonadPlus m, ServerMonad m) => String -> FilePath -> Site url String (m a) -> m a implSite domain approot siteSpec = do r <- implSite_ domain approot siteSpec case r of (Failure _) -> mzero (Success a) -> return a implSite_ :: (Functor m, Monad m, MonadPlus m, ServerMonad m) => String -> FilePath -> Site url String (m a) -> m (Failing a) implSite_ domain approot siteSpec = dirs approot $ do rq <- askRq let pathInfo = intercalate "/" (rqPaths rq) f = runSite (domain ++ approot) siteSpec pathInfo case f of (Failure errs) -> return (Failure errs) (Success sp) -> Success <$> (localRq (const $ rq { rqPaths = [] }) sp) then we can do: msum [ implSite "domain" "approot" siteSpec , default404 ] if implSite calls mzero, then the next handler (in this case default404) is tried. > * It might be nice to have "type WaiSite url = Site url String > Application". By the way, are you certain you want to allow parameterization > over the pathInfo type? > I'm not certain I don't want to allow it... I have a vague notion that I might want to use Text sometimes instead of String. Though if I was really committed to that then I should make toPathInfo and fromPathInfo parameterized over pathInfo as well... So perhaps I will axe it from Site for now. I need to change the name of that type and it's record names too I think. > The only packages that I feel qualified to speak about then are urlt and > urlt-wai, and my recommendation would be: > > urlt contains decode/encodePathInfo, PathInfo class and related functions, > Site and related functions. If you agree on allowing the parameterization of > 404 errors, then also provide a default 404 error. > > urlt-wai contains WaiSite, handleWai and related functions. > Yeah, that is what I was thinking. urlt would contain what is currently in; URLT.Base URLT.PathInfo URLT.HandleT URLT.Monad URLT.QuickCheck QuickCheck module does not actually depend on QuickCheck, which is nice because QC1 vs QC2 is a big problem right now. It might also be nice to include: URLT.TH with depends on template-haskell. But I am not sure that depending on template-haskell is an issue because template-haskell comes with ghc6, and the code in URLT.TH already handles the breakage that happened with TH 2.4. If I switch to Either instead of Failing I believe the dependencies would be: base, Consumer, template-haskell, network, utf8-string urlt-wai would just include: URLT.Wai - jeremy --===============8074673287313873630== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gVGh1LCBNYXIgMjUsIDIwMTAgYXQgMTI6MjkgUE0sIE1pY2hhZWwgU25veW1hbiA8c3BhbiBk aXI9Imx0ciI+Jmx0OzxhIGhyZWY9Im1haWx0bzptaWNoYWVsQHNub3ltYW4uY29tIj5taWNoYWVs QHNub3ltYW4uY29tPC9hPiZndDs8L3NwYW4+IHdyb3RlOjxicj48ZGl2IGNsYXNzPSJnbWFpbF9x dW90ZSI+PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0ibWFyZ2luOjAgMCAw IC44ZXg7Ym9yZGVyLWxlZnQ6MXB4ICNjY2Mgc29saWQ7cGFkZGluZy1sZWZ0OjFleDsiPgpPSywg aGVyZSBhcmUgbXkgaW5pdGlhbCBjb2RlIGNvbW1lbnRzOjxkaXY+PGJyPjwvZGl2PjxkaXY+KiBE byB3ZSB3YW50IHRvIG1vdmUgZXZlcnl0aGluZyB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From asviraspossible@gmail.com Fri Mar 26 06:05:30 2010 From: Victor Nazarov To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Fri, 26 Mar 2010 13:36:37 +0300 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4192353521266379001==" --===============4192353521266379001== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit On Thu, Mar 25, 2010 at 11:31 PM, Jeremy Shaw wrote: > Hello Victor, > The current version of urlt already has template haskell code for > automatically generating the url from the data type. There is an example of > that in WaiExample.hs. > I find that the TH is great when developing the application, because it > 'just works'. But when the app gets closer to release, I sometimes want to > customize the way the urls look. (for seo, etc). The nice part is that I can > just write some custom instances of PathInfo instead of deriving them, and > all of the other code just works. > Is there something more that you wanted the TH code to do? It sounds just like what I want. Where is the latest code to check it out? > > On Thu, Mar 25, 2010 at 12:11 PM, Victor Nazarov > wrote: >> >> On Thu, Mar 25, 2010 at 6:48 AM, Michael Snoyman >> wrote: >> > >> > >> > On Wed, Mar 24, 2010 at 3:36 PM, Jeremy Shaw >> > wrote: >> >> >> >> On Mon, Mar 22, 2010 at 9:41 PM, Michael Snoyman >> >> wrote: >> >>> >> >>> If I'm not mistaken, I think that addresses all the issues on the >> >>> table; >> >>> is there anything left to decide? I look forward to seeing a sample >> >>> URLT :). >> >> >> >> There were other issues that came up, but nothing exciting enough to >> >> talk >> >> about. >> >> I have pushed a patch which I think brings the code up to date in terms >> >> of >> >> functionality. See WaiExample for a detail of everything that is >> >> currently >> >> supported (aside from the happstack / hsp stuff). >> >> The next steps are to: >> >>  1. change the names of any functions or types that we do not currently >> >> like >> >>  2. add the haddock documentation >> >>  3. split the package into separate packages so that you don't have to >> >> pull in extra dependencies that you aren't going to use >> >>  4. turn the WaiExample into a literate tutorial / blog post >> >>  5. add a (simple) happstack example as well >> >> So take a look and let me know what you think. Especially in regards to >> >> #1. >> >> Then we can also look into how to extend the yesod mkResources stuff to >> >> work with this new code. >> >> from a parsing point of view, we almost don't have to do anything, we >> >> could just do: >> >>  [mkResource|  "/foo/:int/:int" = \i j -> mySite (Foo i j) |] >> >> or whatever the syntax is. But that does not solve the issue of how to >> >> go >> >> from (Foo 1 2) back to /foo/1/2 and ensure that it is the inverse >> >> operation. >> >> >> > I don't have time right now to look at the code, but I will soon (I'm in >> > the >> > middle of traveling *again*). Regarding the mkResource issue, I think >> > it's >> > slightly more complicated, and what I was thinking of was a combination >> > of >> > TemplateHaskell and QuasiQuotes to address it: >> > * The quasi-quoted content will follow mostly the same syntax, though >> > allowing you to specify the name of the constructor you wish to assign >> > to >> > each resource pattern. >> > * Since we now will need to have multiple top-level definitions being >> > generated, quasi-quoting alone won't solve the issue. So I will have a >> > quasi-quote function to convert the YAML syntax to a StringObject, and >> > then >> > a TH function to convert the StringObject to: >> >   1) A datatype for the URL. >> >   2) A pair to to/from functions. >> >   3) A dispatch function. >> > This is the point at which having WebPlug/HandleT becomes useful. >> > If that was too vague, just let me know and I'll clarify ;). >> >> Hello, everybody. >> >> I haven't been following the entire thread. But I think that typed >> URLs are great. When I started thinking about typed URLs, I thought >> about using only data type definition and dropping quosi-quotation >> entirely in favour of template haskell. I wanted to write some >> template haskell function to work on data-type declaration, it would >> use data-constructors names and arguments and build path components >> from their names. So we will need no new notation to describe >> application resources, we will never be conserned with URL generator >> and parser, we will work with our own, carefully defined data-type as >> it IS a URL. >> >> -- >> Victor Nazarov > > -- Victor Nazarov --===============4192353521266379001==-- From michael@snoyman.com Fri Mar 26 10:59:30 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Fri, 26 Mar 2010 08:30:37 -0700 Message-ID: <29bf512f1003260830n7e7434a8t6d8e385225fd4045@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7181030332112676818==" --===============7181030332112676818== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 25, 2010 at 4:25 PM, Jeremy Shaw wrote: > On Thu, Mar 25, 2010 at 12:29 PM, Michael Snoyman wrot= e: > >> OK, here are my initial code comments: >> >> * Do we want to move everything into Web.URLT? More to the point, I'm not >> sure I see the point of calling this URLT, since it doesn't really require >> any monad transformers; maybe we should call it web-routes and then the >> module would be Web.Routes? >> > > I think Web.Routes is a fine name. I'll make it happen. In the rest of this > post I refer to things by the old names, but I do intend to change the > module names and rename the package to web-routes. > > >> * I like the PathInfo class and to/fromPathSegments. Perhaps we should >> bundle that with the decode/encodePathInfo into a single module? >> > > I put PathInfo in a separate module because I am a little dubious of > classes these days. I find it a bit annoying that you can only have one > PathInfo instance per type. And I think it helps show that using PathInfo is > not actually required. But, in practice, I think having less modules is > probably a good thing in this case, since it does not affect the dependency > chain at all. Just because I *can* put every function in it's own module > doesn't mean I should. ;) Also, we probably do want people to provide > PathInfo instances, even if they don't have to.. > > I also am beginning to share a mistrust of classes; I think I went a little too overboard on them on a few previous packages (namely, convertible-text) and am now having a reaction in the opposite direction. I'm sure one day I'll find the Golden Path... > * I'd like to minimize dependencies as much as possible for the basic >> package. The two dependencies I've noticed are Consumer and >> applicative-extras. I think the type signatures would be clearer *without* >> those packages included, eg: >> >> fromPathSegments :: [String] -> Either ErrMsg a >> > > Except that is not a usable type. fromPathSegments may consume, some, but > not all of the path segments. Consider the type: > > data SiteURL =3D Foo Int Int > > fromPathSegments is going to receive the path segments: > > ["Foo","1","2"] > > If you wrote a parser by hand, you would want it to look a little something > like: > > do string "Foo" > slash > i <- fromPathSegments > slash > j <- fromPathSegments > eol > return (Foo i j) > > The key concept here is that when you call fromPathSegments to get the > first argument of Foo you need to know how many of the path segments were > consumed / are remaining, so you can pass only those segments to the second > fromPathSegments. > > So you really need a type like: > > fromPathSegments :: [String] -> (Either ErrMsg a, [String]) > > which outputs the unconsumed path segments. > > Well, given that as a criterion, I agree with the rest of your analysis entirely. However, I think we're looking at the purpose of fromPathSegments very differently. I'm not quite certain I understand why we would want to output the unconsumed segments; if something is unconsumed, then it seems like it's an invalid URL and should fail. In your example, if I request "/Foo/5/6/7", fromPathSegments would return (Right (Foo 5 6), ["7"]); but what is going to consume that 7 now? The use case I envisioned for something like this is: data BlogRoutes =3D ... data MySite =3D MyHome | MyBlog BlogRoutes fromPathSegments ("blog":rest) =3D MyBlog `fmap` fromPathSegments > But this is obviously a ripe target for a monad of some sort -- trying keep > track of the unconsumed portions by hand seems like it would asking for > trouble... > > The Consumer monad takes care of that and provides the functions you would > expect such as, next, peek, and poke. And it seems nice to be able to use > Monad, MonadPlus, Applicative, Alternative, etc, for composing > fromPathSegments into larger parsers ? > > But, perhaps there is a better choice of monad, or a better way of dealing > with the problem? Or maybe it's not really a problem? > > I think Failing is a pretty nifty data-type for dealing with errors. But > perhaps it is not a big win here.. The #1 thing that makes Failing better > than (Either [String] a) is it's Applicative instance. Specifically, Failing > will accumulate and return all the errors which have occurred, not the just > first failure (which is the behavior for Applicative (Either e)). > > So for example, let's say you are doing are trying to lookup a bunch of > keys from the query string. The key / value pairs in the query string are > typically independent of each other. So let's say you do: > > (,) <$> lookup "foo" <*> lookup "bar" > > but neither of those keys exist. With Either you will only get the error > 'could not find "foo"'. But with Failing you will get the error 'could not > find "foo". could not find "bar"'. It is nice to get a report of all the > things that are broken, instead of getting only one error at a time, fixing > it, and then getting another error, etc. > > However, I am not sure if this property is all that useful which urlt. If > you are trying to parse a url like: > > (string "Foo" *> Foo) <$> fromPathSegments <*> fromPathSegments > > And the parsing of "Foo" fails.. then there is no use in finding out if the > other segments parse ok -- because they are likely to be garbage. Maybe it > failed because it got the string "FOo" instead of "Foo", but more likely it > got something completely unrelated like, /bar/c/2.4. > > So, perhaps Either is a better choice even with out considering > dependencies... I think that Applicative / Alternative instances for Either > are only defined in transformers in the Control.Monad.Error module -- which > is a bit annoying. But we don't actually need those to implement urlt > itself. > > This brings up another detail though. > > the fromPathSegments / Consumer stuff is basically implementing a parser. > Except, unlike something like parsec, we do not keep track of the current > position for reporting errors. I wonder if we should perhaps use a slightly > richer parser environment. Within a web app, once you got your to/from > instances debugged, you will never get a parse error, so having great error > messages is not essential. But, for other people linking to your site it > could be potentially helpful. Though, it seems like the current error > messages out to be sufficient given how short the urls are.. > > I don't think fancy error reporting will help here. More to the point: we could always layer a fancy parser on top of a simpler typeclass. For that matter, the same argument can be made for Failing and Consumer. > I'm not certain what exactly the type of ErrMsg should be here; I don't >> really have a problem using [String], which would be close to the definiti= on >> of Failing. >> >> * I think it's very important to allow users to supply customized 404 >> pages. Essentially, we need to augment handleWai (possibly others) with a >> (ErrMsg -> Application) parameter. >> > > Yeah, there are (at least) two possibilities, add an extra param for the > handler. Or bubble the error up to the top: > > handleWai_1 :: (url -> String) -> (String -> Failing url) -> String -> > ([ErrorMsg] -> Application) -> ((url -> String) -> url -> Application) -> > Application > handleWai_1 fromUrl toUrl approot handleError handler =3D > \request -> > do let fUrl =3D toUrl $ stripOverlap approot $ S.unpack $ pathInfo > request > case fUrl of > (Failure errs) -> handleError errs request > (Success url) -> handler (showString approot . fromUrl) url > request > > handleWai_2 :: (url -> String) -> (String -> Failing url) -> String -> > ((url -> String) -> url -> Application) -> (Request -> IO (Failing > Response)) > handleWai_2 fromUrl toUrl approot handler =3D > \request -> > do let fUrl =3D toUrl $ stripOverlap approot $ S.unpack $ pathInfo > request > case fUrl of > (Failure errs) -> return (Failure errs) > (Success url) -> fmap Success $ handler (showString approot . > fromUrl) url request > > The second choice is perhaps more flexible. Which do you prefer? In the > first option, the handleError function could be a Maybe value -- and if you > supply Nothing you get some default 404 page? > > I personally prefer the first option exactly as you describe it, but you're also correct that the second is more flexible. If anyone else reading this thread would prefer the second, speak now or forever hold your peace ;). > In happstack we have a third possiblity. The ServerMonad is an instance of > MonadPlus so we can throw out the error message and just call mzero: > > implSite :: (Functor m, Monad m, MonadPlus m, ServerMonad m) =3D> String -> > FilePath -> Site url String (m a) -> m a > implSite domain approot siteSpec =3D > do r <- implSite_ domain approot siteSpec > case r of > (Failure _) -> mzero > (Success a) -> return a > > implSite_ :: (Functor m, Monad m, MonadPlus m, ServerMonad m) =3D> String -> > FilePath -> Site url String (m a) -> m (Failing a) > implSite_ domain approot siteSpec =3D > dirs approot $ do rq <- askRq > let pathInfo =3D intercalate "/" (rqPaths rq) > f =3D runSite (domain ++ approot) siteSpec > pathInfo > case f of > (Failure errs) -> return (Failure errs) > (Success sp) -> Success <$> (localRq (const $ rq > { rqPaths =3D [] }) sp) > > then we can do: > > msum [ implSite "domain" "approot" siteSpec > , default404 > ] > > if implSite calls mzero, then the next handler (in this case default404) is > tried. > > > >> * It might be nice to have "type WaiSite url =3D Site url String >> Application". By the way, are you certain you want to allow parameterizati= on >> over the pathInfo type? >> > > I'm not certain I don't want to allow it... I have a vague notion that I > might want to use Text sometimes instead of String. Though if I was really > committed to that then I should make toPathInfo and fromPathInfo > parameterized over pathInfo as well... So perhaps I will axe it from Site > for now. I need to change the name of that type and it's record names too I > think. > > Referring to the fear of typeclasses mentioned above: I'd like to avoid MPTCs even more so. In fact, as I look at it, each extra parameter we add creates more potential for incompatible components. For instance, I can see an argument being made to use extensible exceptions for the fromPathSegments return type, but I'd rather keep things standard with [String] than create more division. The only packages that I feel qualified to speak about then are urlt and >> urlt-wai, and my recommendation would be: >> >> urlt contains decode/encodePathInfo, PathInfo class and related functions, >> Site and related functions. If you agree on allowing the parameterization = of >> 404 errors, then also provide a default 404 error. >> > > >> urlt-wai contains WaiSite, handleWai and related functions. >> > > Yeah, that is what I was thinking. urlt would contain what is currently in; > > URLT.Base > URLT.PathInfo > URLT.HandleT > URLT.Monad > URLT.QuickCheck > > QuickCheck module does not actually depend on QuickCheck, which is nice > because QC1 vs QC2 is a big problem right now. > > It might also be nice to include: > > URLT.TH > > with depends on template-haskell. But I am not sure that depending on > template-haskell is an issue because template-haskell comes with ghc6, and > the code in URLT.TH already handles the breakage that happened with TH > 2.4. > > I have a different motive for keeping the TH code out: it seems like all of the other pieces of code should be relatively stable from early on, while the TH code (and quasi-quoting, and regular) will probably have some major changes happening for a while. It would be nice to have a consistent major release number for long periods of time on the core. > If I switch to Either instead of Failing I believe the dependencies would > be: > > base, Consumer, template-haskell, network, utf8-string > > urlt-wai would just include: > > URLT.Wai > > Sounds great. Let me know when this is available for review. If you want me to do any of the merging/renaming, I have some time now (I arrived in southern California at 3:30 in the morning...). Michael --===============7181030332112676818== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gVGh1LCBNYXIgMjUsIDIwMTAgYXQg NDoyNSBQTSwgSmVyZW15IFNoYXcgPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWlsdG86 amVyZW15QG4taGVwdGFuZS5jb20iIHRhcmdldD0iX2JsYW5rIj5qZXJlbXlAbi1oZXB0YW5lLmNv bTwvYT4mZ3Q7PC9zcGFuPiB3cm90ZTo8YnI+PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3Rl IiBzdHlsZT0ibWFyZ2luOiAwcHQgMHB0IDBwdCAwLjhleDsgYm9yZGVyLWxlZnQ6IDFweCBzb2xp ZCByZ2IoMjA0LCAyMDQsIDIwNCk7IHBhZGRpbmctbGVmdDogMWV4OyI+Cgo8ZGl2Pk9uIFRodSwg TWFyIDI1LCAyMDEwIGF0IDEyOjI5IFBNLCBNaWNoYWVsIFNub3ltYW4gPHNwYW4gZGlyPSJsdHIi PiZsdDs8YSBocmVmPSJtYWlsdG86bWljaGFlbEBzbm95bWFuLmNvbSIgdGFyZ2V0PSJfYmxhbmsi Pm1pY2hhZWxAc25veW1hbi5jb208L2E+Jmd0Ozwvc3Bhbj4gd3JvdGU6PGJyPjwvZGl2PjxkaXYg Y2xhc3M9ImdtYWlsX3F1b3RlIj48ZGl2Pgo8YmxvY2txdW90ZSBjbGFzcz0iZ21haWxfcXVvdGUi IHN0eWxlPSJtYXJnaW46IDBwdCAwcHQgMHB0IDAuOGV4OyBib3JkZXItb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GlkIHJnYigyMDQsIDIwNCwgMjA0KTsgcGFkZGlu Zy1sZWZ0OiAxZXg7Ij48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+PGRpdj48ZGl2PjwvZGl2Pjwv ZGl2PjxkaXY+SWYgSSBzd2l0Y2ggdG8gRWl0aGVyIGluc3RlYWQgb2YgRmFpbGluZyBJIGJlbGll dmUgdGhlIGRlcGVuZGVuY2llcyB3b3VsZCBiZTo8L2Rpdj4KPGRpdj48YnI+PC9kaXY+PGRpdj7C oGJhc2UsIENvbnN1bWVyLCB0ZW1wbGF0ZS1oYXNrZWxsLCBuZXR3b3JrLCB1dGY4LXN0cmluZzwv ZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+dXJsdC13YWkgd291bGQganVzdCBpbmNsdWRlOjwvZGl2 PgoKPGRpdj48YnI+PC9kaXY+PGRpdj5VUkxULldhaTwvZGl2PjxkaXY+PGJyPjwvZGl2PjwvZGl2 PjwvYmxvY2txdW90ZT48ZGl2PlNvdW5kcyBncmVhdC4gTGV0IG1lIGtub3cgd2hlbiB0aGlzIGlz IGF2YWlsYWJsZSBmb3IgcmV2aWV3LiBJZiB5b3Ugd2FudCBtZSB0byBkbyBhbnkgb2YgdGhlIG1l cmdpbmcvcmVuYW1pbmcsIEkgaGF2ZSBzb21lIHRpbWUgbm93IChJIGFycml2ZWQgaW4gc291dGhl cm4gQ2FsaWZvcm5pYSBhdCAzOjMwIGluIHRoZSBtb3JuaW5nLi4uKS48YnI+Cjxicj5NaWNoYWVs IDxicj48L2Rpdj48L2Rpdj4K --===============7181030332112676818==-- From jeremy@n-heptane.com Fri Mar 26 11:59:38 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Fri, 26 Mar 2010 11:30:46 -0500 Message-ID: In-Reply-To: <29bf512f1003260830n7e7434a8t6d8e385225fd4045@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3973604457264613222==" --===============3973604457264613222== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Fri, Mar 26, 2010 at 10:30 AM, Michael Snoyman wrote: > I also am beginning to share a mistrust of classes; I think I went a little > too overboard on them on a few previous packages (namely, convertible-text) > and am now having a reaction in the opposite direction. I'm sure one day > I'll find the Golden Path... > Sometimes I think that module functors or adga's module system might be part of the solution. But maybe only because I have not used those systems much ;) > > >> * I'd like to minimize dependencies as much as possible for the basic >>> package. The two dependencies I've noticed are Consumer and >>> applicative-extras. I think the type signatures would be clearer *without* >>> those packages included, eg: >>> >>> fromPathSegments :: [String] -> Either ErrMsg a >>> >> >> Except that is not a usable type. fromPathSegments may consume, some, but >> not all of the path segments. Consider the type: >> >> data SiteURL = Foo Int Int >> >> fromPathSegments is going to receive the path segments: >> >> ["Foo","1","2"] >> >> If you wrote a parser by hand, you would want it to look a little >> something like: >> >> do string "Foo" >> slash >> i <- fromPathSegments >> slash >> j <- fromPathSegments >> eol >> return (Foo i j) >> >> The key concept here is that when you call fromPathSegments to get the >> first argument of Foo you need to know how many of the path segments were >> consumed / are remaining, so you can pass only those segments to the second >> fromPathSegments. >> >> So you really need a type like: >> >> fromPathSegments :: [String] -> (Either ErrMsg a, [String]) >> >> which outputs the unconsumed path segments. >> >> Well, given that as a criterion, I agree with the rest of your analysis > entirely. However, I think we're looking at the purpose of fromPathSegments > very differently. I'm not quite certain I understand why we would want to > output the unconsumed segments; if something is unconsumed, then it seems > like it's an invalid URL and should fail. > > In your example, if I request "/Foo/5/6/7", fromPathSegments would return > (Right (Foo 5 6), ["7"]); but what is going to consume that 7 now? The use > case I envisioned for something like this is: > > data BlogRoutes = ... > data MySite = MyHome | MyBlog BlogRoutes > fromPathSegments ("blog":rest) = MyBlog `fmap` fromPathSegments > > But what if you had, data BlogRoutes = ... data Foo = ... data MySite = MyHome | MyBlog Foo BlogRoutes Where the MyBlog constructor has *two* arguments. In theory you want to write something like: fromPathSegments ("MyBlog":rest) = MyBlog `fmap` fromPathSegments ?? `ap` fromPathSegments ??? The first fromPathSegments will parse the 'Foo' argument and the second fromPathSegments will parse the BlogRoutes argument. To make things more interesting, let's assume that Foo and BlogRoutes were defined in 3rd party modules that don't even know about each other your app. The problem is, what arguments do you pass to each fromPathSegments call? The first call to fromPathSegments is going to consume some of the path segments, and the second call will consume the remaining. But we do not have enough information here to know in advance how to split up 'rest' between the two calls. Instead we to run the first fromPathSegments and have it tell us what part it did not consume. If what I have said still does not make sense, then try this exercise: create 3 modules, one each for: data BlogRoutes = BlogHome data Foo = Foo Int | Bar Char Int data MySite = MyBlog Foo BlogRoutes now create fromPathSegments instances for each of those routes. I think you will find that it is difficult to implement the instance for MySite. Finally, can you now change the Foo type to: data Foo = Foo Int Int | Bar Int Char Int by *only* modifying the Foo module, and without breaking the MySite module? Regarding the type: data Foo = Foo Int Int attempting to parse: "/Foo/5/6/7" I think that should be handled in, fromPathInfo :: (PathInfo u) => String -> Failing u, when it calls fromPathSegments. At that point in time we know that all the segments should have been consumed... so if there is left over junk, something is wrong. The latest version of the code is now at: http://src.seereason.com/web-routes/ I did the renaming but have not made all the other changes yet. - jeremy --===============3973604457264613222== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gRnJpLCBNYXIgMjYsIDIwMTAgYXQgMTA6MzAgQU0sIE1pY2hhZWwgU25veW1hbiA8c3BhbiBk aXI9Imx0ciI+Jmx0OzxhIGhyZWY9Im1haWx0bzptaWNoYWVsQHNub3ltYW4uY29tIj5taWNoYWVs QHNub3ltYW4uY29tPC9hPiZndDs8L3NwYW4+IHdyb3RlOjxicj48ZGl2IGNsYXNzPSJnbWFpbF9x dW90ZSI+PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0ibWFyZ2luOjAgMCAw IC44ZXg7Ym9yZGVyLWxlZnQ6MXB4ICNjY2Mgc29saWQ7cGFkZGluZy1sZWZ0OjFleDsiPgo8ZGl2 IGNsYXNzPS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hdGhJbmZv IDo6IChQYXRoSW5mbyB1KSA9Jmd0OyBTdHJpbmcgLSZndDsgRmFpbGluZyB1LCB3aGVuIGl0IGNh bGxzIGZyb21QYXRoU2VnbWVudHMuPC9kaXY+CjxkaXY+PGJyPjwvZGl2PjxkaXY+QXQgdGhhdCBw b2ludCBpbiB0aW1lIHdlIGtub3cgdGhhdCBhbGwgdGhlIHNlZ21lbnRzIHNob3VsZCBoYXZlIGJl ZW4gY29uc3VtZWQuLi4gc28gaWYgdGhlcmUgaXMgbGVmdCBvdmVyIGp1bmssIHNvbWV0aGluZyBp cyB3cm9uZy6gPC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5UaGUgbGF0ZXN0IHZlcnNpb24gb2Yg dGhlIGNvZGUgaXMgbm93IGF0OjwvZGl2Pgo8ZGl2Pjxicj48L2Rpdj48ZGl2PjxhIGhyZWY9Imh0 dHA6Ly9zcmMuc2VlcmVhc29uLmNvbS93ZWItcm91dGVzLyI+aHR0cDovL3NyYy5zZWVyZWFzb24u Y29tL3dlYi1yb3V0ZXMvPC9hPjwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+SSBkaWQgdGhlIHJl bmFtaW5nIGJ1dCBoYXZlIG5vdCBtYWRlIGFsbCB0aGUgb3RoZXIgY2hhbmdlcyB5ZXQuPC9kaXY+ PGRpdj48YnI+PC9kaXY+PGRpdj4KLSBqZXJlbXk8L2Rpdj48L2Rpdj4K --===============3973604457264613222==-- From jeremy@n-heptane.com Fri Mar 26 12:00:43 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Fri, 26 Mar 2010 11:31:51 -0500 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8299052060257971860==" --===============8299052060257971860== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The latest version of the code is now at: http://src.seereason.com/web-routes/ - jeremy On Fri, Mar 26, 2010 at 5:36 AM, Victor Nazarov wrote: > On Thu, Mar 25, 2010 at 11:31 PM, Jeremy Shaw > wrote: > > Hello Victor, > > The current version of urlt already has template haskell code for > > automatically generating the url from the data type. There is an example > of > > that in WaiExample.hs. > > I find that the TH is great when developing the application, because it > > 'just works'. But when the app gets closer to release, I sometimes want > to > > customize the way the urls look. (for seo, etc). The nice part is that I > can > > just write some custom instances of PathInfo instead of deriving them, > and > > all of the other code just works. > > Is there something more that you wanted the TH code to do? > > It sounds just like what I want. Where is the latest code to check it out? > > > > > On Thu, Mar 25, 2010 at 12:11 PM, Victor Nazarov < > asviraspossible@gmail.com> > > wrote: > >> > >> On Thu, Mar 25, 2010 at 6:48 AM, Michael Snoyman > >> wrote: > >> > > >> > > >> > On Wed, Mar 24, 2010 at 3:36 PM, Jeremy Shaw > >> > wrote: > >> >> > >> >> On Mon, Mar 22, 2010 at 9:41 PM, Michael Snoyman < > michael@snoyman.com> > >> >> wrote: > >> >>> > >> >>> If I'm not mistaken, I think that addresses all the issues on the > >> >>> table; > >> >>> is there anything left to decide? I look forward to seeing a sample > >> >>> URLT :). > >> >> > >> >> There were other issues that came up, but nothing exciting enough to > >> >> talk > >> >> about. > >> >> I have pushed a patch which I think brings the code up to date in > terms > >> >> of > >> >> functionality. See WaiExample for a detail of everything that is > >> >> currently > >> >> supported (aside from the happstack / hsp stuff). > >> >> The next steps are to: > >> >> 1. change the names of any functions or types that we do not > currently > >> >> like > >> >> 2. add the haddock documentation > >> >> 3. split the package into separate packages so that you don't have > to > >> >> pull in extra dependencies that you aren't going to use > >> >> 4. turn the WaiExample into a literate tutorial / blog post > >> >> 5. add a (simple) happstack example as well > >> >> So take a look and let me know what you think. Especially in regards > to > >> >> #1. > >> >> Then we can also look into how to extend the yesod mkResources stuff > to > >> >> work with this new code. > >> >> from a parsing point of view, we almost don't have to do anything, we > >> >> could just do: > >> >> [mkResource| "/foo/:int/:int" = \i j -> mySite (Foo i j) |] > >> >> or whatever the syntax is. But that does not solve the issue of how > to > >> >> go > >> >> from (Foo 1 2) back to /foo/1/2 and ensure that it is the inverse > >> >> operation. > >> >> > >> > I don't have time right now to look at the code, but I will soon (I'm > in > >> > the > >> > middle of traveling *again*). Regarding the mkResource issue, I think > >> > it's > >> > slightly more complicated, and what I was thinking of was a > combination > >> > of > >> > TemplateHaskell and QuasiQuotes to address it: > >> > * The quasi-quoted content will follow mostly the same syntax, though > >> > allowing you to specify the name of the constructor you wish to assign > >> > to > >> > each resource pattern. > >> > * Since we now will need to have multiple top-level definitions being > >> > generated, quasi-quoting alone won't solve the issue. So I will have a > >> > quasi-quote function to convert the YAML syntax to a StringObject, and > >> > then > >> > a TH function to convert the StringObject to: > >> > 1) A datatype for the URL. > >> > 2) A pair to to/from functions. > >> > 3) A dispatch function. > >> > This is the point at which having WebPlug/HandleT becomes useful. > >> > If that was too vague, just let me know and I'll clarify ;). > >> > >> Hello, everybody. > >> > >> I haven't been following the entire thread. But I think that typed > >> URLs are great. When I started thinking about typed URLs, I thought > >> about using only data type definition and dropping quosi-quotation > >> entirely in favour of template haskell. I wanted to write some > >> template haskell function to work on data-type declaration, it would > >> use data-constructors names and arguments and build path components > >> from their names. So we will need no new notation to describe > >> application resources, we will never be conserned with URL generator > >> and parser, we will work with our own, carefully defined data-type as > >> it IS a URL. > >> > >> -- > >> Victor Nazarov > > > > > > > > -- > Victor Nazarov > --===============8299052060257971860== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdj5UaGUgbGF0ZXN0IHZlcnNpb24gb2YgdGhlIGNvZGUgaXMgbm93IGF0OjwvZGl2PjxkaXY+ PGJyPjwvZGl2PjxkaXY+PGEgaHJlZj0iaHR0cDovL3NyYy5zZWVyZWFzb24uY29tL3dlYi1yb3V0 ZXMvIj5odHRwOi8vc3JjLnNlZXJlYXNvbi5jb20vd2ViLXJvdXRlcy88L2E+PC9kaXY+PGRpdj48 YnI+PC9kaXY+PGRpdj4tIGplcmVteTwvZGl2Pjxicj48ZGl2I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OyAtLTxicj4KJmd0OyZndDsgVmljdG9y IE5hemFyb3Y8YnI+CiZndDs8YnI+CiZndDs8YnI+Cjxicj4KPGJyPgo8YnI+CjwvZGl2PjwvZGl2 Pi0tPGJyPgo8Zm9udCBjb2xvcj0iIzg4ODg4OCI+VmljdG9yIE5hemFyb3Y8YnI+CjwvZm9udD48 L2Jsb2NrcXVvdGU+PC9kaXY+PGJyPgo= --===============8299052060257971860==-- From chris@eidhof.nl Fri Mar 26 16:40:58 2010 From: Chris Eidhof To: web-devel@haskell.org Subject: [web-devel] Using a 'real' parser for URL parsing Date: Fri, 26 Mar 2010 22:11:59 +0100 Message-ID: <7DE0DCB3-DD36-4ABF-A37D-53E2EDF0DAE5@eidhof.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4993003654048605968==" --===============4993003654048605968== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hey, I've added a darcs patch (I hope it worked, I'm a darcs newbie) to switch the= URL parser to parsec. This simplifies the code a lot. I've used String's (i.= e. the URL path components) as tokens for the parser. What do you guys think? I'm sorry I haven't been replying to the type-safe URL handling, I was busy w= ith writing this week. The discussion has become quite large! I'll see if I c= an catch up somewhere this weekend. -chris --===============4993003654048605968== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGh0bWw+PGhlYWQ+PC9oZWFkPjxib2R5IHN0eWxlPSJ3b3JkLXdyYXA6IGJyZWFrLXdvcmQ7IC13 ZWJraXQtbmJzcC1tb2RlOiBzcGFjZTsgLXdlYmtpdC1saW5lLWJyZWFrOiBhZnRlci13aGl0ZS1z cGFjZTsgIj48ZGl2PjxkaXYgc3R5bGU9Im1hcmdpbi10b3A6IDBweDsgbWFyZ2luLXJpZ2h0OiAw cHg7IG1hcmdpbi1ib3R0b206IDBweDsgbWFyZ2luLWxlZnQ6IDBweDsgZm9udDogbm9ybWFsIG5v cm1hbCBub3JtYWwgMTJweC9ub3JtYWw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C9kaXY+PC9kaXY+PC9ib2R5PjwvaHRtbD4= --===============4993003654048605968== Content-Type: application/x-apple-msg-attachment Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="parsec.patch" MIME-Version: 1.0 MSBwYXRjaCBmb3IgcmVwb3NpdG9yeSBodHRwOi8vc3JjLnNlZXJlYXNvbi5jb20vdXJsdDoKCkZy aSBNYXIgMjYgMjI6MDA6MjggQ0VUIDIwMTAgIGNocmlzQGVpZGhvZi5ubAogICogUGFyc2luZyBV UkxzIHVzaW5nIHBhcnNlciBjb21iaW5hdG9ycwogIAogIFRoaXMgcGF0Y2ggdXNlcyBQYXJzZWMg dG8gcGFyc2UgVVJMcy4gSXQgc2ltcGxpZmllcyB0aGUgcGFyc2VyIGEgbG90LCBiZWNhdXNlIHdl CiAgZ2V0IGF1dG9tYXRpYyBwYXJzZXIgc3RhdGUgYW5kIGVycm9yIGhhbmRsaW5nIGNhcGFiaWxp dGllcy4KCk5ldyBwYXRjaGVzOgoKW1BhcnNpbmcgVVJMcyB1c2luZyBwYXJzZXIgY29tYmluYXRv cnMKY2hyaXNAZWlkaG9mLm5sKioyMDEwMDMyNjIxMDAyOAogSWdub3JlLXRoaXM6IDM4NmQzMWQ1 MzZlMDM2ZTAxYjZhMjdhNTM4YWU3ZDI3CiAKIFRoaXMgcGF0Y2ggdXNlcyBQYXJzZWMgdG8gcGFy c2UgVVJMcy4gSXQgc2ltcGxpZmllcyB0aGUgcGFyc2VyIGEgbG90LCBiZWNhdXNlIHdlCiBnZXQg YXV0b21hdGljIHBhcnNlciBzdGF0ZSBhbmQgZXJyb3IgaGFuZGxpbmcgY2FwYWJpbGl0aWVzLgpd IHsKaHVuayAuL1VSTFQvUGF0aEluZm8uaHMgMTAKIGltcG9ydCBEYXRhLkxpc3QgKHN0cmlwUHJl Zml4LCB0YWlscykKIGltcG9ydCBEYXRhLk1heWJlIChmcm9tSnVzdCkKIGltcG9ydCBVUkxULkJh c2UgKGRlY29kZVBhdGhJbmZvLC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QotICAgZ2Zy b21QYXRoU2VnbWVudHMgPSAKLSAgICAgbGV0IHVybExlZnQgID0gZm1hcCAoZm1hcCBMKSAkIGdm cm9tUGF0aFNlZ21lbnRzCi0gICAgICAgICB1cmxSaWdodCA9IGZtYXAgKGZtYXAgUikgJCBnZnJv bVBhdGhTZWdtZW50cwotICAgICBpbiB1cmxMZWZ0IGBjb21iaW5lYCB1cmxSaWdodAotICAgICAg ICAgICAgICAgIHdoZXJlCi0gICAgICAgICAgICAgICAgICBjb21iaW5lIDo6IENvbnN1bWVyIFN0 cmluZyAoRmFpbGluZyBhKSAtPiBDb25zdW1lciBTdHJpbmcgKEZhaWxpbmcgYSkgLT4gQ29uc3Vt ZXIgU3RyaW5nIChGYWlsaW5nIGEpCi0gICAgICAgICAgICAgICAgICBjb21iaW5lIChDb25zdW1l ciBmKSAoQ29uc3VtZXIgZykgPQotICAgICAgICAgICAgICAgICAgICBDb25zdW1lciAkIFxjIC0+ Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgZiBjIG9mCi0gICAgICAgICAgICAgICAgICAgICAg ckAoU3VjY2VzcyBhLCBfKSAtPiByCi0gICAgICAgICAgICAgICAgICAgICAgKEZhaWx1cmUgZXJy czEsIF8pIC0+Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGcgYyBvZgotICAgICAgICAg ICAgICAgICAgICAgICAgICByQChTdWNjZXNzIGEsIF8pIC0+IHIKLSAgICAgICAgICAgICAgICAg ICAgICAgICAgKEZhaWx1cmUgZXJyczIsIF8pIC0+IChGYWlsdXJlIChlcnJzMSArKyBlcnJzMiks IGMpCisgICBnZnJvbVBhdGhTZWdtZW50cyA9IHRyeSAoTCA8JD4gZ2Zyb21QYXRoU2VnbWVudHMp IDx8PiAoUiA8JD4gZ2Zyb21QYXRoU2VnbWVudHMpCiAgICAgICAgICAgICAgICAgICAgICAgICAg IAogaW5zdGFuY2UgKEdUb1VSTCBmLCBHVG9VUkwgZykgPT4gR1RvVVJMIChmIDoq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hlcHRhbmUu Y29tKioyMDA4MDMyMTAwMjAxMF0gCltpbmNsdWRlIFlvdXJHYWxsZXJ5IHRvIHNob3cgdGhhdCB0 aGUgbGlua3MgZ2VuZXJhdGVkIGJ5IGVhY2ggR2FsbGVyeSBhcmUgdW5pcXVlCmplcmVteUBuLWhl cHRhbmUuY29tKioyMDA4MDMyMTAwMTQ1OF0gCltjb21tZW50IG91dCAuY3NzIGxpbmsgZm9yIG5v dwpqZXJlbXlAbi1oZXB0YW5lLmNvbSoqMjAwODAzMjEwMDEyMjVdIApbdXNlIFN0YXRlIG1vbmFk IGluc3RlYWQgb2YgQ29uc3VtZXIgbW9uYWQsIHNpbmNlIHBlb3BsZSBwcm9iYWJseSBkbyBub3Qg aGF2ZSB0aGUgQ29uc3VtZXIgbW9uYWQgcGFja2FnZSBpbnN0YWxsZWQKamVyZW15QG4taGVwdGFu ZS5jb20qKjIwMDgwMzIwMjM0OTM1XSAKW2F0dGVtcHQgdG8gZ2VuZXJhbGl6ZSBoYW5kbGVVUkwg YSBiaXQuIE1ha2UgcHJldHR5IHVybFNob3cgYW5kIHVybFJlYWQgZnVuY3Rpb25zCmplcmVteUBu LWhlcHRhbmUuY29tKioyMDA4MDMyMDIyMDYzMF0gClthZGRlZCBIQXBwUyBleGFtcGxlCmplcmVt eUBuLWhlcHRhbmUuY29tKioyMDA4MDMxOTA0NDExOF0gClthIHNpbXBsZSBtZWNoYW5pc20gZm9y IHR5cGUtc2FmZSB1cmxzCmplcmVteUBuLWhlcHRhbmUuY29tKioyMDA4MDMxOTAxMjgyM10gClBh dGNoIGJ1bmRsZSBoYXNoOgpkNWJhMmI1ZTRkMGRhOGQzMDg2OWFiOWY2ZmFlODdlMzg2NWNjM2Iz Cg== --===============4993003654048605968== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGh0bWw+PGhlYWQ+PC9oZWFkPjxib2R5IHN0eWxlPSJ3b3JkLXdyYXA6IGJyZWFrLXdvcmQ7IC13 ZWJraXQtbmJzcC1tb2RlOiBzcGFjZTsgLXdlYmtpdC1saW5lLWJyZWFrOiBhZnRlci13aGl0ZS1z cGFjZTsgIj48ZGl2PjxkaXYgc3R5bGU9Im1hcmdpbi10b3A6IDBweDsgbWFyZ2luLXJpZ2h0OiAw cHg7IG1hcmdpbi1ib3R0b206IDBweDsgbWFyZ2luLWxlZnQ6IDBweDsgIj48L2Rpdj48L2Rpdj48 L2JvZHk+PC9odG1sPg== --===============4993003654048605968==-- From jeremy@n-heptane.com Fri Mar 26 17:33:15 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: [web-devel] Re: Using a 'real' parser for URL parsing Date: Fri, 26 Mar 2010 17:04:23 -0500 Message-ID: In-Reply-To: <7DE0DCB3-DD36-4ABF-A37D-53E2EDF0DAE5@eidhof.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5321653152031141093==" --===============5321653152031141093== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hello, Is there some clean way to implement a function like: c2s :: GenParser Char () a -> GenParser String () a so that we can use Char parsers inside the URL Parser? the trivial implementation would be something like: http://moonpatio.com:8080/fastcgi/hpaste.fcgi/view?id=8965#a8965 but that does not do a very good job of reporting the position of parse errors. - jeremy On Fri, Mar 26, 2010 at 4:11 PM, Chris Eidhof wrote: > Hey, > > I've added a darcs patch (I hope it worked, I'm a darcs newbie) to switch > the URL parser to parsec. This simplifies the code a lot. I've used String's > (i.e. the URL path components) as tokens for the parser. What do you guys > think? > > I'm sorry I haven't been replying to the type-safe URL handling, I was busy > with writing this week. The discussion has become quite large! I'll see if I > can catch up somewhere this weekend. > > -chris > > > --===============5321653152031141093== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SGVsbG8sPGRpdj48YnI+PC9kaXY+PGRpdj5JcyB0aGVyZSBzb21lIGNsZWFuIHdheSB0byBpbXBs ZW1lbnQgYSBmdW5jd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QiPjxkaXY+PGRpdiBzdHlsZT0ibWFyZ2luLXRvcDow cHg7bWFyZ2luLXJpZ2h0OjBweDttYXJnaW4tYm90dG9tOjBweDttYXJnaW4tbGVmdDowcHgiPjwv ZGl2PjwvZGl2PjwvZGl2Pjxicj48L2Jsb2NrcXVvdGU+PC9kaXY+PGJyPjwvZGl2Pgo= --===============5321653152031141093==-- From jeremy@n-heptane.com Fri Mar 26 17:35:42 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: [web-devel] Re: Using a 'real' parser for URL parsing Date: Fri, 26 Mar 2010 17:06:50 -0500 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0135393440168563007==" --===============0135393440168563007== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Also, I decide to merge your patch into the latest code base to make discussion easier. The urlt code now lives here: http://src.seereason.com/web-routes A, darcs pull http://src.seereason.com/web-routes, in the old urlt directory should get you updated. - jeremy On Fri, Mar 26, 2010 at 5:04 PM, Jeremy Shaw wrote: > Hello, > > Is there some clean way to implement a function like: > > c2s :: GenParser Char () a -> GenParser String () a > > so that we can use Char parsers inside the URL Parser? > > the trivial implementation would be something like: > > http://moonpatio.com:8080/fastcgi/hpaste.fcgi/view?id=3D8965#a8965 > > but that does not do a very good job of reporting the position of parse > errors. > > - jeremy > > On Fri, Mar 26, 2010 at 4:11 PM, Chris Eidhof wrote: > >> Hey, >> >> I've added a darcs patch (I hope it worked, I'm a darcs newbie) to switch >> the URL parser to parsec. This simplifies the code a lot. I've used String= 's >> (i.e. the URL path components) as tokens for the parser. What do you guys >> think? >> >> I'm sorry I haven't been replying to the type-safe URL handling, I was >> busy with writing this week. The discussion has become quite large! I'll s= ee >> if I can catch up somewhere this weekend. >> >> -chris >> >> >> > --===============0135393440168563007== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 QWxzbywgSSBkZWNpZGUgdG8gbWVyZ2UgeW91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pczwvZm9udD48L2Rpdj48L2ZvbnQ+ PC9kaXY+CgoKPC9kaXY+PGJyPjxkaXYgc3R5bGU9IndvcmQtd3JhcDpicmVhay13b3JkIj48ZGl2 PjxkaXYgc3R5bGU9Im1hcmdpbi10b3A6MHB4O21hcmdpbi1yaWdodDowcHg7bWFyZ2luLWJvdHRv bTowcHg7bWFyZ2luLWxlZnQ6MHB4Ij48L2Rpdj48L2Rpdj48L2Rpdj48YnI+PC9ibG9ja3F1b3Rl PjwvZGl2Pjxicj48L2Rpdj4KPC9kaXY+PC9kaXY+PC9ibG9ja3F1b3RlPjwvZGl2Pjxicj48L2Rp dj4K --===============0135393440168563007==-- From michael@snoyman.com Fri Mar 26 17:42:05 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Fri, 26 Mar 2010 15:13:13 -0700 Message-ID: <29bf512f1003261513x7574bd85j6eeeded55aac0d73@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5554461333699861084==" --===============5554461333699861084== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Fri, Mar 26, 2010 at 9:30 AM, Jeremy Shaw wrote: > On Fri, Mar 26, 2010 at 10:30 AM, Michael Snoyman wrot= e: > >> Well, given that as a criterion, I agree with the rest of your analysis >> entirely. However, I think we're looking at the purpose of fromPathSegments >> very differently. I'm not quite certain I understand why we would want to >> output the unconsumed segments; if something is unconsumed, then it seems >> like it's an invalid URL and should fail. >> >> In your example, if I request "/Foo/5/6/7", fromPathSegments would return >> (Right (Foo 5 6), ["7"]); but what is going to consume that 7 now? The use >> case I envisioned for something like this is: >> >> data BlogRoutes =3D ... >> data MySite =3D MyHome | MyBlog BlogRoutes >> fromPathSegments ("blog":rest) =3D MyBlog `fmap` fromPathSegments >> >> > But what if you had, > > data BlogRoutes =3D ... > data Foo =3D ... > data MySite =3D MyHome | MyBlog Foo BlogRoutes > > Where the MyBlog constructor has *two* arguments. In theory you want to > write something like: > > fromPathSegments ("MyBlog":rest) =3D MyBlog `fmap` fromPathSegments ?? `ap` > fromPathSegments ??? > > The first fromPathSegments will parse the 'Foo' argument and the second > fromPathSegments will parse the BlogRoutes argument. To make things more > interesting, let's assume that Foo and BlogRoutes were defined in 3rd party > modules that don't even know about each other your app. > > The problem is, what arguments do you pass to each fromPathSegments call? > The first call to fromPathSegments is going to consume some of the path > segments, and the second call will consume the remaining. But we do not have > enough information here to know in advance how to split up 'rest' between > the two calls. Instead we to run the first fromPathSegments and have it tell > us what part it did not consume. > > If what I have said still does not make sense, then try this exercise: > > create 3 modules, one each for: > > data BlogRoutes =3D BlogHome > data Foo =3D Foo Int | Bar Char Int > data MySite =3D MyBlog Foo BlogRoutes > > now create fromPathSegments instances for each of those routes. I think you > will find that it is difficult to implement the instance for MySite. > Finally, can you now change the Foo type to: > > data Foo =3D Foo Int Int | Bar Int Char Int > > by *only* modifying the Foo module, and without breaking the MySite module? > > Regarding the type: > > data Foo =3D Foo Int Int > > attempting to parse: > > "/Foo/5/6/7" > > I think that should be handled in, fromPathInfo :: (PathInfo u) =3D> String > -> Failing u, when it calls fromPathSegments. > > At that point in time we know that all the segments should have been > consumed... so if there is left over junk, something is wrong. > > The latest version of the code is now at: > > http://src.seereason.com/web-routes/ > > I did the renaming but have not made all the other changes yet. > > - jeremy > Can you give me any real-world examples where you would have URL routes built up like that? It seems like this is an optimization for the abnormal case. Michael --===============5554461333699861084== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gRnJpLCBNYXIgMjYsIDIwMTAgYXQg OTozMCBBTSwgSmVyZW15IFNoYXcgPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWlsdG86 amVyZW15QG4taGVwdGFuZS5jb20iIHRhcmdldD0iX2JsYW5rIj5qZXJlbXlAbi1oZXB0YW5lLmNv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d2ViLXJvdXRlcy88L2E+PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5J IGRpZCB0aGUgcmVuYW1pbmcgYnV0IGhhdmUgbm90IG1hZGUgYWxsIHRoZSBvdGhlciBjaGFuZ2Vz IHlldC48L2Rpdj48ZGl2PgoKPGJyPjwvZGl2Pjxmb250IGNvbG9yPSIjODg4ODg4Ij48ZGl2Pgot IGplcmVteTwvZGl2PjwvZm9udD48L2Rpdj4KPC9ibG9ja3F1b3RlPjwvZGl2Pjxicj5DYW4geW91 IGdpdmUgbWUgYW55IHJlYWwtd29ybGQgZXhhbXBsZXMgd2hlcmUgeW91IHdvdWxkIGhhdmUgVVJM IHJvdXRlcyBidWlsdCB1cCBsaWtlIHRoYXQ/IEl0IHNlZW1zIGxpa2UgdGhpcyBpcyBhbiBvcHRp bWl6YXRpb24gZm9yIHRoZSBhYm5vcm1hbCBjYXNlLjxicj48YnI+TWljaGFlbDxicj4K --===============5554461333699861084==-- From jeremy@n-heptane.com Fri Mar 26 18:13:44 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Fri, 26 Mar 2010 17:44:52 -0500 Message-ID: In-Reply-To: <29bf512f1003261513x7574bd85j6eeeded55aac0d73@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0742570780211154086==" --===============0742570780211154086== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Fri, Mar 26, 2010 at 5:13 PM, Michael Snoyman wrote: > > Can you give me any real-world examples where you would have URL routes > built up like that? It seems like this is an optimization for the abnormal > case. I am not sure I would consider it an 'optimization' -- with out this change the desired behavior can not be expressed as far as I can tell. Off the top of my head, I have the following type in my image gallery library: data GalleryCommon = ViewImage ImageId [Transform] deriving (Eq, Ord, Show, Read, Data, Typeable) The ImageId and Transform properties are used in other url components (not shown here). They have PathInfo instances already. The Template Haskell or Regular libraries would generate a parser that looks a bit like: fromPathSegments = (string "ViewImage" *> ViewImage) <$> fromPathSegments <*> fromPathSegments Without the changes to the type, the TH code would not be able to reuse the existing PathInfo ImageId instance, but would instead be forced to handle the ImageId argument explicitly.. That is really unfortunate, because the path generated by the PathInfo ImageId instance is much cleaner than what TH would generate. It seems to me that the primary purpose of the PathInfo class is to allow you to build composable parsers / generates for urls. It seems odd to limit the composableness to only the last argument of a constructor.. - jeremy --===============0742570780211154086== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gRnJpLCBNYXIgMjYsIDIwMTAgYXQgNToxMyBQTSwgTWljaGFlbCBTbm95bWFuIDxzcGFuIGRp cj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFpbHRvOm1pY2hhZWxAc25veW1hbi5jb20iPm1pY2hhZWxA c25veW1hbi5jb208L2E+Jmd0Ozwvc3Bhbj4gd3JvdGU6PGJyPjxkaXYgY2xhc3M9ImdtYWlsX3F1 b3RlIj48YmxvY2txdW90ZSBjbGFzcz0iZ21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46MCAwIDAg LjhleDtib3JkZXItbGVmdDoxcHggI2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4OyI+Cjxicj5D YW4geW91IGdpdmUgbWUgYW55IHJlYWwtd29ybGQgZXhhbXBsZXMgd2hlcmUgeW91IHdvdWxkIGhh dmUgVVJMIHJvdXRlcyBidWlsdCB1cCBsaWtlIHRoYXQ/IEl0IHNlZW1zIGxpa2UgdGhpcyBpcyBh biBvcHRpbWl6YXRpb24gZm9yIHRoZSBhYm5vcm1hbCBjYXNlLjwvYmxvY2txdW90ZT48ZGl2Pjxi cj48L2Rpdj48ZGl2PkkgYW0gbm90IHN1cmUgSSB3b3VsZCBjb25zaWRlciBpdCBhbiAmIzM5O29w dGltaXphdGlvbiYjMzk7IC0tIHdpdGggb3V0IHRoaXMgY2hhbmdlIHRoZSBkZXNpcmVkIKBiZWhh dmlvciBjYW4gbm90IGJlIGV4cHJlc3NlZ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sZSB0byByZXVzZSB0aGUgZXhpc3RpbmcgUGF0aEluZm8gSW1hZ2VJZCBpbnN0 YW5jZSwgYnV0IHdvdWxkIGluc3RlYWQgYmUgZm9yY2VkIHRvIGhhbmRsZSB0aGUgSW1hZ2VJZCBh cmd1bWVudCBleHBsaWNpdGx5Li4gVGhhdCBpcyByZWFsbHkgdW5mb3J0dW5hdGUsIGJlY2F1c2Ug dGhlIHBhdGggZ2VuZXJhdGVkIGJ5IHRoZSBQYXRoSW5mbyBJbWFnZUlkIGluc3RhbmNlIGlzIG11 Y2ggY2xlYW5lciB0aGFuIHdoYXQgVEggd291bGQgZ2VuZXJhdGUuPC9kaXY+CjxkaXY+PGJyPjwv ZGl2PjxkaXY+SXQgc2VlbXMgdG8gbWUgdGhhdCB0aGUgcHJpbWFyeSBwdXJwb3NlIG9mIHRoZSBQ YXRoSW5mbyBjbGFzcyBpcyB0byBhbGxvdyB5b3UgdG8gYnVpbGQgY29tcG9zYWJsZSBwYXJzZXJz IC8gZ2VuZXJhdGVzIGZvciB1cmxzLiBJdCBzZWVtcyBvZGQgdG8gbGltaXQgdGhlIGNvbXBvc2Fi bGVuZXNzIHRvIG9ubHkgdGhlIGxhc3QgYXJndW1lbnQgb2YgYSBjb25zdHJ1Y3Rvci4uPC9kaXY+ CjxkaXY+PGJyPjwvZGl2PjxkaXY+LSBqZXJlbXk8L2Rpdj48L2Rpdj48L2Rpdj4K --===============0742570780211154086==-- From jeremy@n-heptane.com Fri Mar 26 18:30:48 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Fri, 26 Mar 2010 18:01:57 -0500 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1898434731749832417==" --===============1898434731749832417== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit A variation which is more obviously hierarchical in nature: data User = User LastName FirstName data Section = Recent | TopRated data UserHomeURL = Wall Section | Profile data UserURL = ViewHome User UserHome Which would be used to construct urls like: /shaw/jeremy/wall/recent /snoyman/michael/profile etc.. - jeremy On Fri, Mar 26, 2010 at 5:44 PM, Jeremy Shaw wrote: > On Fri, Mar 26, 2010 at 5:13 PM, Michael Snoyman wrote: > >> >> Can you give me any real-world examples where you would have URL routes >> built up like that? It seems like this is an optimization for the abnormal >> case. > > > I am not sure I would consider it an 'optimization' -- with out this change > the desired behavior can not be expressed as far as I can tell. > > Off the top of my head, I have the following type in my image gallery > library: > > data GalleryCommon > = ViewImage ImageId [Transform] > deriving (Eq, Ord, Show, Read, Data, Typeable) > > The ImageId and Transform properties are used in other url components (not > shown here). They have PathInfo instances already. > > The Template Haskell or Regular libraries would generate a parser that > looks a bit like: > > fromPathSegments = (string "ViewImage" *> ViewImage) <$> fromPathSegments > <*> fromPathSegments > > Without the changes to the type, the TH code would not be able to reuse the > existing PathInfo ImageId instance, but would instead be forced to handle > the ImageId argument explicitly.. That is really unfortunate, because the > path generated by the PathInfo ImageId instance is much cleaner than what TH > would generate. > > It seems to me that the primary purpose of the PathInfo class is to allow > you to build composable parsers / generates for urls. It seems odd to limit > the composableness to only the last argument of a constructor.. > > - jeremy > --===============1898434731749832417== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 QSB2YXJpYXRpb24gd2hpY2ggaXMgbW9yZSBvYnZpb3VzbHkgaGllcmFyY2hpY2FsIGluIG5hdHVy ZTo8ZGl2Pjxicj48L2Rpdj48ZGl2PmRhdGEgVXNlciA9IFVzZXIgTGFzdE5hbWUgRmlyc3ROYW1l PC9kaXY+PGRpdj5kYXRhIFNlY3Rpb24gPSBSZWNlbnQgfCBUb3BSYXRlZDwvZGl2PjxkaXY+ZGF0 YSBVc2VySG9tZVVSTCA9IFdhbGwgU2VjdGlvbiB8IFByb2ZpbGU8L2Rpdj48ZGl2PmRhdGEgVXNl clVSTCA9IFZpZXdIb21lIFVzZXIgVXNlckhvbWU8L2Rpdj4KPGRpdj48YnI+P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BhbGxvdyB5b3UgdG8gYnVpbGQgY29t cG9zYWJsZSBwYXJzZXJzIC8gZ2VuZXJhdGVzIGZvciB1cmxzLiBJdCBzZWVtcyBvZGQgdG8gbGlt aXQgdGhlIGNvbXBvc2FibGVuZXNzIHRvIG9ubHkgdGhlIGxhc3QgYXJndW1lbnQgb2YgYSBjb25z dHJ1Y3Rvci4uPC9kaXY+Cgo8ZGl2Pjxicj48L2Rpdj48Zm9udCBjb2xvcj0iIzg4ODg4OCI+PGRp dj4tIGplcmVteTwvZGl2PjwvZm9udD48L2Rpdj48L2Rpdj4KPC9ibG9ja3F1b3RlPjwvZGl2Pjxi cj48L2Rpdj48L2Rpdj4K --===============1898434731749832417==-- From chris@eidhof.nl Sat Mar 27 09:46:17 2010 From: Chris Eidhof To: web-devel@haskell.org Subject: [web-devel] Re: Using a 'real' parser for URL parsing Date: Sat, 27 Mar 2010 15:17:24 +0100 Message-ID: <2A55C290-7586-47E5-B5A2-D7079AA65EA7@eidhof.nl> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0881346560640234602==" --===============0881346560640234602== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable There's probably a better way, but I guess I would write it in a similar way. -chris On 26 mrt 2010, at 23:04, Jeremy Shaw wrote: > Hello, >=20 > Is there some clean way to implement a function like: >=20 > c2s :: GenParser Char () a -> GenParser String () a >=20 > so that we can use Char parsers inside the URL Parser? >=20 > the trivial implementation would be something like: >=20 > http://moonpatio.com:8080/fastcgi/hpaste.fcgi/view?id=3D8965#a8965 >=20 > but that does not do a very good job of reporting the position of parse err= ors. >=20 > - jeremy >=20 > On Fri, Mar 26, 2010 at 4:11 PM, Chris Eidhof wrote: > Hey, >=20 > I've added a darcs patch (I hope it worked, I'm a darcs newbie) to switch t= he URL parser to parsec. This simplifies the code a lot. I've used String's (= i.e. the URL path components) as tokens for the parser. What do you guys thin= k? >=20 > I'm sorry I haven't been replying to the type-safe URL handling, I was busy= with writing this week. The discussion has become quite large! I'll see if I= can catch up somewhere this weekend. >=20 > -chris >=20 >=20 >=20 --===============0881346560640234602==-- From jeremy@n-heptane.com Sat Mar 27 21:55:37 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: [web-devel] Re: Using a 'real' parser for URL parsing Date: Sat, 27 Mar 2010 21:26:50 -0500 Message-ID: In-Reply-To: <2A55C290-7586-47E5-B5A2-D7079AA65EA7@eidhof.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4797490316856777253==" --===============4797490316856777253== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Ok, I pushed some patches to PathInfo for the parsec stuff. It now requires parsec 3.1.0 (which is sort of a problem, but oh well). I change the pToken function so that it tracks the error position better, and updated showParseError to use that information better. I also added a function: p2u :: Parser a -> URLParser a so now if you write: test :: IO () test = let segments = ["foo", "hi", "there", "world"] in case parse testp (show segments) segments of (Left e) -> putStrLn $ showParseError e (Right r) -> print r testp :: URLParser (Char, String, String) testp = do segment "foo" st <- p2u (char 'h' >> char 'o') sg <- anySegment sg' <- anySegment return (st,sg, sg') You will get: *Web.Routes.PathInfo> test ["foo","hi","there","world"] (segment 2 character 2): unexpected "i" expecting "o" *Web.Routes.PathInfo> This seems nice? The error tells you the segment and character offset in the segment, and you can embed normal parsers from Text.Parsec.Char into the parent parser and the errors in the Char parser give the correct character offset. One unresolved issue is if the sub-parser passed to p2u should be required to consume the entire segment or not. I am thinking that it should be required to consume the entire segment -- though the current code does not work that way. - jeremy On Sat, Mar 27, 2010 at 9:17 AM, Chris Eidhof wrote: > There's probably a better way, but I guess I would write it in a similar > way. > > -chris > > On 26 mrt 2010, at 23:04, Jeremy Shaw wrote: > > > Hello, > > > > Is there some clean way to implement a function like: > > > > c2s :: GenParser Char () a -> GenParser String () a > > > > so that we can use Char parsers inside the URL Parser? > > > > the trivial implementation would be something like: > > > > http://moonpatio.com:8080/fastcgi/hpaste.fcgi/view?id=8965#a8965 > > > > but that does not do a very good job of reporting the position of parse > errors. > > > > - jeremy > > > > On Fri, Mar 26, 2010 at 4:11 PM, Chris Eidhof wrote: > > Hey, > > > > I've added a darcs patch (I hope it worked, I'm a darcs newbie) to switch > the URL parser to parsec. This simplifies the code a lot. I've used String's > (i.e. the URL path components) as tokens for the parser. What do you guys > think? > > > > I'm sorry I haven't been replying to the type-safe URL handling, I was > busy with writing this week. The discussion has become quite large! I'll see > if I can catch up somewhere this weekend. > > > > -chris > > > > > > > > --===============4797490316856777253== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T2ssIEkgcHVzaGVkIHNvbWUgcGF0Y2hlcyB0byBQYXRoSW5mbyBmb3IgdGhlIHBhcnNlYyBzdHVm Zi4gSXQgbm93IHJlcXVpcmVzIHBhcnNlYyAzLjEuMCAod2hpY2ggaXMgc29ydCBvZiBhIHByb2Js ZW0sIGJ1dCBvaCB3ZWxsKS48ZGl2Pjxicj48L2Rpdj48ZGl2PkkgY2hhbmdlIHRoZSBwVG9rZW4g ZnVuY3Rpb24gc28gdGhhdCBpdCB0cmFja3MgdGhlIGVycm9yIHBvc2l0aW9uIGJldHRlciwgYW5k IHVwZGF0ZWQgc2hvd1BhcnNlRXJyb3IgdG8gdXNlIHRoYXQgaW5mb3JtYXRpb24gYmV0dGVyLiBJ IGFsc28gYWRkZWQgYSBmdW5jdGlvbjo8L2Rpdj4KPGRpdj48YnI+PC9kaXY+PGRpdj5wMnUgOjog UGFyc2VyIGEgLSZndDsgVVJMUGFyc2VyIGE8L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PnNvIG5v dyBpZiB5b3Ugd3JpdGU6PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj48ZGl2PnRlc3QgOjogSU8g KCk8L2Rpdj48ZGl2PnRlc3QgPaA8L2Rpdj48ZGl2PqCgbGV0IHNlZ21lbnRzID0gWyZxdW90O2Zv byZxdW90OywgJnF1b3Q7aGkmcXVvdDssICZxdW90O3Ro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Ozxicj4KJmd0OyAtY2hyaXM8YnI+CiZndDs8YnI+CiZndDs8 YnI+CiZndDs8YnI+Cjxicj4KPC9kaXY+PC9kaXY+PC9ibG9ja3F1b3RlPjwvZGl2Pjxicj48L2Rp dj4K --===============4797490316856777253==-- From jeremy@n-heptane.com Sun Mar 28 20:01:32 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Sun, 28 Mar 2010 19:32:47 -0500 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4899348960969863236==" --===============4899348960969863236== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Fri, Mar 26, 2010 at 6:01 PM, Jeremy Shaw wrote: > A variation which is more obviously hierarchical in nature: > > data User = User LastName FirstName > data Section = Recent | TopRated > data UserHomeURL = Wall Section | Profile > data UserURL = ViewHome User UserHome > > Which would be used to construct urls like: > > /shaw/jeremy/wall/recent > /snoyman/michael/profile > To expand on this slightly let's pretend you first implemented a module that supported a single user: data Section = Recent | TopRated data UserHomeURL = Wall Section | Profile And you release that as a library. Then in another app, which supports multiple users, you want to use it. So you create: data User = User LastName FirstName data UserURL = ViewHome User UserHome That seems pretty sensible. After all the half the point of this library is to be able to build reusable components. Because we are reusing a component, we can not modify the UserHome portion of the URL. But we still need some way to specify which user's home we are looking at. The above types seem sensible for that. You have similar structures in your photo blog app: -------- instance Yesod PB where resources = [$mkResources| /: GET: indexHandler /entries/$entryId: GET: entry /entries/$entryId/$filename: GET: media /feed: GET: feed ... ------ A reasonable URL type for that might be: data EntryId = ... data PhotoBlogURL = BlogHome | Entry EntryId | Media EntryId FileName | Feed Where Media has two arguments to it's constructor. You can't really factor that out, can you? You could fake it like: data PhotoBlogURL = BlogHome | Entry EntryId | Media (EntryId, FileName) | Feed But that does not really buy you anything, because when you write the Media parser, you still have to know how many segments EntryId consumes, and how many FileName consumes. perhaps entryid is: data EntryId = EntryId { year :: Int , month :: Int , --===============4899348960969863236== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gRnJpLCBNYXIgMjYsIDIwMTAgYXQgNjowMSBQTSwgSmVyZW15IFNoYXcgPHNwYW4gZGlyPSJs dHIiPiZsdDs8YSBocmVmPSJtYWlsdG86amVyZW15QG4taGVwdGFuZS5jb20iPmplcmVteUBuLWhl cHRhbmUuY29tPC9hPiZndDs8L3NwYW4+IHdyb3RlOjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90 ZSI+PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0ibWFyZ2luOjAgMCAwIC44 ZXg7Ym9yZGVyLWxlZnQ6MXB4ICNjY2Mgc29saWQ7cGFkZGluZy1sZWZ0OjFleDsiPgpBIHZhcmlh dGlvbiB3aGljaCBpcyBtb3JlIG9idmlvdXNseSBoaWVyYXJjaGljYWwgaW4gbmF0dXJlOjxkaXY+ PGJyPjwvZGl2PjxkaXY+ZGF0YSBVc2VyID0gVXNlciBMYXN0TmFtZSBGaXJzdE5hbWU8L2Rpdj48 ZGl2PmRhdGEgU2VjdGlvbiA9IFJlY2VudCB8IFRvcFJhdGVkPC9kaXY+PGRpdj5kYXRhIFVzZXJI b21lVVJMID0gV2FsbCBTZWN0aW9uIHwgUHJvZmlsZTwvZGl2PjxkaXY+ZGF0YSBVc2VyVVJMID0g Vmlld0hvbWUgVXNlciBVc2VySG9tZTwvZGl2PgoKPGRpdj48YnI+PC9kaXY+PGRpdj5XaGljaCB3 b3VsZCBiZSB1c2VkIHRvIGNvbnN0cnVjdCB1cmxzIGxpa2U6PC9kaXY+PGRpdj48YnI+PC9kaXY+ PGRpdj4vc2hhdy9qZXJlbXkvd2FsbC9yZWNlbnQ8L2Rpdj48ZGl2Pi9zbm95bWFuL21pY2hhZWwv cHJvZmlsZTwvZGl2PjwvYmxvY2txdW90ZT48ZGl2Pjxicj48L2Rpdj48ZGl2PlRvIGV4cGF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hhcyB0d28gYXJndW1lbnRzIHRvIGl0JiMzOTtzIGNvbnN0cnVjdG9yLiBZb3UgY2FuJiMz OTt0IHJlYWxseSBmYWN0b3IgdGhhdCBvdXQsIGNhbiB5b3U/IFlvdSBjb3VsZCBmYWtlIGl0IGxp a2U6PC9kaXY+CjxkaXY+PGJyPjwvZGl2PjxkaXY+PGRpdj5kYXRhIFBob3RvQmxvZ1VSTCA9IEJs b2dIb21lIHwgRW50cnkgRW50cnlJZCB8IE1lZGlhIChFbnRyeUlkLCBGaWxlTmFtZSkgfCBGZWVk PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5CdXQgdGhhdCBkb2VzIG5vdCByZWFsbHkgYnV5IHlv dSBhbnl0aGluZywgYmVjYXVzZSB3aGVuIHlvdSB3cml0ZSB0aGUgTWVkaWEgcGFyc2VyLCB5b3Ug c3RpbGwgaGF2ZSB0byBrbm93IGhvdyBtYW55IHNlZ21lbnRzIEVudHJ5SWQgY29uc3VtZXMsIGFu ZCBob3cgbWFueSBGaWxlTmFtZSBjb25zdW1lcy6gPC9kaXY+CjxkaXY+PGJyPjwvZGl2PjxkaXY+ cGVyaGFwcyBlbnRyeWlkIGlzOjwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+ZGF0YSBFbnRyeUlk ID0gRW50cnlJZCB7IHllYXIgOjogSW50PC9kaXY+PGRpdj6goCCgIKAgoCCgIKAgoCCgIKAgoCCg IKAgoCCgIKAgoCCgIKAgLCBtb250aCA6OiBJbnQ8L2Rpdj48ZGl2PqCgIKAgoCCgIKAgoCCgIKAg oCCgIKAgoCCgIKAgoCCgIKAgoCAsPC9kaXY+PGRpdj4KPGJyPjwvZGl2PjxkaXY+PGJyPjwvZGl2 PjwvZGl2PjwvZGl2PjwvZGl2PjwvZGl2PjwvZGl2Pgo= --===============4899348960969863236==-- From jeremy@n-heptane.com Sun Mar 28 20:03:32 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Sun, 28 Mar 2010 19:34:48 -0500 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2402781081214109251==" --===============2402781081214109251== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Sun, Mar 28, 2010 at 7:32 PM, Jeremy Shaw wrote: Oops. Somehow hit the right combination of keys to send before I was done: > data EntryId = EntryId { year :: Int > , month :: Int > , day :: Int > , seq :: Int } which gets rendered as: /2010/04/10/1/ - jeremy --===============2402781081214109251== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gU3VuLCBNYXIgMjgsIDIwMTAgYXQgNzozMiBQTSwgSmVyZW15IFNoYXcgPHNwYW4gZGlyPSJs dHIiPiZsdDs8YSBocmVmPSJtYWlsdG86amVyZW15QG4taGVwdGFuZS5jb20iPmplcmVteUBuLWhl cHRhbmUuY29tPC9hPiZndDs8L3NwYW4+IHdyb3RlOjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90 ZSI+PGRpdj48YnI+PC9kaXY+PGRpdj5Pb3BzLiBTb21laG93IGhpdCB0aGUgcmlnaHQgY29tYmlu YXRpb24gb2Yga2V5cyB0byBzZW5kIGJlZm9yZSBJIHdhcyBkb25lOjwvZGl2Pgo8ZGl2PqA8L2Rp dj48YmxvY2txdW90ZSBjbGFzcz0iZ21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46MCAwIDAgLjhl eDtib3JkZXItbGVmdDoxcHggI2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4OyI+PGRpdiBjbGFz cz0iaW0iPjwvZGl2PjxkaXYgY2xhc3M9ImdtYWlsX3F1b3RlIj48ZGl2PjxkaXY+PGRpdj48ZGl2 PjxkaXY+ZGF0YSBFbnRyeUlkID0gRW50cnlJZCB7IHllYXIgOjogSW50PC9kaXY+CjxkaXY+oKAg oCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgICwgbW9udGggOjogSW50PC9kaXY+PGRp dj6goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgLCBkYXkgOjogSW50PC9kaXY+ PC9kaXY+PC9kaXY+PC9kaXY+PC9kaXY+PC9kaXY+PC9ibG9ja3F1b3RlPjxkaXY+oKAgoCCgIKAg oCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCAsIHNlcSA6OiBJbnQ8L2Rpdj4KPGRpdj6g oCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIKAgoCCgfTwvZGl2PjxkaXY+PGJyPjwv ZGl2PjxkaXY+d2hpY2ggZ2V0cyByZW5kZXJlZCBhczo8L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2 Pi8yMDEwLzA0LzEwLzEvPC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj4tIGplcmVteaA8L2Rpdj48 L2Rpdj48YnI+Cg== --===============2402781081214109251==-- From jeremy@n-heptane.com Sun Mar 28 23:32:19 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Sun, 28 Mar 2010 23:03:35 -0500 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3659313681737501419==" --===============3659313681737501419== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit I pushed a big old patch to web-routes. It splits it into sub-packages, drops the parameterization of Site over pathInfo, and switches from Failing to either. I need to figure out how to tweak p2u in PathInfo so that it works with parsec 2 and 3. But, it's getting a lot closer to being done. I think some of the naming could still be improved. - jeremy --===============3659313681737501419== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SSBwdXNoZWQgYSBiaWcgb2xkIHBhdGNoIHRvIHdlYi1yb3V0ZXMuIEl0IHNwbGl0cyBpdCBpbnRv IHN1Yi1wYWNrYWdlcywgZHJvcHMgdGhlIHBhcmFtZXRlcml6YXRpb24gb2YgU2l0ZSBvdmVyIHBh dGhJbmZvLCBhbmQgc3dpdGNoZXMgZnJvbSBGYWlsaW5nIHRvIGVpdGhlci48ZGl2Pjxicj48L2Rp dj48ZGl2PkkgbmVlZCB0byBmaWd1cmUgb3V0IGhvdyB0byB0d2VhayBwMnUgaW4gUGF0aEluZm8g c28gdGhhdCBpdCB3b3JrcyB3aXRoIHBhcnNlYyAyIGFuZCAzLqA8L2Rpdj4KPGRpdj48YnI+PC9k aXY+PGRpdj5CdXQsIGl0JiMzOTtzIGdldHRpbmcgYSBsb3QgY2xvc2VyIHRvIGJlaW5nIGRvbmUu IEkgdGhpbmsgc29tZSBvZiB0aGUgbmFtaW5nIGNvdWxkIHN0aWxsIGJlIGltcHJvdmVkLjwvZGl2 PjxkaXY+PGJyPjwvZGl2PjxkaXY+LSBqZXJlbXk8L2Rpdj4K --===============3659313681737501419==-- From michael@snoyman.com Mon Mar 29 09:15:52 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Mon, 29 Mar 2010 06:47:09 -0700 Message-ID: <29bf512f1003290647p8600a39h5d034cdf7b24c1bb@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8151916357480684699==" --===============8151916357480684699== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Jeremy, Awesome work, sorry I haven't been more responsive for the past few days- I'm afraid that's going to continue for a bit. We'd been discussing the PathInfo class previously; I understand now what you're trying to achieve with it, but I think for a lot of use cases using a parser like that will be unnecesary. For those cases, I'd hate to introduce a parsec dependency, especially given the 2/3 split we're dealing with right now. I know it's painful to split this up into even more packages, but we do you think of adding web-routes-parser? Also, question about the Site datatype: Did we want the formatLink and parseLink functions to work on [String] instead of String? I think I see advantages either way. Also, I'm not sure if I sent this previously, but I think the defaultPage function is redundant; that should probably be specified by 'parseLink ""'. I'll try to get started on porting the Yesod mkResources code over to web-routes now. Michael On Sun, Mar 28, 2010 at 9:03 PM, Jeremy Shaw wrote: > I pushed a big old patch to web-routes. It splits it into sub-packages, > drops the parameterization of Site over pathInfo, and switches from Failing > to either. > > I need to figure out how to tweak p2u in PathInfo so that it works with > parsec 2 and 3. > > But, it's getting a lot closer to being done. I think some of the naming > could still be improved. > > - jeremy > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > > --===============8151916357480684699== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SmVyZW15LDxkaXY+PGJyPjwvZGl2PjxkaXY+QXdlc29tZSB3b3JrLCBzb3JyeSBJIGhhdmVuJiMz OTt0IGJlZW4gbW9yZSByZXNwb25zaXZlIGZvciB0aGUgcGFzdCBmZXcgZGF5cy0gSSYjMzk7bSBh ZnJhaWQgdGhhdCYjMzk7cyBnb2luZyB0byBjb250aW51ZSBmb3IgYSBiaXQuPC9kaXY+PGRpdj48 YnI+PC9kaXY+PGRpdj5XZSYjMzk7ZCBiZWVuIGRpc2N1c3NpbmcgdGhlIFBhdGhJbmZvIGNsYXNz IHByZXZpb3VzbHk7IEkgdW5kZXJzdGFuZCBub3cgd2hhdCB5b3UmIzM5O3JlIHRyeWluZyB0byBh Y2hpZXZlIHdpdGggaXQsIGJ1dCBJIHRoaW5rIGZvciBhIGxvdCBvZiB1c2UgY2FzZXMgdXNpbmcg YSBwYXJzZXIgbGlrZSB0aGF0IHdpbGwgYmUgdW5uZWNlc2FyeS4gRm9yIHRob3NlIGNhc2VzLCBJ JiMzOTtkIGhhdGUgdG8gaW50cm9kdWNlIGEgcGFyc2VjIGRlcGVuZGVuY3ksIGVzcGVjaWFsbHkg Z2l2ZW4gdGhlIDIvMyBzcGxpdCB3ZSYjMzk7cmUgZGVhbGluZyB3aXRoIHJpZ2h0IG5vdy48L2Rp dj4KPGRpdj48YnI+PC9kaXY+PGRpdj5JIGtub3cgaXQmIzM5O3MgcGFpbmZ1bC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PSJfYmxhbmsiPmh0dHA6Ly93d3cuaGFza2VsbC5vcmcv bWFpbG1hbi9saXN0aW5mby93ZWItZGV2ZWw8L2E+PGJyPgo8YnI+PC9ibG9ja3F1b3RlPjwvZGl2 Pjxicj48L2Rpdj4K --===============8151916357480684699==-- From jeremy@n-heptane.com Mon Mar 29 11:47:15 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Mon, 29 Mar 2010 11:18:32 -0500 Message-ID: In-Reply-To: <29bf512f1003290647p8600a39h5d034cdf7b24c1bb@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5659220088957892254==" --===============5659220088957892254== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, Mar 29, 2010 at 8:47 AM, Michael Snoyman wrote: > Jeremy, > > We'd been discussing the PathInfo class previously; I understand now what > you're trying to achieve with it, but I think for a lot of use cases using a > parser like that will be unnecesary. For those cases, I'd hate to introduce > a parsec dependency, especially given the 2/3 split we're dealing with right > now. > Well, parsec is in the haskell platform, so it's really a question of can be it implemented so that it works with both 2 and 3. > I know it's painful to split this up into even more packages, but we do you > think of adding web-routes-parser? > I would consider it, but I don't understand how that would work... So far you have been pretty unexcited about the parsing having a type similar to: [String] -> (Either String a, [String]) because it is often 'unnecessary'. But the problem with, [String] -> (Either String a), is that, as far as I can tell, it won't work in the cases where it *is* necessary. And you can't simply switch to, [String] -> (Either String a, [String]), when that happens.. But perhaps I am missing something here.. > Also, question about the Site datatype: Did we want the formatLink and > parseLink functions to work on [String] instead of String? I think I see > advantages either way. Also, I'm not sure if I sent this previously, but I > think the defaultPage function is redundant; that should probably be > specified by 'parseLink ""'. > I will have to think about [String] vs String more. I don't want using Site to mean you have to use PathInfo, but switching to [String] wouldn't have that effect, and would mean that people would not have to worry about those pesky encoding issues. The only real use case I have for not using PathInfo is if you wanted to create a function like: gfromPathSegments :: (Data url) => PathInfo -> Either String url. And that can be done most easily if PathInfo = [String]. So I think I'll make that change. In the old code base, where there was no url encoding done by the library, it did not really make a difference. Regarding defaultPage, not all methods of generating formatLink / parseLink lend themselves to handling "" very easily, so it seemed nice to have a single place that can add that case in, rather than add similar code to all the parsers.. Also, I think that I sometimes changes the landing page of my site. But I think I will make 'defaultPage' a Maybe value, and bill it as a way to 'override' where "" resolves to. > I'll try to get started on porting the Yesod mkResources code over to > web-routes now. > awesome! - jeremy --===============5659220088957892254== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gTW9uLCBNYXIgMjksIDIwMTAgYXQgODo0NyBBTSwgTWljaGFlbCBTbm95bWFuIDxzcGFuIGRp cj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFpbHRvOm1pY2hhZWxAc25veW1hbi5jb20iPm1pY2hhZWxA c25veW1hbi5jb208L2E+Jmd0Ozwvc3Bhbj4gd3JvdGU6PGJyPjxkaXYgY2xhc3M9ImdtYWlsX3F1 b3RlIj48YmxvY2txdW90ZSBjbGFzcz0iZ21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46MCAwIDAg LjhleDtib3JkZXItbGVmdDoxcHggI2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4OyI+CkplcmVt eSw8ZGl2PjwvZGl2PjwvYmxvY2txdW90ZT48ZGl2PqA8L2Rpdj48YmxvY2txdW90ZSBjbGFzcz0i Z21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46MCAwIDAgLjhleDtib3JkZXItbGVmdDoxcHggI2Nj YyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4OyI+PGRpdj5XZSYjMzk7ZCBiZWVuIGRpc2N1c3Npbmcg dGhlIFBhdGhJbmZvIGNsYXNzIHByZXZpb3VzbHk7IEkgdW5kZXJzdGFuZCBub3cgd2hhdCB5b3Um IzM5O3JlIHRyeWluZyB0byBhY2hpZXZlIHdpdGggaXQsIGJ1dCBJIHRoaW5rIGZvciBhIGxvdCBv Z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+PGJyPjwvZGl2PjxkaXY+YXdlc29tZSE8L2Rpdj48 ZGl2Pjxicj48L2Rpdj48ZGl2Pi0gamVyZW15PC9kaXY+PGRpdj6gPC9kaXY+PC9kaXY+Cg== --===============5659220088957892254==-- From chris@eidhof.nl Mon Mar 29 11:56:59 2010 From: Chris Eidhof To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Mon, 29 Mar 2010 18:28:13 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6241913057950247921==" --===============6241913057950247921== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable -chris On 29 mrt 2010, at 18:18, Jeremy Shaw wrote: > On Mon, Mar 29, 2010 at 8:47 AM, Michael Snoyman wrot= e: > Jeremy, > =20 > We'd been discussing the PathInfo class previously; I understand now what y= ou're trying to achieve with it, but I think for a lot of use cases using a p= arser like that will be unnecesary. For those cases, I'd hate to introduce a = parsec dependency, especially given the 2/3 split we're dealing with right no= w. >=20 > Well, parsec is in the haskell platform, so it's really a question of can b= e it implemented so that it works with both 2 and 3.=20 I'm on the latest 6.12 platform, and I only have parsec-2.1 installed. Which = packages use parsec-3? >=20 > So far you have been pretty unexcited about the parsing having a type simil= ar to: >=20 > [String] -> (Either String a, [String]) >=20 > because it is often 'unnecessary'. But the problem with, [String] -> (Eithe= r String a), is that, as far as I can tell, it won't work in the cases where = it *is* necessary. And you can't simply switch to, [String] -> (Either String= a, [String]), when that happens.. But perhaps I am missing something here.. I think you're right, Jeremy. If you want an instance for :*:, (i.e. for a co= nstructor with several fields), you definitely need a parser. Be it parsec or= a hand-rolled Consumer-like parser, you do need one. -chris --===============6241913057950247921==-- From jeremy@n-heptane.com Mon Mar 29 12:04:17 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Mon, 29 Mar 2010 11:35:34 -0500 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0053991179651440147==" --===============0053991179651440147== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, Mar 29, 2010 at 11:28 AM, Chris Eidhof wrote: > > -chris > > On 29 mrt 2010, at 18:18, Jeremy Shaw wrote: > > > On Mon, Mar 29, 2010 at 8:47 AM, Michael Snoyman > wrote: > > Jeremy, > > > > We'd been discussing the PathInfo class previously; I understand now what > you're trying to achieve with it, but I think for a lot of use cases using a > parser like that will be unnecesary. For those cases, I'd hate to introduce > a parsec dependency, especially given the 2/3 split we're dealing with right > now. > > > > Well, parsec is in the haskell platform, so it's really a question of can > be it implemented so that it works with both 2 and 3. > > I'm on the latest 6.12 platform, and I only have parsec-2.1 installed. > Which packages use parsec-3? > > in web-routes, the PathInfo module now contains a function p2u :: Parser a -> URLParser a so that you can lift a Char parser to be a URL parser: testp :: URLParser (Char, String, String) testp = do segment "foo" st <- p2u (char 'h' >> char 'o') sg <- anySegment sg' <- anySegment return (st,sg, sg') but I have not figured out how to implement p2u so that it works under parsec 2 & 3. Maybe I'll just leave it out for now, but I am doing some exploration first. - jeremy --===============0053991179651440147== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gTW9uLCBNYXIgMjksIDIwMTAgYXQgMTE6MjggQU0sIENocmlzIEVpZGhvZiA8c3BhbiBkaXI9 Imx0ciI+Jmx0OzxhIGhyZWY9Im1haWx0bzpjaHJpc0BlaWRob2YubmwiPmNocmlzQGVpZGhvZi5u bDwvYT4mZ3Q7PC9zcGFuPiB3cm90ZTo8YnI+PGRpdiBjbGFzcz0iZ21haWxfcXVvdGUiPjxibG9j a3F1b3RlIGNsYXNzPSJnbWFpbF9xdW90ZSIgc3R5bGU9Im1hcmdpbjowIDAgMCAuOGV4O2JvcmRl ci1sZWZ0OjFweCAjY2NjIHNvbGlkO3BhZGRpbmctbGVmdDoxZXg7Ij4KPGJyPgotY2hyaXM8YnI+ CjxkaXYgY2xhc3M9ImltIj48Y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cmVteTwvZGl2Pjwv ZGl2Pgo= --===============0053991179651440147==-- From jeremy@n-heptane.com Mon Mar 29 12:15:13 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Mon, 29 Mar 2010 11:46:30 -0500 Message-ID: In-Reply-To: <29bf512f1003290647p8600a39h5d034cdf7b24c1bb@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4743049125291617628==" --===============4743049125291617628== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, Mar 29, 2010 at 8:47 AM, Michael Snoyman wrote: > We'd been discussing the PathInfo class previously; I understand now what > you're trying to achieve with it, but I think for a lot of use cases using a > parser like that will be unnecesary. For those cases, I'd hate to introduce > a parsec dependency, especially given the 2/3 split we're dealing with right > now. > web-routes depends on network, and network depends on parsec 2. So we already depend (indirectly) on parsec 2 whether we want to or not. (On debian, for example, to install libghc6-network-dev, libghc6-parsec-dev must also be installed). So, I think that means that adding parsec 2 as a direct dependency should not be an issue in terms of adding any new dependencies? (Ignoring the question as to whether parsec is the right tool for the job in the first place). - jeremy --===============4743049125291617628== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gTW9uLCBNYXIgMjksIDIwMTAgYXQgODo0NyBBTSwgTWljaGFlbCBTbm95bWFuIDxzcGFuIGRp cj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFpbHRvOm1pY2hhZWxAc25veW1hbi5jb20iPm1pY2hhZWxA c25veW1hbi5jb208L2E+Jmd0Ozwvc3Bhbj4gd3JvdGU6PGJyPjxkaXYgY2xhc3M9ImdtYWlsX3F1 b3RlIj48YmxvY2txdW90ZSBjbGFzcz0iZ21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46MCAwIDAg LjhleDtib3JkZXItbGVmdDoxcHggI2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4OyI+CjxkaXY+ V2UmIzM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G8gd2hldGhlciBw YXJzZWMgaXMgdGhlIHJpZ2h0IHRvb2wgZm9yIHRoZSBqb2IgaW4gdGhlIGZpcnN0IHBsYWNlKS48 L2Rpdj4KPGRpdj48YnI+PC9kaXY+PGRpdj4tIGplcmVteTwvZGl2PjwvZGl2Pgo= --===============4743049125291617628==-- From michael@snoyman.com Mon Mar 29 12:44:57 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Mon, 29 Mar 2010 10:16:14 -0700 Message-ID: <29bf512f1003291016i2b44b126s1b04acdd5469899b@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5717018718010393110==" --===============5717018718010393110== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 29, 2010 at 9:18 AM, Jeremy Shaw wrote: > On Mon, Mar 29, 2010 at 8:47 AM, Michael Snoyman wrote: > >> Jeremy, >> > > >> We'd been discussing the PathInfo class previously; I understand now what >> you're trying to achieve with it, but I think for a lot of use cases using= a >> parser like that will be unnecesary. For those cases, I'd hate to introduce >> a parsec dependency, especially given the 2/3 split we're dealing with rig= ht >> now. >> > > Well, parsec is in the haskell platform, so it's really a question of can > be it implemented so that it works with both 2 and 3. > > >> I know it's painful to split this up into even more packages, but we do >> you think of adding web-routes-parser? >> > > I would consider it, but I don't understand how that would work... > > So far you have been pretty unexcited about the parsing having a type > similar to: > > [String] -> (Either String a, [String]) > > because it is often 'unnecessary'. But the problem with, [String] -> > (Either String a), is that, as far as I can tell, it won't work in the cases > where it *is* necessary. And you can't simply switch to, [String] -> (Either > String a, [String]), when that happens.. But perhaps I am missing something > here.. > > The reason I'm unexcited is that I never would have dreamed of defining my routes that way. I don't feel like drawing out this point too much, because you clearly *would* define your routes that way. However, just to draw the distinction in how I would do things differently, I'll use an example of mine that you quoted earlier: instance Yesod PB where resources =3D [$mkResources| /: GET: indexHandler /entries/$entryId: GET: entry /entries/$entryId/$filename: GET: media /feed: GET: feed If I were to convert this to a datatype, it would be: data PBRoutes =3D Home | Entry String | File String String | Feed I simply wouldn't nest a datatype inside any of the constructors. I understand that you want to do this in some circumstances, but I would simply "duplicate" the parsing code for the Entry and File constructors, since I find that parsing code trivial. In particular: parsePB ["entries", eid] =3D Entry eid parsePB ["entries", eid, filename] =3D File eid filename I don't see a need for providing a sophisticated parser. Also, question about the Site datatype: Did we want the formatLink and >> parseLink functions to work on [String] instead of String? I think I see >> advantages either way. Also, I'm not sure if I sent this previously, but I >> think the defaultPage function is redundant; that should probably be >> specified by 'parseLink ""'. >> > > I will have to think about [String] vs String more. I don't want using Site > to mean you have to use PathInfo, but switching to [String] wouldn't have > that effect, and would mean that people would not have to worry about those > pesky encoding issues. The only real use case I have for not using PathInfo > is if you wanted to create a function like: gfromPathSegments :: (Data url) > =3D> PathInfo -> Either String url. And that can be done most easily if > PathInfo =3D [String]. So I think I'll make that change. In the old code ba= se, > where there was no url encoding done by the library, it did not really make > a difference. > > Regarding defaultPage, not all methods of generating formatLink / parseLink > lend themselves to handling "" very easily, so it seemed nice to have a > single place that can add that case in, rather than add similar code to all > the parsers.. Also, I think that I sometimes changes the landing page of my > site. But I think I will make 'defaultPage' a Maybe value, and bill it as a > way to 'override' where "" resolves to. > > That sounds good. > I'll try to get started on porting the Yesod mkResources code over to >> web-routes now. >> > > awesome! > > - jeremy > > So, I've thought about the syntax for this, and I have this idea in mind. $(createRoutes MyRoutes [$parseRoutes| /: name: Home methods: [GET] /user/#userid: name: User methods: [GET, PUT, DELETE] /static: name: Static subsite: StaticRoutes dispatch: staticRoutes |]) This would generate a datatype: data MyRoutes =3D Home | User Integer | Static StaticRoutes Handler functions would be getHome, getUser, putUser, deleteUser. Static would be a pluggable subsite; I'd have to play around with the syntax of that a bit. Also, this will allow *any* type of application, not just wai (I want this to be as general as possible). Michael --===============5717018718010393110== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjx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aW9uLCBub3QganVzdCB3YWkgKEkgd2FudCB0aGlzIHRvIGJlIGFzIGdlbmVyYWwgYXMg cG9zc2libGUpLjwvZGl2Pgo8ZGl2Pjxicj48L2Rpdj48ZGl2Pk1pY2hhZWw8L2Rpdj48L3NwYW4+ PC9kaXY+Cg== --===============5717018718010393110==-- From jeremy@n-heptane.com Mon Mar 29 14:05:55 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Mon, 29 Mar 2010 13:37:12 -0500 Message-ID: In-Reply-To: <29bf512f1003291016i2b44b126s1b04acdd5469899b@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4293793938279757740==" --===============4293793938279757740== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, Mar 29, 2010 at 12:16 PM, Michael Snoyman wrote: > The reason I'm unexcited is that I never would have dreamed of defining my > routes that way. I don't feel like drawing out this point too much, because > you clearly *would* define your routes that way. However, just to draw the > distinction in how I would do things differently, I'll use an example of > mine that you quoted earlier: > > instance Yesod PB where > resources = [$mkResources| > /: > GET: indexHandler > /entries/$entryId: > GET: entry > /entries/$entryId/$filename: > GET: media > /feed: > GET: feed > > If I were to convert this to a datatype, it would be: > > data PBRoutes = Home | Entry String | File String String | Feed > You do still have nested data-types here. Namely the String. In this case it is trivial to handle by hand, but it does pose a problem for things like TH and Regular. That is why I had PathInfo in the original code in the first place.. I couldn't figure out how to write the TH code with out it. I simply wouldn't nest a datatype inside any of the constructors. I > understand that you want to do this in some circumstances, but I would > simply "duplicate" the parsing code for the Entry and File constructors, > since I find that parsing code trivial. In particular: > > parsePB ["entries", eid] = Entry eid > parsePB ["entries", eid, filename] = File eid filename > > I don't see a need for providing a sophisticated parser. > If you are going to duplicate the code instead of calling fromPathSegments, then you don't really need PathInfo at all, right? The current code is designed so that you are not forced to use PathInfo. We have: data Site = Site { ... , parsePathSegments :: [String] -> Either String url } And you can do: Site { parsePathSegments = parsePB } The only real reason to have PathInfo is to build composable parsers as far as I can tell. So, I guess maybe you are suggesting that PathInfo should be a separate package? I don't see a big win here since we will depend on parsec 2 anyway, and since web-routes-wai would need to depend on it anyway to provide the wai related functions that do use PathInfo.. I did add a new parser combinator though: patternParse :: ([String] -> Either String a) -> URLParser a so you can do: fromPathSegments = patternParse parsePB patternParse consumes all the remaining segments and passes them to parsePB. > So, I've thought about the syntax for this, and I have this idea in mind. > > $(createRoutes MyRoutes [$parseRoutes| > /: > name: Home > methods: [GET] > /user/#userid: > name: User > methods: [GET, PUT, DELETE] > /static: > name: Static > subsite: StaticRoutes > dispatch: staticRoutes > |]) > > This would generate a datatype: > > data MyRoutes = Home | User Integer | Static StaticRoutes > So your idea is to generate the data-type from the routes, rather than try to map the routes onto an existing datatype? Your approach sounds easier. The advantage of the latter is that you could change the look of the url with out having to go change all your code that uses the URL type.. Not sure how doable the latter is though. Handler functions would be getHome, getUser, putUser, deleteUser. Static > would be a pluggable subsite; I'd have to play around with the syntax of > that a bit. Also, this will allow *any* type of application, not just wai (I > want this to be as general as possible). > right. I see no reason for it to be wai specific. Speaking of wai, there is a bug in wai-extra in SimpleServer. It does not put a space between the status code and the status message ~/n-heptane/projects/haskell/web-routes $ curl -v http://localhost:3000/MyHomeoeu * About to connect() to localhost port 3000 (#0) * Trying ::1... Connection refused * Trying 127.0.0.1... connected * Connected to localhost (127.0.0.1) port 3000 (#0) > GET /MyHomeoeu HTTP/1.1 > User-Agent: curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.10 libssh2/0.18 > Host: localhost:3000 > Accept: */* > < HTTP/1.1 404Not Found * no chunk, no close, no size. Assume close to signal end Note the second to last line. - jeremy --===============4293793938279757740== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gTW9uLCBNYXIgMjksIDIwMTAgYXQgMTI6MTYgUE0sIE1pY2hhZWwgU25veW1hb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7IEFjY2VwdDogKi8qPC9kaXY+PGRpdj4mZ3Q7oDwv ZGl2PjxkaXY+Jmx0OyBIVFRQLzEuMSA0MDROb3QgRm91bmQ8L2Rpdj48ZGl2Piogbm8gY2h1bmss IG5vIGNsb3NlLCBubyBzaXplLiBBc3N1bWUgY2xvc2UgdG8gc2lnbmFsIGVuZDwvZGl2PjxkaXY+ PGJyPjwvZGl2PjxkaXY+Tm90ZSB0aGUgc2Vjb25kIHRvIGxhc3QgbGluZS48L2Rpdj4KPGRpdj48 YnI+PC9kaXY+PGRpdj4tIGplcmVteTwvZGl2PjwvZGl2PjwvZGl2Pgo= --===============4293793938279757740==-- From michael@snoyman.com Mon Mar 29 18:46:25 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Mon, 29 Mar 2010 16:17:43 -0700 Message-ID: <29bf512f1003291617m30143cc5v2179e347c153a80d@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8958900479226323757==" --===============8958900479226323757== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 29, 2010 at 11:37 AM, Jeremy Shaw wrote: > On Mon, Mar 29, 2010 at 12:16 PM, Michael Snoyman wrot= e: > > >> The reason I'm unexcited is that I never would have dreamed of defining my >> routes that way. I don't feel like drawing out this point too much, because >> you clearly *would* define your routes that way. However, just to draw the >> distinction in how I would do things differently, I'll use an example of >> mine that you quoted earlier: >> >> instance Yesod PB where >> resources =3D [$mkResources| >> /: >> GET: indexHandler >> /entries/$entryId: >> GET: entry >> /entries/$entryId/$filename: >> GET: media >> /feed: >> GET: feed >> >> If I were to convert this to a datatype, it would be: >> >> data PBRoutes =3D Home | Entry String | File String String | Feed >> > > You do still have nested data-types here. Namely the String. In this case > it is trivial to handle by hand, but it does pose a problem for things like > TH and Regular. That is why I had PathInfo in the original code in the first > place.. I couldn't figure out how to write the TH code with out it. > > I simply wouldn't nest a datatype inside any of the constructors. I >> understand that you want to do this in some circumstances, but I would >> simply "duplicate" the parsing code for the Entry and File constructors, >> since I find that parsing code trivial. In particular: >> >> parsePB ["entries", eid] =3D Entry eid >> parsePB ["entries", eid, filename] =3D File eid filename >> >> I don't see a need for providing a sophisticated parser. >> > > If you are going to duplicate the code instead of calling fromPathSegments, > then you don't really need PathInfo at all, right? The current code is > designed so that you are not forced to use PathInfo. > > Right, I just didn't understand the purpose of PathInfo; you've explained it very clearly now, thank you. > We have: > > data Site =3D Site { ... > , parsePathSegments :: [String] -> Either > String url > } > > And you can do: > > Site { parsePathSegments =3D parsePB } > > The only real reason to have PathInfo is to build composable parsers as far > as I can tell. So, I guess maybe you are suggesting that PathInfo should be > a separate package? I don't see a big win here since we will depend on > parsec 2 anyway, and since web-routes-wai would need to depend on it anyway > to provide the wai related functions that do use PathInfo.. > > I did add a new parser combinator though: > > patternParse :: ([String] -> Either String a) -> URLParser a > > so you can do: > > fromPathSegments =3D patternParse parsePB > > patternParse consumes all the remaining segments and passes them to > parsePB. > > >> So, I've thought about the syntax for this, and I have this idea in mind. >> >> $(createRoutes MyRoutes [$parseRoutes| >> /: >> name: Home >> methods: [GET] >> /user/#userid: >> name: User >> methods: [GET, PUT, DELETE] >> /static: >> name: Static >> subsite: StaticRoutes >> dispatch: staticRoutes >> |]) >> >> This would generate a datatype: >> >> data MyRoutes =3D Home | User Integer | Static StaticRoutes >> > > > So your idea is to generate the data-type from the routes, rather than try > to map the routes onto an existing datatype? > > Your approach sounds easier. The advantage of the latter is that you could > change the look of the url with out having to go change all your code that > uses the URL type.. Not sure how doable the latter is though. > > Well, I've started implementing it: it can now generate the data types, but doesn't do the parsing, building and dispatching functions. Those should be fairly simple, but I'm just running out of time (Passover seder in a few hours...). Thought I'd let you have a sneak preview: http://github.com/snoyberg/web-routes-quasi > Handler functions would be getHome, getUser, putUser, deleteUser. Static >> would be a pluggable subsite; I'd have to play around with the syntax of >> that a bit. Also, this will allow *any* type of application, not just wai = (I >> want this to be as general as possible). >> > > right. I see no reason for it to be wai specific. > > Speaking of wai, there is a bug in wai-extra in SimpleServer. It does not > put a space between the status code and the status message > > ~/n-heptane/projects/haskell/web-routes $ curl -v > http://localhost:3000/MyHomeoeu > * About to connect() to localhost port 3000 (#0) > * Trying ::1... Connection refused > * Trying 127.0.0.1... connected > * Connected to localhost (127.0.0.1) port 3000 (#0) > > GET /MyHomeoeu HTTP/1.1 > > User-Agent: curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g > zlib/1.2.3.3 libidn/1.10 libssh2/0.18 > > Host: localhost:3000 > > Accept: */* > > > < HTTP/1.1 404Not Found > * no chunk, no close, no size. Assume close to signal end > > Note the second to last line. > > - jeremy > Thanks for catching that, bug fix is (as you can imagine) just one line; I'll upload when I have a free moment. Michael --===============8958900479226323757== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gTW9uLCBNYXIgMjksIDIwMTAgYXQg MTE6MzcgQU0sIEplcmVteSBTaGF3IDxzcGFuIGRpcj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFpbHRv OmplcmVteUBuLWhlcHRhbmUuY29tIj5qZXJlbXlAbi1oZXB0YW5lLmNvbTwvYT4mZ3Q7PC9zcGFu PiB3cm90ZTo8YnI+PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0ibWFyZ2lu OjAgMCAwIC44ZXg7Ym9yZGVyLWxlZnQ6MXB4ICNjY2Mgc29saWQ7cGFkZGluZy1sZWZ0OjFleDsi Pgo8ZGl2IGNsYXNzPSJpbSI+T24gTW9uLCBNYXIgMjksIDIwMTAgYXQgMTI6MTYgUE0sIE1pY2hh ZWwgU25veW1hbiA8c3BhbiBkaXI9Imx0ciI+Jmx0OzxhIGhyZWY9Im1haWx0bzptaWNoYWVsQHNu b3ltYW4uY29tIiB0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2Pgo= --===============8958900479226323757==-- From michael@snoyman.com Thu Apr 1 13:48:28 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Thu, 01 Apr 2010 11:19:54 -0700 Message-ID: In-Reply-To: <29bf512f1003291617m30143cc5v2179e347c153a80d@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3777344051027428688==" --===============3777344051027428688== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Minor update: I think that YAML syntax for these kinds of routes is a little bit verbose; any thoughts on this syntax: / Home GET /user/#userid User GET PUT DELETE /static Static StaticRoutes staticRoutes /foo/*slurp Foo /bar/$barparam Bar First column is the pattern, second is the constructor name, and after that you have three possibilities: Nothing is a handler function for any request method. Above, the fourth and fifth entries. A list of request methods will allow a handler function for each request method. Above, the first and second entries. A datatype and function name, allowing a subsite datatype and subsite function. Above,the third entry. I'll need to develop this one a bit more. Michael On Mon, Mar 29, 2010 at 4:17 PM, Michael Snoyman wrote: > > > On Mon, Mar 29, 2010 at 11:37 AM, Jeremy Shaw wrote: > >> On Mon, Mar 29, 2010 at 12:16 PM, Michael Snoyman wro= te: >> >> >>> The reason I'm unexcited is that I never would have dreamed of defining >>> my routes that way. I don't feel like drawing out this point too much, >>> because you clearly *would* define your routes that way. However, just to >>> draw the distinction in how I would do things differently, I'll use an >>> example of mine that you quoted earlier: >>> >>> instance Yesod PB where >>> resources =3D [$mkResources| >>> /: >>> GET: indexHandler >>> /entries/$entryId: >>> GET: entry >>> /entries/$entryId/$filename: >>> GET: media >>> /feed: >>> GET: feed >>> >>> If I were to convert this to a datatype, it would be: >>> >>> data PBRoutes =3D Home | Entry String | File String String | Feed >>> >> >> You do still have nested data-types here. Namely the String. In this case >> it is trivial to handle by hand, but it does pose a problem for things like >> TH and Regular. That is why I had PathInfo in the original code in the fir= st >> place.. I couldn't figure out how to write the TH code with out it. >> >> I simply wouldn't nest a datatype inside any of the constructors. I >>> understand that you want to do this in some circumstances, but I would >>> simply "duplicate" the parsing code for the Entry and File constructors, >>> since I find that parsing code trivial. In particular: >>> >>> parsePB ["entries", eid] =3D Entry eid >>> parsePB ["entries", eid, filename] =3D File eid filename >>> >>> I don't see a need for providing a sophisticated parser. >>> >> >> If you are going to duplicate the code instead of calling >> fromPathSegments, then you don't really need PathInfo at all, right? The >> current code is designed so that you are not forced to use PathInfo. >> >> Right, I just didn't understand the purpose of PathInfo; you've explained > it very clearly now, thank you. > > >> We have: >> >> data Site =3D Site { ... >> , parsePathSegments :: [String] -> Either >> String url >> } >> >> And you can do: >> >> Site { parsePathSegments =3D parsePB } >> >> The only real reason to have PathInfo is to build composable parsers as >> far as I can tell. So, I guess maybe you are suggesting that PathInfo shou= ld >> be a separate package? I don't see a big win here since we will depend on >> parsec 2 anyway, and since web-routes-wai would need to depend on it anyway >> to provide the wai related functions that do use PathInfo.. >> >> I did add a new parser combinator though: >> >> patternParse :: ([String] -> Either String a) -> URLParser a >> >> so you can do: >> >> fromPathSegments =3D patternParse parsePB >> >> patternParse consumes all the remaining segments and passes them to >> parsePB. >> >> >>> So, I've thought about the syntax for this, and I have this idea in mind. >>> >>> $(createRoutes MyRoutes [$parseRoutes| >>> /: >>> name: Home >>> methods: [GET] >>> /user/#userid: >>> name: User >>> methods: [GET, PUT, DELETE] >>> /static: >>> name: Static >>> subsite: StaticRoutes >>> dispatch: staticRoutes >>> |]) >>> >>> This would generate a datatype: >>> >>> data MyRoutes =3D Home | User Integer | Static StaticRoutes >>> >> >> >> So your idea is to generate the data-type from the routes, rather than try >> to map the routes onto an existing datatype? >> >> Your approach sounds easier. The advantage of the latter is that you could >> change the look of the url with out having to go change all your code that >> uses the URL type.. Not sure how doable the latter is though. >> >> Well, I've started implementing it: it can now generate the data types, > but doesn't do the parsing, building and dispatching functions. Those should > be fairly simple, but I'm just running out of time (Passover seder in a few > hours...). Thought I'd let you have a sneak preview: > > http://github.com/snoyberg/web-routes-quasi > > >> Handler functions would be getHome, getUser, putUser, deleteUser. Static >>> would be a pluggable subsite; I'd have to play around with the syntax of >>> that a bit. Also, this will allow *any* type of application, not just wai= (I >>> want this to be as general as possible). >>> >> >> right. I see no reason for it to be wai specific. >> >> Speaking of wai, there is a bug in wai-extra in SimpleServer. It does not >> put a space between the status code and the status message >> >> ~/n-heptane/projects/haskell/web-routes $ curl -v >> http://localhost:3000/MyHomeoeu >> * About to connect() to localhost port 3000 (#0) >> * Trying ::1... Connection refused >> * Trying 127.0.0.1... connected >> * Connected to localhost (127.0.0.1) port 3000 (#0) >> > GET /MyHomeoeu HTTP/1.1 >> > User-Agent: curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 >> OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.10 libssh2/0.18 >> > Host: localhost:3000 >> > Accept: */* >> > >> < HTTP/1.1 404Not Found >> * no chunk, no close, no size. Assume close to signal end >> >> Note the second to last line. >> >> - jeremy >> > > Thanks for catching that, bug fix is (as you can imagine) just one line; > I'll upload when I have a free moment. > > Michael > --===============3777344051027428688== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 TWlub3IgdXBkYXRlOiBJIHRoaW5rIHRoYXQgWUFNTCBzeW50YXggZm9yIHRoZXNlIGtpbmRzIG9m IHJvdXRlcyBpcyBhIGxpdHRsZSBiaXQgdmVyYm9zZTsgYW55IHRob3VnaHRzIG9uIHRoaXMgc3lu dGF4OjxkaXY+PGJyPjwvZGl2PjxkaXY+PGRpdj48Zm9udCBjbGFzcz0iQXBwbGUtc3R5bGUtc3Bh biIgZmFjZT0iJiMzOTtjb3VyaWVyIG5ldyYjMzk7LCBtb25vc3BhY2UiPi8gwqAgwqAgwqAgwqAg wqAgwqAgwqAgwqAgwqAgwqBIb21lIMKgIMKgIMKgIEdFVDwvZm9udD48L2Rpdj4KPGRpdj48Zm9u dCBjbGFzcz0iQXBwbGUtc3R5bGUtc3BhbiIgZmFjZT0iJiMzOTtjb3VyaWV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GxpbmUuPC9kaXY+CgoKPGRpdj48YnI+PC9kaXY+PGZv bnQgY29sb3I9IiM4ODg4ODgiPjxkaXY+LSBqZXJlbXk8L2Rpdj48L2ZvbnQ+PC9kaXY+PC9kaXY+ CjwvYmxvY2txdW90ZT48L2Rpdj48L2Rpdj48YnI+PGRpdj5UaGFua3MgZm9yIGNhdGNoaW5nIHRo YXQsIGJ1ZyBmaXggaXMgKGFzIHlvdSBjYW4gaW1hZ2luZSkganVzdCBvbmUgbGluZTsgSSYjMzk7 bGwgdXBsb2FkIHdoZW4gSSBoYXZlIGEgZnJlZSBtb21lbnQuPC9kaXY+PGRpdj48YnI+PC9kaXY+ PGZvbnQgY29sb3I9IiM4ODg4ODgiPjxkaXY+TWljaGFlbDwvZGl2Pgo8L2ZvbnQ+PC9ibG9ja3F1 b3RlPjwvZGl2Pjxicj48L2Rpdj4K --===============3777344051027428688==-- From jeremy@n-heptane.com Thu Apr 1 14:42:20 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Thu, 01 Apr 2010 13:13:46 -0600 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6150876192902954123==" --===============6150876192902954123== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Thu, Apr 1, 2010 at 12:19 PM, Michael Snoyman wrote: > Minor update: I think that YAML syntax for these kinds of routes is a > little bit verbose; any thoughts on this syntax: > > / Home GET > /user/#userid User GET PUT DELETE > /static Static StaticRoutes staticRoutes > /foo/*slurp Foo > /bar/$barparam Bar > > First column is the pattern, second is the constructor name, and after that > you have three possibilities: > > Nothing is a handler function for any request method. Above, the fourth and > fifth entries. > A list of request methods will allow a handler function for each request > method. Above, the first and second entries. > A datatype and function name, allowing a subsite datatype and subsite > function. Above,the third entry. I'll need to develop this one a bit more. > How would this pattern be translated to the new scheme ? /entries/$entryId/$filename: GET: media I am guessing: /entries/$entryId/$filename Media GET And the Media constructor would be: | Media String String ? - jeremy /entries/$entryId/$filename: --===============6150876192902954123== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 T24gVGh1LCBBcHIgMSwgMjAxMCBhdCAxMjoxOSBQTSwgTWljaGFlbCBTbm95bWFuIDxzcGFuIGRp cj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFpbHRvOm1pY2hhZWxAc25veW1hbi5jb20iPm1pY2hhZWxA c25veW1hbi5jb208L2E+Jmd0Ozwvc3Bhbj4gd3JvdGU6PGJyPjxkaXYgY2xhc3M9ImdtYWlsX3F1 b3RlIj48YmxvY2txdW90ZSBjbGFzcz0iZ21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46MCAwIDAg LjhleDtib3JkZXItbGVmdDoxcHggI2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4OyI+Ck1pbm9y IHVwZGF0ZTogSSB0aGluayB0aGF0IFlBTUwgc3ludGF4IGZvciB0aGVzZSBraW5kcyBvZiByb3V0 ZXMgaXMgYSBsaXR0bGUgYml0IHZlcmJvc2U7IGFueSB0aG91Z2h0cyBvbiB0aGlzIHN5bnRheDo8 ZGl2Pjxicj48L2Rpdj48ZGl2PjxkaXY+PGZvbnQgZmFjZT0iJiMzOTtjb3VyaWVyIG5ldyYjMzk7 LCBtb25vc3BhY2UiPi8goCCgIKAgoCCgIKAgoCCgIKAgoEhvbWUgoCCgIKAgR0VUPC9mb250Pjwv ZGl2PgoKPGRpdj48Zm9udCBmYWNlPSImIzM5O2NvdXJpZXIgbmV3JiMzOTssIG1vbm9zcGFjZSI+ L3VzZXIvI3VzZXJpZCCgIKAgoCCgVXNlciCgIKAgoCBHRVQgUFVUIERFTEVURTwvZm9udD48L2Rp dj48ZGl2Pjxmb250IGZhY2U9IiYjMzk7Y291cmllciBuZXcmIzM5OywgbW9ub3NwYWNlIj4vc3Rh dGljIKAgoCCgIKAgoCCgIKBTdGF0aWMgoCCgIFN0YXRpY1JvdXR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HdvdWxkIHRoaXMgcGF0dGVybiBiZSB0cmFuc2xhdGVkIHRvIHRoZSBu ZXcgc2NoZW1lID88L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PqAvZW50cmllcy8kZW50cnlJZC8k ZmlsZW5hbWU6PC9kaXY+PGRpdj6goCCgR0VUOiBtZWRpYTwvZGl2PjxkaXY+PGJyPjwvZGl2Pjxk aXY+SSBhbSBndWVzc2luZzo8L2Rpdj48ZGl2Pjxicj4KPC9kaXY+PGRpdj4vZW50cmllcy8kZW50 cnlJZC8kZmlsZW5hbWUgoCCgTWVkaWEgoCCgR0VUPC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5B bmQgdGhlIE1lZGlhIGNvbnN0cnVjdG9yIHdvdWxkIGJlOjwvZGl2PjxkaXY+oDwvZGl2PjxkaXY+ oKAgfCBNZWRpYSBTdHJpbmcgU3RyaW5noDwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+PzwvZGl2 PjxkaXY+PGJyPjwvZGl2PjxkaXY+LSBqZXJlbXk8L2Rpdj4KPGRpdj48YnI+PC9kaXY+PGRpdj6g L2VudHJpZXMvJGVudHJ5SWQvJGZpbGVuYW1lOjwvZGl2PjxkaXY+PGJyPjwvZGl2PjwvZGl2Pgo= --===============6150876192902954123==-- From michael@snoyman.com Thu Apr 1 16:55:35 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Thu, 01 Apr 2010 14:27:02 -0700 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6785299956830657794==" --===============6785299956830657794== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Thu, Apr 1, 2010 at 12:13 PM, Jeremy Shaw wrote: > On Thu, Apr 1, 2010 at 12:19 PM, Michael Snoyman wrote: > >> Minor update: I think that YAML syntax for these kinds of routes is a >> little bit verbose; any thoughts on this syntax: >> >> / Home GET >> /user/#userid User GET PUT DELETE >> /static Static StaticRoutes staticRoutes >> /foo/*slurp Foo >> /bar/$barparam Bar >> >> First column is the pattern, second is the constructor name, and after >> that you have three possibilities: >> >> Nothing is a handler function for any request method. Above, the fourth >> and fifth entries. >> A list of request methods will allow a handler function for each request >> method. Above, the first and second entries. >> A datatype and function name, allowing a subsite datatype and subsite >> function. Above,the third entry. I'll need to develop this one a bit more. >> > > How would this pattern be translated to the new scheme ? > > /entries/$entryId/$filename: > GET: media > > I am guessing: > > /entries/$entryId/$filename Media GET > > And the Media constructor would be: > > | Media String String > > ? > > - jeremy > > /entries/$entryId/$filename: > > Exactly, with the dispatch function being: getMedia :: String -> String -> Application (Actually, there's most likely going to be some type of argument datatype as well, which is where the complication I alluded to with subsites comes from. However, I'll address this more clearly when there's some actual code to back it up.) Michael --===============6785299956830657794== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gVGh1LCBBcHIgMSwgMjAxMCBhdCAx MjoxMyBQTSwgSmVyZW15IFNoYXcgPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWlsdG86 amVyZW15QG4taGVwdGFuZS5jb20iPmplcmVteUBuLWhlcHRhbmUuY29tPC9hPiZndDs8L3NwYW4+ IHdyb3RlOjxicj48YmxvY2txdW90ZSBjbGFzcz0iZ21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46 MCAwIDAgLjhleDtib3JkZXItbGVmdDoxcHggI2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4OyI+ CjxkaXYgY2xhc3M9ImltIj5PbiBUaHUsIEFwciAxLCAyMDEwIGF0IDEyOjE5IFBNLCBNaWNoYWVs IFNub3ltYW4gPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWlsdG86bWljaGFlbEBzbm95 bWFuLmNvbSIgdGFyZ2V0PSJfYmxhbmsiPm1pY2hhZWxA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bCBhZGRyZXNzIHRoaXMgbW9yZSBjbGVhcmx5IHdo ZW4gdGhlcmUmIzM5O3Mgc29tZSBhY3R1YWwgY29kZSB0byBiYWNrIGl0IHVwLik8L2Rpdj4KPGRp dj48YnI+PC9kaXY+PGRpdj5NaWNoYWVsPC9kaXY+Cg== --===============6785299956830657794==-- From michael@snoyman.com Fri Apr 2 18:20:24 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: [web-devel] web-routes-quasi Date: Fri, 02 Apr 2010 15:51:54 -0700 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1088160018292516899==" --===============1088160018292516899== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit web-routes-quasi is now at the point where it can be used for sites, and I'd love to hear some feedback. I've put together a little sample that demonstrates how you can use quasi-quoting and define your routes, embed subsites and serve the resulting application via WAI. (My example uses WAI, but the package itself is not tied to WAI.) The code is on github[1]; the main function for the blog is in blog.hs (with the lowercase b). I believe this just depends on Jeremy's web-routes package, wai and wai-extra. Note that I did not use web-routes-wai; I think there are some problems in there for breaking up the pathinfo, and I didn't have time to dig through it. Also, this package currently ignores entirely the defaultPage component of Site, though if there is desire support can be added for it. One minor bug is that you can't have an alternate GET, POST, PUT or DELETE constructor imported; hopefully that will get cleaned up. Any comments and suggestions are welcome! My goal is to port Yesod over to this as soon as the web-routes set of packages are released, so if you're interested in Yesod, you should be interested in this too ;). Michael [1] http://github.com/snoyberg/web-routes-quasi --===============1088160018292516899== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 d2ViLXJvdXRlcy1xdWFzaSBpcyBub3cgYXQgdGhlIHBvaW50IHdoZXJlIGl0IGNhbiBiZSB1c2Vk IGZvciBzaXRlcywgYW5kIEkmIzM5O2QgbG92ZSB0byBoZWFyIHNvbWUgZmVlZGJhY2suIEkmIzM5 O3ZlIHB1dCB0b2dldGhlciBhIGxpdHRsZSBzYW1wbGUgdGhhdCBkZ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GVybmF0ZSBHRVQsIFBPU1QsIFBVVCBvciBERUxFVEUgY29u c3RydWN0b3IgaW1wb3J0ZWQ7IGhvcGVmdWxseSB0aGF0IHdpbGwgZ2V0IGNsZWFuZWQgdXAuPC9k aXY+PGRpdj48YnI+PC9kaXY+PGRpdj5BbnkgY29tbWVudHMgYW5kIHN1Z2dlc3Rpb25zIGFyZSB3 ZWxjb21lISBNeSBnb2FsIGlzIHRvIHBvcnQgWWVzb2Qgb3ZlciB0byB0aGlzIGFzIHNvb24gYXMg dGhlIHdlYi1yb3V0ZXMgc2V0IG9mIHBhY2thZ2VzIGFyZSByZWxlYXNlZCwgc28gaWYgeW91JiMz OTtyZSBpbnRlcmVzdGVkIGluIFllc29kLCB5b3Ugc2hvdWxkIGJlIGludGVyZXN0ZWQgaW4gdGhp cyB0b28gOykuPC9kaXY+CjxkaXY+PGJyPjwvZGl2PjxkaXY+TWljaGFlbDwvZGl2PjxkaXY+PGJy PjwvZGl2PjxkaXY+WzFdwqA8YSBocmVmPSJodHRwOi8vZ2l0aHViLmNvbS9zbm95YmVyZy93ZWIt cm91dGVzLXF1YXNpIj5odHRwOi8vZ2l0aHViLmNvbS9zbm95YmVyZy93ZWItcm91dGVzLXF1YXNp PC9hPjwvZGl2Pgo= --===============1088160018292516899==-- From thaldyron@gmail.com Sat Apr 3 12:21:51 2010 From: Peter Robinson To: web-devel@haskell.org Subject: Re: [web-devel] web-routes-quasi Date: Sat, 03 Apr 2010 18:53:03 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6593827264792579961==" --===============6593827264792579961== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Nice work! Is there a specific reason for excluding HEAD and OPTIONS? Peter On 3 April 2010 00:51, Michael Snoyman wrote: > web-routes-quasi is now at the point where it can be used for sites, and I'd > love to hear some feedback. I've put together a little sample that > demonstrates how you can use quasi-quoting and define your routes, embed > subsites and serve the resulting application via WAI. (My example uses WAI, > but the package itself is not tied to WAI.) > The code is on github[1]; the main function for the blog is in blog.hs (with > the lowercase b). I believe this just depends on Jeremy's web-routes > package, wai and wai-extra. > Note that I did not use web-routes-wai; I think there are some problems in > there for breaking up the pathinfo, and I didn't have time to dig through > it. Also, this package currently ignores entirely the defaultPage component > of Site, though if there is desire support can be added for it. > One minor bug is that you can't have an alternate GET, POST, PUT or DELETE > constructor imported; hopefully that will get cleaned up. > Any comments and suggestions are welcome! My goal is to port Yesod over to > this as soon as the web-routes set of packages are released, so if you're > interested in Yesod, you should be interested in this too ;). > Michael > [1] http://github.com/snoyberg/web-routes-quasi > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > > --===============6593827264792579961==-- From simon.hengel@wiktory.org Sat Apr 3 14:04:34 2010 From: Simon Hengel To: web-devel@haskell.org Subject: Re: [web-devel] A separation of concerns Date: Sat, 03 Apr 2010 20:36:03 +0200 Message-ID: <20100403183603.GB10131@x200> In-Reply-To: <7A24642C-D3FF-481E-9B0B-204C5F85DF01@eidhof.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7193769806439673170==" --===============7193769806439673170== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > My point is: we should not try to build one big framework. Instead, I > propose that we build a set of smaller libraries that each do one > thing very well. Some of these libraries might be designed to work > together. I absolutely agree with that. > I personally think MVC is a perfect fit for the web: model code > handles data storage, view code handles HTML/JSON/XML and the > controller coordinates between these. Have you read about the "View First" approach of Lift[1]? While I do not like the monolithic approach of Lift, I really like that specific aspect. I'd not narrow my view on "Rails-Style MVC" right now. Cheers, Simon [1] http://wiki.liftweb.net/index.php?title=Lift_View_First --===============7193769806439673170==-- From chris@eidhof.nl Sat Apr 3 16:03:14 2010 From: Chris Eidhof To: web-devel@haskell.org Subject: Re: [web-devel] A separation of concerns Date: Sat, 03 Apr 2010 22:34:41 +0200 Message-ID: In-Reply-To: <20100403183603.GB10131@x200> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5928328619205864801==" --===============5928328619205864801== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On 3 apr 2010, at 20:36, Simon Hengel wrote: >> My point is: we should not try to build one big framework. Instead, I >> propose that we build a set of smaller libraries that each do one >> thing very well. Some of these libraries might be designed to work >> together. >=20 > I absolutely agree with that. >=20 >> I personally think MVC is a perfect fit for the web: model code >> handles data storage, view code handles HTML/JSON/XML and the >> controller coordinates between these. >=20 > Have you read about the "View First" approach of Lift[1]? While I do not > like the monolithic approach of Lift, I really like that specific > aspect. I'd not narrow my view on "Rails-Style MVC" right now. I have not really looked in to it before, the lift documentation always confu= ses me, but it looks very interesting! I really like the philosophy behind StringTemplate. I think something similar= could be done by restricting a view to be |a -> HTML|. Do you think that's e= nough? Or should there be more restrictions? -chris --===============5928328619205864801==-- From chris@eidhof.nl Sat Apr 3 16:06:14 2010 From: Chris Eidhof To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Sat, 03 Apr 2010 22:37:45 +0200 Message-ID: <5448F2D8-6710-4035-8CCA-20B1CE784FEA@eidhof.nl> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3450154178335318957==" --===============3450154178335318957== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable I'm sorry that I didn't have time to read and reply to everything, but Michae= l, if you decide to go the TH way, why use an intermediate datatype at all? W= hy not just map the /user/#userid directly to a |handleUser| function? I guess it's really a matter of personal preference. I don't really like TH, = and try to avoid it as much as possible (which is why I did the Regular stuff= ). However, once you go TH, you can go all the way. -chris On 1 apr 2010, at 23:27, Michael Snoyman wrote: >=20 >=20 > On Thu, Apr 1, 2010 at 12:13 PM, Jeremy Shaw wrote: > On Thu, Apr 1, 2010 at 12:19 PM, Michael Snoyman wrot= e: > Minor update: I think that YAML syntax for these kinds of routes is a littl= e bit verbose; any thoughts on this syntax: >=20 > / Home GET > /user/#userid User GET PUT DELETE > /static Static StaticRoutes staticRoutes > /foo/*slurp Foo > /bar/$barparam Bar >=20 > First column is the pattern, second is the constructor name, and after that= you have three possibilities: >=20 > Nothing is a handler function for any request method. Above, the fourth and= fifth entries. > A list of request methods will allow a handler function for each request me= thod. Above, the first and second entries. > A datatype and function name, allowing a subsite datatype and subsite funct= ion. Above,the third entry. I'll need to develop this one a bit more. >=20 > How would this pattern be translated to the new scheme ? >=20 > /entries/$entryId/$filename: > GET: media >=20 > I am guessing: >=20 > /entries/$entryId/$filename Media GET >=20 > And the Media constructor would be: > =20 > | Media String String=20 >=20 > ? >=20 > - jeremy >=20 > /entries/$entryId/$filename: >=20 >=20 > Exactly, with the dispatch function being: >=20 > getMedia :: String -> String -> Application >=20 > (Actually, there's most likely going to be some type of argument datatype a= s well, which is where the complication I alluded to with subsites comes from= . However, I'll address this more clearly when there's some actual code to ba= ck it up.) >=20 > Michael --===============3450154178335318957==-- From john.m.bender@gmail.com Sat Apr 3 16:57:15 2010 From: John Bender To: web-devel@haskell.org Subject: Re: [web-devel] A separation of concerns Date: Sat, 03 Apr 2010 14:28:17 -0700 Message-ID: In-Reply-To: <20100403183603.GB10131@x200> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5484284055055212056==" --===============5484284055055212056== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Simon, While I don't have any hands on experience with Lift's approach to templating it looks a lot like asp.net databinding/templates and from my experience with that toolset it ends up being a cumbersome solution to the problem of separating controller and view. I don't necessarily think mixing code into your views is the "one true way" either, but what you sacrifice in controller code clarity seems to outweigh any gains from separating the two so strictly. As an example from http://liftweb.net/docs/getting_started/mod_master.html#x1-130002.7 :
    Exclude done
    • To Do
    private def doList(reDraw: () => JsCmd)(html: NodeSeq): NodeSeq = toShow. flatMap(td => bind("todo", html, "check" -> ajaxCheckbox(td.done, v => {td.done(v).save; reDraw()}), "priority" -> ajaxSelect(ToDo.priorityList, Full(td.priority.toString), v => {td.priority(v.toInt).save; reDraw()}), "desc" -> desc(td, reDraw) )) In the above you'll notice that the bind has direct reference to elements in the template, so I think its fair to say you've moved some of your template mixing from view to the controller. From the docs "This method calls toShow to get the list of to-do items to show. Using the flatMap method, we iterate over each to-do item and binding the item to the incoming html." In addition I think the result is something thats harder for people to grok. When reading loops and control flow constructs from a programming language in a template its immediately familiar. When binding data into a template, at the very least, the code you need to reference exists in two separate places but interacts very very intimately. Again, I'm not saying that the current practice of writing code into the template should be the final solution. You could make the case that Haskell is better at parsing and handling text for whatever purpose (databinding or otherwise) than almost any other language and that, as a result, it would be better equipped to handle controller side manipulation of xhtml. In addition this might allow you to better leverage the type system. Personally I think if your going to be mucking around with html/xhtml a bit of haskell won't make it much worse :D All, To contribute something positive here, I would really like to see HAML become the goto template system of choice for haskell web dev if only because the syntax meshes well (indentation, terseness) and there's an enormous sea of web developers already familiar with its use and best practice. One less thing to worry about when learning webdev in haskell. Best John Disclaimer: I am an experienced web developer but I'm relatively new to Haskell. If there is some aspect of the language, unknown to me, that makes the Lift templating/databinding system much more effective feel free to ignore. On Sat, Apr 3, 2010 at 11:36 AM, Simon Hengel wrote: > > My point is: we should not try to build one big framework. Instead, I > > propose that we build a set of smaller libraries that each do one > > thing very well. Some of these libraries might be designed to work > > together. > > I absolutely agree with that. > > > I personally think MVC is a perfect fit for the web: model code > > handles data storage, view code handles HTML/JSON/XML and the > > controller coordinates between these. > > Have you read about the "View First" approach of Lift[1]? While I do not > like the monolithic approach of Lift, I really like that specific > aspect. I'd not narrow my view on "Rails-Style MVC" right now. > > Cheers, > Simon > > [1] http://wiki.liftweb.net/index.php?title=Lift_View_First > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > --===============5484284055055212056== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdj5TaW1vbiw8L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PldoaWxlIEkgZG9uJiMzOTt0IGhh dmUgYW55IGhh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IgdGFyZ2V0PSJfYmxhbmsiPmh0dHA6Ly93aWtpLmxpZnR3ZWIubmV0L2luZGV4 LnBocD90aXRsZT1MaWZ0X1ZpZXdfRmlyc3Q8L2E+PGJyPgpfX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fXzxicj4Kd2ViLWRldmVsIG1haWxpbmcgbGlzdDxicj4K PGEgaHJlZj0ibWFpbHRvOndlYi1kZXZlbEBoYXNrZWxsLm9yZyIgdGFyZ2V0PSJfYmxhbmsiPndl Yi1kZXZlbEBoYXNrZWxsLm9yZzwvYT48YnI+CjxhIGhyZWY9Imh0dHA6Ly93d3cuaGFza2VsbC5v cmcvbWFpbG1hbi9saXN0aW5mby93ZWItZGV2ZWwiIHRhcmdldD0iX2JsYW5rIj5odHRwOi8vd3d3 Lmhhc2tlbGwub3JnL21haWxtYW4vbGlzdGluZm8vd2ViLWRldmVsPC9hPjxicj4KPC9ibG9ja3F1 b3RlPjwvZGl2Pjxicj48L2Rpdj48L2Rpdj48L2Rpdj4K --===============5484284055055212056==-- From jeremy@n-heptane.com Sat Apr 3 19:08:18 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Type-safe URL handling Date: Sat, 03 Apr 2010 18:38:51 -0500 Message-ID: In-Reply-To: <5448F2D8-6710-4035-8CCA-20B1CE784FEA@eidhof.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7916449962868620554==" --===============7916449962868620554== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Apr 3, 2010, at 3:37 PM, Chris Eidhof wrote: > I'm sorry that I didn't have time to read and reply to everything, > but Michael, if you decide to go the TH way, why use an intermediate > datatype at all? Why not just map the /user/#userid directly to a | > handleUser| function? That is what the version in yesod does. But there is second part to the problem. In your code where you use the URLs, you want to be able to ensure that you are only generating valid urls. That is where the type / web-routes comes into play. Let me know if you want more explanation. - jeremy --===============7916449962868620554==-- From michael@snoyman.com Sun Apr 4 12:44:27 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] web-routes-quasi Date: Sun, 04 Apr 2010 10:16:03 -0700 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7768814464323349708==" --===============7768814464323349708== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Because I want to eventually get rid of the Method datatype entirely and allow arbitrary methods ;). Michael On Sat, Apr 3, 2010 at 9:53 AM, Peter Robinson wrote: > Nice work! > > Is there a specific reason for excluding HEAD and OPTIONS? > > Peter > > On 3 April 2010 00:51, Michael Snoyman wrote: > > web-routes-quasi is now at the point where it can be used for sites, and > I'd > > love to hear some feedback. I've put together a little sample that > > demonstrates how you can use quasi-quoting and define your routes, embed > > subsites and serve the resulting application via WAI. (My example uses > WAI, > > but the package itself is not tied to WAI.) > > The code is on github[1]; the main function for the blog is in blog.hs > (with > > the lowercase b). I believe this just depends on Jeremy's web-routes > > package, wai and wai-extra. > > Note that I did not use web-routes-wai; I think there are some problems > in > > there for breaking up the pathinfo, and I didn't have time to dig through > > it. Also, this package currently ignores entirely the defaultPage > component > > of Site, though if there is desire support can be added for it. > > One minor bug is that you can't have an alternate GET, POST, PUT or > DELETE > > constructor imported; hopefully that will get cleaned up. > > Any comments and suggestions are welcome! My goal is to port Yesod over > to > > this as soon as the web-routes set of packages are released, so if you're > > interested in Yesod, you should be interested in this too ;). > > Michael > > [1] http://github.com/snoyberg/web-routes-quasi > > _______________________________________________ > > web-devel mailing list > > web-devel@haskell.org > > http://www.haskell.org/mailman/listinfo/web-devel > > > > > --===============7768814464323349708== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 QmVjYXVzZSBJIHdhbnQgdG8gZXZlbnR1YWxseSBnZXQgcmlkIG9mIHRoZSBNZXRob2QgZGF0YXR5 cGUgZW50aXJlbHkgYW5kIGFsbG93IGFyYml0cmFyeSBtZXRob2RzIDspLjxkaXY+PGJyPjw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9yZy9tYWlsbWFuL2xpc3RpbmZvL3dlYi1kZXZlbDwv YT48YnI+CiZndDs8YnI+CiZndDs8YnI+CjwvZGl2PjwvZGl2PjwvYmxvY2txdW90ZT48L2Rpdj48 YnI+PC9kaXY+Cg== --===============7768814464323349708==-- From michael@snoyman.com Sun Apr 4 13:42:10 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: [web-devel] WAI 0.2.0 begun Date: Sun, 04 Apr 2010 11:13:46 -0700 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6686065718471381462==" --===============6686065718471381462== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Well, to follow up on the WAI improvement thread: I've just pushed the first commit for WAI 0.2.0; this commit makes request and response headers case-insensitive. I'm in no rush to make this release, so if anyone has some changes they'd like to see, please let me know (are just send a patch). http://github.com/snoyberg/wai Michael --===============6686065718471381462== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 V2VsbCwgdG8gZm9sbG93IHVwIG9uIHRoZSBXQUkgaW1wcm92ZW1lbnQgdGhyZWFkOiBJJiMzOTt2 ZSBqdXN0IHB1c2hlZCB0aGUgZmlyc3QgY29tbWl0IGZvciBXQUkgMC4yLjA7IHRoaXMgY29tbWl0 IG1ha2VzIHJlcXVlc3QgYW5kIHJlc3BvbnNlIGhlYWRlcnMgY2FzZS1pbnNlbnNpdGl2ZS4gSSYj Mzk7bSBpbiBubyBydXNoIHRvIG1ha2UgdGhpcyByZWxlYXNlLCBzbyBpZiBhbnlvbmUgaGFzIHNv bWUgY2hhbmdlcyB0aGV5JiMzOTtkIGxpa2UgdG8gc2VlLCBwbGVhc2UgbGV0IG1lIGtub3cgKGFy ZSBqdXN0IHNlbmQgYSBwYXRjaCkuPGRpdj4KPGJyPjwvZGl2PjxkaXY+PGEgaHJlZj0iaHR0cDov L2dpdGh1Yi5jb20vc25veWJlcmcvd2FpIj5odHRwOi8vZ2l0aHViLmNvbS9zbm95YmVyZy93YWk8 L2E+PGJyPjxkaXY+PGJyPjwvZGl2PjxkaXY+TWljaGFlbDwvZGl2PjwvZGl2Pgo= --===============6686065718471381462==-- From michael@snoyman.com Sun Apr 4 14:02:44 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] web-routes-quasi Date: Sun, 04 Apr 2010 11:34:19 -0700 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1350546392300969877==" --===============1350546392300969877== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ... and now that's done :-). You can use whatever methods you want now, and it also solves the annoying issue when importing both Web.Routes.Quasi and Network.Wai. Michael On Sun, Apr 4, 2010 at 10:16 AM, Michael Snoyman wrote: > Because I want to eventually get rid of the Method datatype entirely and > allow arbitrary methods ;). > > Michael > > > On Sat, Apr 3, 2010 at 9:53 AM, Peter Robinson wrote: > >> Nice work! >> >> Is there a specific reason for excluding HEAD and OPTIONS? >> >> Peter >> >> On 3 April 2010 00:51, Michael Snoyman wrote: >> > web-routes-quasi is now at the point where it can be used for sites, and >> I'd >> > love to hear some feedback. I've put together a little sample that >> > demonstrates how you can use quasi-quoting and define your routes, embed >> > subsites and serve the resulting application via WAI. (My example uses >> WAI, >> > but the package itself is not tied to WAI.) >> > The code is on github[1]; the main function for the blog is in blog.hs >> (with >> > the lowercase b). I believe this just depends on Jeremy's web-routes >> > package, wai and wai-extra. >> > Note that I did not use web-routes-wai; I think there are some problems >> in >> > there for breaking up the pathinfo, and I didn't have time to dig >> through >> > it. Also, this package currently ignores entirely the defaultPage >> component >> > of Site, though if there is desire support can be added for it. >> > One minor bug is that you can't have an alternate GET, POST, PUT or >> DELETE >> > constructor imported; hopefully that will get cleaned up. >> > Any comments and suggestions are welcome! My goal is to port Yesod over >> to >> > this as soon as the web-routes set of packages are released, so if >> you're >> > interested in Yesod, you should be interested in this too ;). >> > Michael >> > [1] http://github.com/snoyberg/web-routes-quasi >> > _______________________________________________ >> > web-devel mailing list >> > web-devel@haskell.org >> > http://www.haskell.org/mailman/listinfo/web-devel >> > >> > >> > > --===============1350546392300969877== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 Li4uIGFuZCBub3cgdGhhdCYjMzk7cyBkb25lIDotKS4gWW91IGNhbiB1c2Ugd2hhdGV2ZXIgbWV0 aG9kcyB5b3Ugd2FudCBub3csIGFuZCBpdCBhbHNvIHNvbHZlcyB0aGUgYW5ub3lpbmcgaXNzdWUg d2hlbiBpbXBvcnRpbmcgYm90aCBXZWIuUm91dGVzLlF1YXNpIGFuZCBOZXR3b3JrLldhaS48ZGl2 Pjxicj48L2Rpdj48ZGl2Pk1pY2hhZWw8YnI+PGJyPjxkaXYgY2xhc3M9ImdtYWlsX3F1b3RlIj4K T24gU3VuLCBBcHIgNCwgMjAxMCBhdCAxMDoxNiBBTSwgTWljaGFlbCBTbm95bWFuIDxzcGFuIGRp cj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFpbHRvOm1pY2hhZWxAc25veW1hbi5jb20iPm1pY2hhZWxA c25veW1hbi5jb208L2E+Jmd0Ozwvc3Bhbj4gd3JvdGU6PGJyPjxibG9ja3F1b3RlIGNsYXNzPSJn bWFpbF9xdW90ZSIgc3R5bGU9Im1hcmdpbjowIDAgMCAuOGV4O2JvcmRlci1sZWZ0OjFweCAjY2Nj IHNvbGlkO3BhZGRpbmctbGVmdDoxZXg7Ij4KQmVjYXVzZSBJIHdhbnQgdG8gZXZlbnR1YWxseSBn ZXQgcmlkIG9mIHRoZSBNZXRob2QgZGF0YXR5cGUgZW50aXJlbHkgYW5kIGFsbG93IGFyYml0cmFy eSBtZXRob2RzIDspLjxkaXY+PGJyPjwvZGl2PjxkaXY+PGZvbnQgY29sb3I9IiM4ODg4ODgiPk1p Y2hhZWw8L2ZvbnQ+PGRpdj48ZGl2PjwvZGl2PjxkaXYgY2xhc3M9Img1Ij48YnI+PGJyPjxkaXYg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mZvL3dlYi1kZXZlbDwv YT48YnI+CiZndDs8YnI+CiZndDs8YnI+CjwvZGl2PjwvZGl2PjwvYmxvY2txdW90ZT48L2Rpdj48 YnI+PC9kaXY+PC9kaXY+PC9kaXY+CjwvYmxvY2txdW90ZT48L2Rpdj48YnI+PC9kaXY+Cg== --===============1350546392300969877==-- From rhapsodyv@gmail.com Sun Apr 4 15:05:04 2010 From: Victor Mateus Oliveira To: web-devel@haskell.org Subject: Re: [web-devel] A separation of concerns Date: Sun, 04 Apr 2010 16:36:39 -0300 Message-ID: In-Reply-To: <20100403183603.GB10131@x200> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7652260594255187547==" --===============7652260594255187547== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit I've worked with the Yii[1] framework for php. This "view first" approach seems to me like the Widgets[2] of the Yii. The widget keeps the logic of the view. The Yii uses a Rails like MVC with a better template using this widgets. []s Victor [1] http://www.yiiframework.com/ [2] http://www.yiiframework.com/doc/guide/basics.view On Sat, Apr 3, 2010 at 3:36 PM, Simon Hengel wrote: >> My point is: we should not try to build one big framework. Instead, I >> propose that we build a set of smaller libraries that each do one >> thing very well. Some of these libraries might be designed to work >> together. > > I absolutely agree with that. > >> I personally think MVC is a perfect fit for the web: model code >> handles data storage, view code handles HTML/JSON/XML and the >> controller coordinates between these. > > Have you read about the "View First" approach of Lift[1]? While I do not > like the monolithic approach of Lift, I really like that specific > aspect. I'd not narrow my view on "Rails-Style MVC" right now. > > Cheers, > Simon > > [1] http://wiki.liftweb.net/index.php?title=Lift_View_First > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > -- GNU/Linux user #446397 - http://counter.li.org --===============7652260594255187547==-- From john.m.bender@gmail.com Sun Apr 4 16:50:02 2010 From: John Bender To: web-devel@haskell.org Subject: Re: [web-devel] A separation of concerns Date: Sun, 04 Apr 2010 14:21:38 -0700 Message-ID: In-Reply-To: <20100403183603.GB10131@x200> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2512387158712270952==" --===============2512387158712270952== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Simon, I posted the following to the mailing list yesterday but it has been awaiting moderation since then and I would like to contribute something to the conversation https://gist.github.com/118dc4cd9d8223c33f63 I hope reading it at that link isn't too troublesome. Best John On Sat, Apr 3, 2010 at 11:36 AM, Simon Hengel wrote: > > My point is: we should not try to build one big framework. Instead, I > > propose that we build a set of smaller libraries that each do one > > thing very well. Some of these libraries might be designed to work > > together. > > I absolutely agree with that. > > > I personally think MVC is a perfect fit for the web: model code > > handles data storage, view code handles HTML/JSON/XML and the > > controller coordinates between these. > > Have you read about the "View First" approach of Lift[1]? While I do not > like the monolithic approach of Lift, I really like that specific > aspect. I'd not narrow my view on "Rails-Style MVC" right now. > > Cheers, > Simon > > [1] http://wiki.liftweb.net/index.php?title=Lift_View_First > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > --===============2512387158712270952== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 U2ltb24soDxkaXY+PGJyPjwvZGl2PjxkaXY+SSBwb3N0ZWQgdGhlIGZvbGxvd2luZyB0byB0aGUg bWFpbGluZyBsaXN0IHllc3RlcmRheSBidXQgaXQgaGFzIGJlZW4gYXdhaXRpbmcgbW9kZXJhdGlv biBzaW5jZSB0aGVuIGFuZCBJIHdvdWxkIGxpa2UgdG8gY29udHJpYnV0ZSBzb21ldGhpbmcgdG8g dGhlIGNvbnZlcnNhdGlvbqA8L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PjxhIGhyZWY9Imh0dHBz Oi8vZ2lzdC5naXRodWIuY29tLzExOGRjNGNkOWQ4MjIzYzMzZjYzIj5odHRwczovL2dpc3QuZ2l0 aHViLmNvbS8xMThkYzRjZDlkODIyM2MzM2Y2MzwvYT48L2Rpdj4KPGRpdj48YnI+PC9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wOi8vd3d3Lmhhc2tlbGwub3JnL21h aWxtYW4vbGlzdGluZm8vd2ViLWRldmVsIiB0YXJnZXQ9Il9ibGFuayI+aHR0cDovL3d3dy5oYXNr ZWxsLm9yZy9tYWlsbWFuL2xpc3RpbmZvL3dlYi1kZXZlbDwvYT48YnI+CjwvYmxvY2txdW90ZT48 L2Rpdj48YnI+PC9kaXY+Cg== --===============2512387158712270952==-- From spam@scientician.net Mon Apr 5 05:23:28 2010 From: Bardur Arantsson To: web-devel@haskell.org Subject: [web-devel] Re: A separation of concerns Date: Mon, 05 Apr 2010 11:49:50 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6016740328655960259==" --===============6016740328655960259== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 2010-04-03 23:28, John Bender wrote: > Simon, > > While I don't have any hands on experience with Lift's approach to > templating it looks a lot like asp.net databinding/templates and from my > experience with that toolset it ends up being a cumbersome solution to the > problem of separating controller and view. I don't necessarily think mixing > code into your views is the "one true way" either, but what you sacrifice in > controller code clarity seems to outweigh any gains from separating the two > so strictly. > > As an example from > http://liftweb.net/docs/getting_started/mod_master.html#x1-130002.7 : > > >
    >
    Exclude done
    >
      > >
    • > > > > > To Do >
    • >
      >
    >
    >
    > > private def doList(reDraw: () => JsCmd)(html: NodeSeq): NodeSeq = > toShow. > flatMap(td => > bind("todo", html, > "check" -> ajaxCheckbox(td.done, > v => {td.done(v).save; reDraw()}), > "priority" -> > ajaxSelect(ToDo.priorityList, Full(td.priority.toString), > v => {td.priority(v.toInt).save; reDraw()}), > "desc" -> desc(td, reDraw) > )) > > In the above you'll notice that the bind has direct reference to elements in > the template, so I think its fair to say you've moved some of your template > mixing from view to the controller. From the docs > Disclaimer: I've only done a very simple (and incomplete) application in Liftweb. YMMV. Anyway, regardless of what you do there has to be _some_ connection between the view and the controller (backend) and in my experience, the "View first" approach of Liftweb does a very good job here. A major advantage is that the view is 100% pure XHTML/HTML so that it can be edited in any XML editor. It also contains placeholder data so that most of the layout/design can be done independently of having the actual application running. (That's the theory, anyway. I haven't done this on any sort of large scale, so again YMMV.) The only approach I can think of which would do away with having a binding mechanism would be to generate all the front end HTML/XHTML/JS completely from Haskell. This is great for developers, but not so good for the "web designer" crowd. Cheers, --===============6016740328655960259==-- From thaldyron@gmail.com Tue Apr 6 03:45:29 2010 From: Peter Robinson To: web-devel@haskell.org Subject: Re: [web-devel] web-routes-quasi Date: Tue, 06 Apr 2010 10:16:49 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2566846734449605748==" --===============2566846734449605748== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Again, nice work! :) The web-routes-quasi package makes writing routes quite enjoyable. One thing that I was wondering about is, is it possible to get the list of supported methods (as [String]) for a given url? Peter On 4 April 2010 20:34, Michael Snoyman wrote: > ... and now that's done :-). You can use whatever methods you want now, and > it also solves the annoying issue when importing both Web.Routes.Quasi and > Network.Wai. > Michael > > On Sun, Apr 4, 2010 at 10:16 AM, Michael Snoyman > wrote: >> >> Because I want to eventually get rid of the Method datatype entirely and >> allow arbitrary methods ;). >> Michael >> >> On Sat, Apr 3, 2010 at 9:53 AM, Peter Robinson >> wrote: >>> >>> Nice work! >>> >>> Is there a specific reason for excluding HEAD and OPTIONS? >>> >>>  Peter >>> >>> On 3 April 2010 00:51, Michael Snoyman wrote: >>> > web-routes-quasi is now at the point where it can be used for sites, >>> > and I'd >>> > love to hear some feedback. I've put together a little sample that >>> > demonstrates how you can use quasi-quoting and define your routes, >>> > embed >>> > subsites and serve the resulting application via WAI. (My example uses >>> > WAI, >>> > but the package itself is not tied to WAI.) >>> > The code is on github[1]; the main function for the blog is in blog.hs >>> > (with >>> > the lowercase b). I believe this just depends on Jeremy's web-routes >>> > package, wai and wai-extra. >>> > Note that I did not use web-routes-wai; I think there are some problems >>> > in >>> > there for breaking up the pathinfo, and I didn't have time to dig >>> > through >>> > it. Also, this package currently ignores entirely the defaultPage >>> > component >>> > of Site, though if there is desire support can be added for it. >>> > One minor bug is that you can't have an alternate GET, POST, PUT or >>> > DELETE >>> > constructor imported; hopefully that will get cleaned up. >>> > Any comments and suggestions are welcome! My goal is to port Yesod over >>> > to >>> > this as soon as the web-routes set of packages are released, so if >>> > you're >>> > interested in Yesod, you should be interested in this too ;). >>> > Michael >>> > [1] http://github.com/snoyberg/web-routes-quasi >>> > _______________________________________________ >>> > web-devel mailing list >>> > web-devel@haskell.org >>> > http://www.haskell.org/mailman/listinfo/web-devel >>> > >>> > >> > > --===============2566846734449605748==-- From michael@snoyman.com Tue Apr 6 15:06:44 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] web-routes-quasi Date: Tue, 06 Apr 2010 12:38:27 -0700 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2870518416529986063==" --===============2870518416529986063== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit It's like you read my mind... I very consciously designed this in such a way that it would be possible to do this. More to the point: I think it would be possible to use web-routes-quasi to create a RESTful API and then auto-generate the basic API documentation. I'd like to eventually figure out a way to support GET and POST parameters as well for this. Anyway, for the basic [String] methods, I can add support for it in the future; I'd rather wait until we have the rest of web-routes settled down first. (Of course, a patch is always welcome.) Michael On Tue, Apr 6, 2010 at 1:16 AM, Peter Robinson wrote: > Again, nice work! :) The web-routes-quasi package makes writing routes > quite > enjoyable. One thing that I was wondering about is, is it possible to > get the list of supported methods (as [String]) for a given url? > > Peter > > > On 4 April 2010 20:34, Michael Snoyman wrote: > > ... and now that's done :-). You can use whatever methods you want now, > and > > it also solves the annoying issue when importing both Web.Routes.Quasi > and > > Network.Wai. > > Michael > > > > On Sun, Apr 4, 2010 at 10:16 AM, Michael Snoyman > > wrote: > >> > >> Because I want to eventually get rid of the Method datatype entirely and > >> allow arbitrary methods ;). > >> Michael > >> > >> On Sat, Apr 3, 2010 at 9:53 AM, Peter Robinson > >> wrote: > >>> > >>> Nice work! > >>> > >>> Is there a specific reason for excluding HEAD and OPTIONS? > >>> > >>> Peter > >>> > >>> On 3 April 2010 00:51, Michael Snoyman wrote: > >>> > web-routes-quasi is now at the point where it can be used for sites, > >>> > and I'd > >>> > love to hear some feedback. I've put together a little sample that > >>> > demonstrates how you can use quasi-quoting and define your routes, > >>> > embed > >>> > subsites and serve the resulting application via WAI. (My example > uses > >>> > WAI, > >>> > but the package itself is not tied to WAI.) > >>> > The code is on github[1]; the main function for the blog is in > blog.hs > >>> > (with > >>> > the lowercase b). I believe this just depends on Jeremy's web-routes > >>> > package, wai and wai-extra. > >>> > Note that I did not use web-routes-wai; I think there are some > problems > >>> > in > >>> > there for breaking up the pathinfo, and I didn't have time to dig > >>> > through > >>> > it. Also, this package currently ignores entirely the defaultPage > >>> > component > >>> > of Site, though if there is desire support can be added for it. > >>> > One minor bug is that you can't have an alternate GET, POST, PUT or > >>> > DELETE > >>> > constructor imported; hopefully that will get cleaned up. > >>> > Any comments and suggestions are welcome! My goal is to port Yesod > over > >>> > to > >>> > this as soon as the web-routes set of packages are released, so if > >>> > you're > >>> > interested in Yesod, you should be interested in this too ;). > >>> > Michael > >>> > [1] http://github.com/snoyberg/web-routes-quasi > >>> > _______________________________________________ > >>> > web-devel mailing list > >>> > web-devel@haskell.org > >>> > http://www.haskell.org/mailman/listinfo/web-devel > >>> > > >>> > > >> > > > > > --===============2870518416529986063== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SXQmIzM5O3MgbGlrZSB5b3UgcmVhZCBteSBtaW5kLi4uIEkgdmVyeSBjb25zY2lvdXNseSBkZXNp Z25lZCB0aGlzIGluIHN1Y2ggYSB3YXkgdGhhdCBpdCB3b3VsZCBiZSBwb3NzaWJsZSB0byBkbyB0 aGlzLiBNb3JlIHRvIHRoZSBwb2ludDogSSB0aGluayBpdCB3b3VsZCBiZSBwb3NzaWJsZSB0byB1 c2Ugd2ViLXJvd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skell.org Subject: Re: [web-devel] web-routes-quasi Date: Wed, 07 Apr 2010 15:14:19 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3672635710779229173==" --===============3672635710779229173== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit On 6 April 2010 21:38, Michael Snoyman wrote: > It's like you read my mind... I very consciously designed this in such a way > that it would be possible to do this. More to the point: I think it would be > possible to use web-routes-quasi to create a RESTful API and then > auto-generate the basic API documentation. I'd like to eventually figure out > a way to support GET and POST parameters as well for this. Good to know that we're having similar goals in mind. :) > Anyway, for the basic [String] methods, I can add support for it in the > future; I'd rather wait until we have the rest of web-routes settled down > first. Right that make sense. > (Of course, a patch is always welcome.) I hope I can contribute something at some point. I'll need to brush up my template-haskell skills first however... Peter > On Tue, Apr 6, 2010 at 1:16 AM, Peter Robinson wrote: >> >> Again, nice work! :) The web-routes-quasi package makes writing routes >> quite >> enjoyable. One thing that I was wondering about is, is it possible to >> get the list of supported methods (as [String]) for a given url? >> >>  Peter >> >> >> On 4 April 2010 20:34, Michael Snoyman wrote: >> > ... and now that's done :-). You can use whatever methods you want now, >> > and >> > it also solves the annoying issue when importing both Web.Routes.Quasi >> > and >> > Network.Wai. >> > Michael >> > >> > On Sun, Apr 4, 2010 at 10:16 AM, Michael Snoyman >> > wrote: >> >> >> >> Because I want to eventually get rid of the Method datatype entirely >> >> and >> >> allow arbitrary methods ;). >> >> Michael >> >> >> >> On Sat, Apr 3, 2010 at 9:53 AM, Peter Robinson >> >> wrote: >> >>> >> >>> Nice work! >> >>> >> >>> Is there a specific reason for excluding HEAD and OPTIONS? >> >>> >> >>>  Peter >> >>> >> >>> On 3 April 2010 00:51, Michael Snoyman wrote: >> >>> > web-routes-quasi is now at the point where it can be used for sites, >> >>> > and I'd >> >>> > love to hear some feedback. I've put together a little sample that >> >>> > demonstrates how you can use quasi-quoting and define your routes, >> >>> > embed >> >>> > subsites and serve the resulting application via WAI. (My example >> >>> > uses >> >>> > WAI, >> >>> > but the package itself is not tied to WAI.) >> >>> > The code is on github[1]; the main function for the blog is in >> >>> > blog.hs >> >>> > (with >> >>> > the lowercase b). I believe this just depends on Jeremy's web-routes >> >>> > package, wai and wai-extra. >> >>> > Note that I did not use web-routes-wai; I think there are some >> >>> > problems >> >>> > in >> >>> > there for breaking up the pathinfo, and I didn't have time to dig >> >>> > through >> >>> > it. Also, this package currently ignores entirely the defaultPage >> >>> > component >> >>> > of Site, though if there is desire support can be added for it. >> >>> > One minor bug is that you can't have an alternate GET, POST, PUT or >> >>> > DELETE >> >>> > constructor imported; hopefully that will get cleaned up. >> >>> > Any comments and suggestions are welcome! My goal is to port Yesod >> >>> > over >> >>> > to >> >>> > this as soon as the web-routes set of packages are released, so if >> >>> > you're >> >>> > interested in Yesod, you should be interested in this too ;). >> >>> > Michael >> >>> > [1] http://github.com/snoyberg/web-routes-quasi >> >>> > _______________________________________________ >> >>> > web-devel mailing list >> >>> > web-devel@haskell.org >> >>> > http://www.haskell.org/mailman/listinfo/web-devel >> >>> > >> >>> > >> >> >> > >> > > > --===============3672635710779229173==-- From orclev@gmail.com Wed Apr 7 13:14:40 2010 From: Kyle Murphy To: web-devel@haskell.org Subject: [web-devel] What frameworks are there? Date: Wed, 07 Apr 2010 13:16:22 -0430 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4082520482298700261==" --===============4082520482298700261== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit I'm looking at experimenting with developing a site and due to various constraints I'm considering using one of the haskell frameworks. I experimented a bit with Happstack, although I'm not all that happy with it and I'm interested in alternatives. I've also looked briefly at yesod but it doesn't seem to be very well documented and I've got some concerns. The environment I'm working in has constrained memory, about 300M physical, with a further 500M of swap, but a relatively beefy CPU, so I'm trying to stay away from any of the in memory systems like MACID in happstack. At this point I'm mostly toying with the different frameworks to try to get a feel for them, but in a couple months I'm probably going to need to actually put together a production system that can handle some fairly low duty e-commerce. I'm planning on using Google Checkout for order processing, but aside from that and the memory constraints I don't have any real hard rules for what the framework needs to support. I'm currently running nginx to serve static content on the server, so I could potentially integrate with that, or I could just have whichever framework I end up using serve the static content as well. So, my requirements are as follows: 1) Small memory footprint 2) Relatively simple to extend such that I can integrate it with Google Checkout 3) Documented well enough that I can figure out how to plumb everything together without needing to dig through the guts of the framework 4) Relatively stable such that a year from now I don't need to re-write the entire site because the framework isn't maintained an no longer works on the current version of GHC. Any suggestions? P.S. I'm interested in the quasi-quote package I saw mentioned here recently, but it looks more suited for use by framework developers rather than as a finished component, at least from the limited info I've found. -R. Kyle Murphy -- Curiosity was framed, Ignorance killed the cat. --===============4082520482298700261== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SSYjMzk7bSBsb29raW5nIGF0IGV4cGVyaW1lbnRpbmcgd2l0aCBkZXZlbG9waW5nIGEgc2l0ZSBh bmQgZHVlIHRvIHZhcmlvdXMgY29uc3RyYWludHMgSSYjMzk7bSBjb25zaWRlcmluZyB1c2luZyBv bmUgb2YgdGhlIGhhc2tlbGwgZnJhbWV3b3Jrcy4gSSBleHBlcmltZW50ZWQgYSBiaXQgd2l0aCBI YXBwc3RhY2ssIGFsdGhvdWdoIEkmIzM5O20gbm90IGFsbCB0aGF0IGhhcHB5IHdpdGggaXQgYW5k IEkmIzM5O20gaW50ZXJlc3RlZCBpbiBhbHRlcm5hdGl2ZXMuIEkmIzM5O3ZlIGFsc28gbG9va2Vk IGJyaWVmbHkgYXQgeWVzb2QgYnV0IGl0IGRvZXNuJiMzOTt0IHNlZW0gdG8gYmUgdmVyeSB3ZWxs IGRvY3VtZW50ZWQgYW5kIEkmIzM5O3ZlIGdvdCBzb21lIGNvbmNlcm5zLiBUaGUgZW52aXJvbm1l bnQgSSYjMzk7bSB3b3JraW5nIGluIGhhcyBjb25zdHJhaW5lZCBtZW1vcnksIGFib3V0IDMwME0g cGh5c2ljYWwsIHdpdGggYSBmdXJ0aGVyIDUwME0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oZSBjYXQuPGJyPgo= --===============4082520482298700261==-- From michael@snoyman.com Wed Apr 7 13:23:55 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] What frameworks are there? Date: Wed, 07 Apr 2010 10:55:40 -0700 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0001989827303512189==" --===============0001989827303512189== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi Kyle, Well, the web-routes-quasi package is basically an attempt to split out the quasi-quoting used in Yesod so that others can use it. The next release of Yesod will in fact depend on web-routes-quasi (in all likelihood). The documentation on Yesod *is* sparse at the moment, mostly because the API is still immature and will have some major changes over the next few releases. If you're looking for something that will have backwards compatibility, Yesod is not for you at the moment. I will say that I use Yesod in production on a number of websites, and it's worked well enough for me. One thing that it is majorly lacking is a persistence layer, but I'm working on that[1]. I also have been toying with the idea of replacing HStringTemplate with a type-safe templating system[2]; for fun I'm basing the syntax off of Haml[3]. If you want information on either of these projects, or have suggestions, I'd love to hear them. If you have other concerns, I'm also interested in hearing them. Yesod is young and has plenty of room to grow, but I think it's a pleasure to program with and is filling a niche that is missed by other Haskell packages. Michael [1] http://github.com/snoyberg/persistent [2] http://github.com/snoyberg/hamlet [3] http://haml-lang.com/ On Wed, Apr 7, 2010 at 10:46 AM, Kyle Murphy wrote: > I'm looking at experimenting with developing a site and due to various > constraints I'm considering using one of the haskell frameworks. I > experimented a bit with Happstack, although I'm not all that happy with it > and I'm interested in alternatives. I've also looked briefly at yesod but it > doesn't seem to be very well documented and I've got some concerns. The > environment I'm working in has constrained memory, about 300M physical, with > a further 500M of swap, but a relatively beefy CPU, so I'm trying to stay > away from any of the in memory systems like MACID in happstack. At this > point I'm mostly toying with the different frameworks to try to get a feel > for them, but in a couple months I'm probably going to need to actually put > together a production system that can handle some fairly low duty > e-commerce. I'm planning on using Google Checkout for order processing, but > aside from that and the memory constraints I don't have any real hard rules > for what the framework needs to support. I'm currently running nginx to > serve static content on the server, so I could potentially integrate with > that, or I could just have whichever framework I end up using serve the > static content as well. > > So, my requirements are as follows: > 1) Small memory footprint > 2) Relatively simple to extend such that I can integrate it with Google > Checkout > 3) Documented well enough that I can figure out how to plumb everything > together without needing to dig through the guts of the framework > 4) Relatively stable such that a year from now I don't need to re-write the > entire site because the framework isn't maintained an no longer works on the > current version of GHC. > > Any suggestions? > > P.S. I'm interested in the quasi-quote package I saw mentioned here > recently, but it looks more suited for use by framework developers rather > than as a finished component, at least from the limited info I've found. > > -R. Kyle Murphy > -- > Curiosity was framed, Ignorance killed the cat. > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > > --===============0001989827303512189== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SGkgS3lsZSw8YnI+PGJyPldlbGwsIHRoZSB3ZWItcm91dGVzLXF1YXNpIHBhY2thZ2UgaXMgYmFz aWNhbGx5IGFuIGF0dGVtcHQgdG8gc3BsaXQgb3V0IHRoZSBxdWFzaS1xdW90aW5nIHVzZWQgaW4g WWVzb2Qgc28gdGhhdCBvdGhlcnMgY2FuIHVzZSBpdC4gVGhlIG5leHQgcmVsZWFzZSBvZiBZZXNv ZCB3aWxsIGluIGZhY3QgZGVwZW5kIG9uIHdlYi1yb3V0ZXMtcXVhc2kgKGluIGFsbCBsaWtlbGlo b29kKS48YnI+Cjxicj5UaGUgZG9jdW1lbnRhdGlvbiBvbiBZZXNvZCAqaXMqIHNwYXJzZSBhdCB0 aGUgbW9tZW50LCBtb3N0bHkgYmVjYXVzZSB0aGUgQVBJIGlzIHN0aWxsIGltbWF0dXJlIGFuZCB3 aWxsIGhhdmUgc29tZSBtYWpvciBjaGFuZ2VzIG92ZXIgdGhlIG5leHQgZmV3IHJlbGVhc2VzLiBJ ZiB5b3UmIzM5O3JlIGxvb2tpbmcgZm9yIHNvbWV0aGluZyB0aGF0IHdpbGwgaGF2ZSBiYWNrd2Fy Z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VudGx5LCBidXQgaXQg bG9va3MgbW9yZSBzdWl0ZWQgZm9yIHVzZSBieSBmcmFtZXdvcmsgZGV2ZWxvcGVycyByYXRoZXIg dGhhbiBhcyBhIGZpbmlzaGVkIGNvbXBvbmVudCwgYXQgbGVhc3QgZnJvbSB0aGUgbGltaXRlZCBp bmZvIEkmIzM5O3ZlIGZvdW5kLjxicj4KCjxiciBjbGVhcj0iYWxsIj4tUi4gS3lsZSBNdXJwaHk8 YnI+PGZvbnQgY29sb3I9IiM4ODg4ODgiPi0tPGJyPkN1cmlvc2l0eSB3YXMgZnJhbWVkLCBJZ25v cmFuY2Uga2lsbGVkIHRoZSBjYXQuPGJyPgo8L2ZvbnQ+PGJyPl9fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fPGJyPgp3ZWItZGV2ZWwgbWFpbGluZyBsaXN0PGJy Pgo8YSBocmVmPSJtYWlsdG86d2ViLWRldmVsQGhhc2tlbGwub3JnIj53ZWItZGV2ZWxAaGFza2Vs bC5vcmc8L2E+PGJyPgo8YSBocmVmPSJodHRwOi8vd3d3Lmhhc2tlbGwub3JnL21haWxtYW4vbGlz dGluZm8vd2ViLWRldmVsIiB0YXJnZXQ9Il9ibGFuayI+aHR0cDovL3d3dy5oYXNrZWxsLm9yZy9t YWlsbWFuL2xpc3RpbmZvL3dlYi1kZXZlbDwvYT48YnI+Cjxicj48L2Jsb2NrcXVvdGU+PC9kaXY+ PGJyPgo= --===============0001989827303512189==-- From orclev@gmail.com Wed Apr 7 13:47:26 2010 From: Kyle Murphy To: web-devel@haskell.org Subject: Re: [web-devel] What frameworks are there? Date: Wed, 07 Apr 2010 13:49:12 -0430 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1565935933838961565==" --===============1565935933838961565== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable I'm definitely interested in Yesod, and it's currently at the top of my rather short list of possibilities, but the relatively immaturity does worry me a bit, in particular as it pertains to my fourth requirement. I'm not opposed to making updates from time to time to keep the site current with the latest release, but I want to avoid having to constantly tweak things, and most importantly I don't want to end up in the situation where a year or two down the line the entire framework gets deprecated and I essentially endup having to re-write the entire site from scratch. I should probably stress that I'm a relatively newbie to Haskell, and there's still a few things that I'm trying to get my head around. In particular I haven't had much chance to really look at TH, and my understanding of monads is a bit rocky in places although I've got the basic principle worked out. I'm further hampered in that I'm working on this project and other Haskell related things in my spair time which is rather lacking at the moment, so ease of understanding (I.E. good documentation) is a major bonus for me. For persistance I'm not all that worried as I can just use one of the HSQL packages and one of the various SQL servers, although any support in the framework itself would be welcome. Near as I can tell, the options for doing websites with Haskell can be boiled down to: 1) Happs(tack) 2) Yesod 3) Roll your own from low level components and at least in the case of Yesod there's still a few components that are essentially roll-your-own, although I should point out I'm not opposed to that assuming there's some good examples available of exactly how to go about doing that. In particular I've been looking over the bug tracker and blog code based on Yesod. -R. Kyle Murphy -- Curiosity was framed, Ignorance killed the cat. On Wed, Apr 7, 2010 at 13:25, Michael Snoyman wrote: > Hi Kyle, > > Well, the web-routes-quasi package is basically an attempt to split out the > quasi-quoting used in Yesod so that others can use it. The next release of > Yesod will in fact depend on web-routes-quasi (in all likelihood). > > The documentation on Yesod *is* sparse at the moment, mostly because the > API is still immature and will have some major changes over the next few > releases. If you're looking for something that will have backwards > compatibility, Yesod is not for you at the moment. > > I will say that I use Yesod in production on a number of websites, and it's > worked well enough for me. One thing that it is majorly lacking is a > persistence layer, but I'm working on that[1]. I also have been toying with > the idea of replacing HStringTemplate with a type-safe templating system[2]; > for fun I'm basing the syntax off of Haml[3]. If you want information on > either of these projects, or have suggestions, I'd love to hear them. > > If you have other concerns, I'm also interested in hearing them. Yesod is > young and has plenty of room to grow, but I think it's a pleasure to program > with and is filling a niche that is missed by other Haskell packages. > > Michael > > [1] http://github.com/snoyberg/persistent > [2] http://github.com/snoyberg/hamlet > [3] http://haml-lang.com/ > > On Wed, Apr 7, 2010 at 10:46 AM, Kyle Murphy wrote: > >> I'm looking at experimenting with developing a site and due to various >> constraints I'm considering using one of the haskell frameworks. I >> experimented a bit with Happstack, although I'm not all that happy with it >> and I'm interested in alternatives. I've also looked briefly at yesod but = it >> doesn't seem to be very well documented and I've got some concerns. The >> environment I'm working in has constrained memory, about 300M physical, wi= th >> a further 500M of swap, but a relatively beefy CPU, so I'm trying to stay >> away from any of the in memory systems like MACID in happstack. At this >> point I'm mostly toying with the different frameworks to try to get a feel >> for them, but in a couple months I'm probably going to need to actually put >> together a production system that can handle some fairly low duty >> e-commerce. I'm planning on using Google Checkout for order processing, but >> aside from that and the memory constraints I don't have any real hard rules >> for what the framework needs to support. I'm currently running nginx to >> serve static content on the server, so I could potentially integrate with >> that, or I could just have whichever framework I end up using serve the >> static content as well. >> >> So, my requirements are as follows: >> 1) Small memory footprint >> 2) Relatively simple to extend such that I can integrate it with Google >> Checkout >> 3) Documented well enough that I can figure out how to plumb everything >> together without needing to dig through the guts of the framework >> 4) Relatively stable such that a year from now I don't need to re-write >> the entire site because the framework isn't maintained an no longer works = on >> the current version of GHC. >> >> Any suggestions? >> >> P.S. I'm interested in the quasi-quote package I saw mentioned here >> recently, but it looks more suited for use by framework developers rather >> than as a finished component, at least from the limited info I've found. >> >> -R. Kyle Murphy >> -- >> Curiosity was framed, Ignorance killed the cat. >> >> _______________________________________________ >> web-devel mailing list >> web-devel@haskell.org >> http://www.haskell.org/mailman/listinfo/web-devel >> >> > --===============1565935933838961565== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SSYjMzk7bSBkZWZpbml0ZWx5IGludGVyZXN0ZWQgaW4gWWVzb2QsIGFuZCBpdCYjMzk7cyBjdXJy ZW50bHkgYXQgdGhlIHRvcCBvZiBteSByYXRoZXIgc2hvcnQgbGlzdCBvZiBwb3NzaWJpbGl0aWVz LCBidXQgdGhlIHJlbGF0aXZlbHkgaW1tYXR1cml0eSBkb2VzIHdvcnJ5IG1lIGEgYml0LC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QGhhc2tlbGwu b3JnPC9hPjxicj4KPGEgaHJlZj0iaHR0cDovL3d3dy5oYXNrZWxsLm9yZy9tYWlsbWFuL2xpc3Rp bmZvL3dlYi1kZXZlbCIgdGFyZ2V0PSJfYmxhbmsiPmh0dHA6Ly93d3cuaGFza2VsbC5vcmcvbWFp bG1hbi9saXN0aW5mby93ZWItZGV2ZWw8L2E+PGJyPgo8YnI+PC9ibG9ja3F1b3RlPjwvZGl2Pjxi cj4KPC9ibG9ja3F1b3RlPjwvZGl2Pjxicj4K --===============1565935933838961565==-- From alistair@abayley.org Thu Apr 8 04:16:13 2010 From: Alistair Bayley To: web-devel@haskell.org Subject: Re: [web-devel] What frameworks are there? Date: Thu, 08 Apr 2010 09:47:59 +0100 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2820433853307077892==" --===============2820433853307077892== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On 7 April 2010 19:19, Kyle Murphy wrote: > > Near as I can tell, the options for doing websites with Haskell can be > boiled down to: > 1) Happs(tack) > 2) Yesod > 3) Roll your own from low level components Uh... >From http://hackage.haskell.org/packages/pkg-list.html#cat:web 1. happs 2. yesod 3. hack 4. salvia 5. kibro 6. hsp (barely a framework, I think) Other frameworks not on hackage, possibly not under active development: 7. hvac ( http://fmapfixreturn.wordpress.com/2008/03/23/ann-hvac-01b-a-transa= ctional-declarative-framework-for-lightweight-web-applications/ ) 8. turbinado ( possibly abandoned: http://github.com/alsonkemp/turbinado ) 9. WASH ( http://www.haskell.org/haskellwiki/WaSh , http://www.informatik.uni-freiburg.de/~thiemann/WASH/ ) There are some other bits which don't qualify as full frameworks, but might well be useful in their own right: - HStringTemplate - formlets And there's bound to be stuff that I've missed. Alistair --===============2820433853307077892==-- From gour@gour-nitai.com Thu Apr 8 07:28:29 2010 From: Gour To: web-devel@haskell.org Subject: [web-devel] Re: What frameworks are there? Date: Thu, 08 Apr 2010 13:59:32 +0200 Message-ID: <20100408135932.1a08bf86@gaura-nitai> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8674705701718133695==" --===============8674705701718133695== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Wed, 7 Apr 2010 13:16:22 -0430 >>>>>> "Kyle" == Kyle Murphy wrote: Hello Kyle, Kyle> I'm looking at experimenting with developing a site and due to Kyle> various constraints I'm considering using one of the haskell Kyle> frameworks. Let me say that I'm in the similar boat...needed some framework and wanted to do it in Haskell. I was fiddling with Django, but eventually gave up on it... Happstack is not for me, I had hope for Turbinado...maybe Yesod, after becoming (more) documented will evolve into someting usable for me.... However, although maybe you were not thinking about it, I've settled to use Hakyll (http://jaspervdj.be/hakyll) which enables me to write 'pages' in some of the Pandoc-supported markups (I'll use markdown) using my favorited editor. It's easy to keep everything under DVCS (darcs) and deploy on the server, pages are served fast, less headache with security etc. and everything is very nicely documented. The e-commerce part which you require as well, I'll solve by using HTML forms and securely emailing forms' data back to me (using nice formmail.php script from tectite.com). Then I'll manually authorize credit cards as MO/TO transcactions. I'm sure you can find some good JS shopping cart and you can probably find some PHP code to handle Google checkout stil keeping the whole setup light. However, I'll monitor what's happening on the Haskell's web-framework scene, but so far, Hakyll looked as the best solution at the moment. Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- --===============8674705701718133695== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuNC4xMCAoR05V L0xpbnV4KQoKaUVZRUFSRUNBQVlGQWt1OXhTUUFDZ2tRVThlRThmbHY5ZlpMQWdDZmVaelkycUp5 MWlyM1B2TW9qZkRCdVNwRQpVSE1Bb0kxVWU1QlR1VmczVWxKZ0wrK1hBZkF3Skt3dAo9cHRwSgot LS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============8674705701718133695==-- From orclev@gmail.com Thu Apr 8 08:57:56 2010 From: Kyle Murphy To: web-devel@haskell.org Subject: Re: [web-devel] What frameworks are there? Date: Thu, 08 Apr 2010 08:59:43 -0430 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3271892085479440900==" --===============3271892085479440900== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable -R. Kyle Murphy -- Curiosity was framed, Ignorance killed the cat. On Thu, Apr 8, 2010 at 04:17, Alistair Bayley wrote: > Uh... > > From http://hackage.haskell.org/packages/pkg-list.html#cat:web > > 1. happs > 2. yesod > 3. hack > 4. salvia > 5. kibro > 6. hsp (barely a framework, I think) > >From the descriptions of those all but kibro, and happs/yesod which have been mentioned, I would classify as bits of frameworks, rather than a full framework like happs or yesod. Kibro looks interesting, but I can't find any documentation at all but the rather meager hadoc info on hackage itself, which tells me next to nothing about the framework. It also looks like Kibro is a CGI framework and not a full application server. Other frameworks not on hackage, possibly not under active development: > > 7. hvac ( > http://fmapfixreturn.wordpress.com/2008/03/23/ann-hvac-01b-a-transactional-= declarative-framework-for-lightweight-web-applications/ > ) > 8. turbinado ( possibly abandoned: http://github.com/alsonkemp/turbinado ) > 9. WASH ( http://www.haskell.org/haskellwiki/WaSh , > http://www.informatik.uni-freiburg.de/~thiemann/WASH/) > Hadn't heard of Turbinado and I'm checking that out now (it at least has some documentation even if a few of the links seem to be broken). WASH likewise looks interesting, although I'm not terribly thrilled about using CGI (I will if I have to, but I'd be more comfortable with a full application server). hvac looks like it has potential, although the lack of documentation probably means I won't be using it. > There are some other bits which don't qualify as full frameworks, but > might well be useful in their own right: > > - HStringTemplate > - formlets > > And there's bound to be stuff that I've missed. > > Alistair > Yes, and I've actually looked at both HStringTemplate and formlets (briefly) with the idea to either use them in conjunction with one of the other frameworks (Yesod I know uses HStringTemplate, at least for the moment, and I think Happs has some integration with formlets). As was mentioned by Gour in another followup to this, there's also Hakyll, which is an interesting possibility, but I'm not sure I'd be happy with the result. In particular it would ruin my plans for integrating with Google Checkout as I was planning on using the server side XML interface. Based on the feedback I've gotten so far, my list of possibilities in order of preferance seems to be: 1) Yesod 2) Turbinado (might change, need to look at this more) 3) Happs 4) WASH 5) Hakyll (if I can stomache using static generation) 6) All the poorly documented ones like hvac, and kibro 7) Roll my own out of the various pieces --===============3271892085479440900== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyIGNsZWFyPSJhbGwiPi1SLiBLeWxlIE11cnBoeTxicj4tLTxicj5DdXJpb3NpdHkgd2FzIGZy YW1lZCwgSWdub3JhbmNlIGtpbGxlZCB0aGUgY2F0Ljxicj4KPGJyPjxicj48ZGl2IGNsYXNzPSJn bWFpbF9xdW90ZSI+T24gVGh1LCBBcHIgOCwgMjAxMCBhdCAwNDoxNywgQWxpc3RhaXIgQmF5bGV5 IDxzcGFuIGRpcj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFpbHRvOmFsaXN0YWlyQGFiYXlsZXkub3Jn Ij5hbGlzdGFpckBhYmF5bGV5Lm9yZzwvYT4mZ3Q7PC9zcGFuPiB3cm90ZTo8YnI+PGJsb2NrcXVv dGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0iYm9yZGVyLWxlZnQ6IDFweCBzb2xpZCByZ2Io MjA0LCAyMDQsIDIwNCk7IG1hcmdpbjogMHB0IDBwdCAwcHQgMC44ZXg7IHBhZGRpbmctbGVmdDog MWV4OyI+ClVoLi4uPGJyPgo8YnI+Cj5Gcm9tIDxhIGhyZWY9Imh0dHA6Ly9oYWNrYWdlLmhhc2tl bGwub3JnL3BhY2thZ2VzL3BrZy1saXN0Lmh0bWwjY2F0OndlYiIgdGFyZ2V0PSJfYmxhbmsiPmh0 dHA6Ly9oYWNrYWdlLmhhc2tlbGwub3JnL3BhY2thZ2VzL3BrZy1saXN0Lmh0bWwjY2F0OndlYjwv YT48YnI+Cjxicj4K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WNlLjxicj4KPGJyPkJhc2VkIG9uIHRo ZSBmZWVkYmFjayBJJiMzOTt2ZSBnb3R0ZW4gc28gZmFyLCBteSBsaXN0IG9mIHBvc3NpYmlsaXRp ZXMgaW4gb3JkZXIgb2YgcHJlZmVyYW5jZSBzZWVtcyB0byBiZTo8YnI+MSkgWWVzb2Q8YnI+Mikg VHVyYmluYWRvIChtaWdodCBjaGFuZ2UsIG5lZWQgdG8gbG9vayBhdCB0aGlzIG1vcmUpPGJyPjMp IEhhcHBzPGJyPjQpIFdBU0g8YnI+NSkgSGFreWxsIChpZiBJIGNhbiBzdG9tYWNoZSB1c2luZyBz dGF0aWMgZ2VuZXJhdGlvbik8YnI+CjYpIEFsbCB0aGUgcG9vcmx5IGRvY3VtZW50ZWQgb25lcyBs aWtlIGh2YWMsIGFuZCBraWJybzxicj43KSBSb2xsIG15IG93biBvdXQgb2YgdGhlIHZhcmlvdXMg cGllY2VzPGJyPgo= --===============3271892085479440900==-- From sfvisser@cs.uu.nl Thu Apr 8 10:14:38 2010 From: Sebastiaan Visser To: web-devel@haskell.org Subject: Re: [web-devel] What frameworks are there? Date: Thu, 08 Apr 2010 16:45:37 +0200 Message-ID: <0B8AD3CE-1A0D-460A-984A-D2679C296E60@cs.uu.nl> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8822276456155610578==" --===============8822276456155610578== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Kyle, What functionality do you need? What do you want this `framework' to offer yo= u? There are plenty of packages for Haskell that help you to write web applic= ations, all of them offering some functionality. It's very unlikely you'll fi= nd one single package that satisfies all your requirements. I advice you to look around and see what package there are and how these migh= t help you. For example, I'm currently thinking about building a web application using: - The Salvia server interface (not surprisingly, this one is written by me) - The Haskell bindings to the Berkeley XML database for long-term storage. - The Salvia-session package for in-memory session storage. - The HXT xml library. - The regular-xmlpickler for generic XML printing/parsing (using HXT pickle= rs). - The BlazeHtml package for building up HTML pages (fast). - The formlets package for generating flexible web forms. - The CleverCSS package (and salvia integration) for improved css support. - probably even more... Although I agree it is not always easy to get a grip on what are the best tec= hniques available for Haskell web development, there are plenty of tools avai= lable. It will probably take some time to get to know all these libraries, bu= t due to the clear separation of concerns and Haskell's neat type system, int= egration is almost never a problem. I sincerely hope this might help you and does not scare you :-) Regards, Sebastiaan On Apr 8, 2010, at 3:29 PM, Kyle Murphy wrote: > -R. Kyle Murphy > -- > Curiosity was framed, Ignorance killed the cat. >=20 >=20 > On Thu, Apr 8, 2010 at 04:17, Alistair Bayley wrote: > Uh... >=20 > >From http://hackage.haskell.org/packages/pkg-list.html#cat:web >=20 > 1. happs > 2. yesod > 3. hack=20 > 4. salvia > 5. kibro > 6. hsp (barely a framework, I think) >=20 > From the descriptions of those all but kibro, and happs/yesod which have be= en mentioned, I would classify as bits of frameworks, rather than a full fram= ework like happs or yesod. Kibro looks interesting, but I can't find any docu= mentation at all but the rather meager hadoc info on hackage itself, which te= lls me next to nothing about the framework. It also looks like Kibro is a CGI= framework and not a full application server.=20 >=20 > Other frameworks not on hackage, possibly not under active development: >=20 > 7. hvac ( http://fmapfixreturn.wordpress.com/2008/03/23/ann-hvac-01b-a-tran= sactional-declarative-framework-for-lightweight-web-applications/ > ) > 8. turbinado ( possibly abandoned: http://github.com/alsonkemp/turbinado ) > 9. WASH ( http://www.haskell.org/haskellwiki/WaSh , > http://www.informatik.uni-freiburg.de/~thiemann/WASH/ ) > =20 > Hadn't heard of Turbinado and I'm checking that out now (it at least has so= me documentation even if a few of the links seem to be broken). WASH likewise= looks interesting, although I'm not terribly thrilled about using CGI (I wil= l if I have to, but I'd be more comfortable with a full application server). = hvac looks like it has potential, although the lack of documentation probably= means I won't be using it. > =20 > There are some other bits which don't qualify as full frameworks, but > might well be useful in their own right: >=20 > - HStringTemplate > - formlets >=20 > And there's bound to be stuff that I've missed. >=20 > Alistair >=20 > Yes, and I've actually looked at both HStringTemplate and formlets (briefly= ) with the idea to either use them in conjunction with one of the other frame= works (Yesod I know uses HStringTemplate, at least for the moment, and I thin= k Happs has some integration with formlets). >=20 > As was mentioned by Gour in another followup to this, there's also Hakyll, = which is an interesting possibility, but I'm not sure I'd be happy with the r= esult. In particular it would ruin my plans for integrating with Google Check= out as I was planning on using the server side XML interface. >=20 > Based on the feedback I've gotten so far, my list of possibilities in order= of preferance seems to be: > 1) Yesod > 2) Turbinado (might change, need to look at this more) > 3) Happs > 4) WASH > 5) Hakyll (if I can stomache using static generation) > 6) All the poorly documented ones like hvac, and kibro > 7) Roll my own out of the various pieces >=20 --===============8822276456155610578==-- From list@phaedrusdeinus.org Thu Apr 8 10:54:48 2010 From: John Melesky To: web-devel@haskell.org Subject: Re: [web-devel] What frameworks are there? Date: Thu, 08 Apr 2010 08:26:23 -0700 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3657642542220762778==" --===============3657642542220762778== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Apr 8, 2010, at 6:29 AM, Kyle Murphy wrote: > Hadn't heard of Turbinado and I'm checking that out now (it at least > has some documentation even if a few of the links seem to be > broken). WASH likewise looks interesting, although I'm not terribly > thrilled about using CGI (I will if I have to, but I'd be more > comfortable with a full application server). hvac looks like it has > potential, although the lack of documentation probably means I won't > be using it. WASH is old, iirc, so it may not work with modern GHCs. Turbinado is recent, but also recently abandoned[1]. Mostly i wanted to comment on the CGI issue. It's a fairly common kneejerk for those of us who come from a dynamic language background to assume that CGI is a bad idea, but it's a much less bad idea for Haskell than it is for Perl, Python, or whatnot. There's no large interpreter which needs to be loaded into memory, nor a time-consuming parsing/compilation step. There is, still, the overhead of starting a new process, and the (practically nonexistent, with any kind of reasonable disk caching) overhead of loading up the binary in the first place. But even those can be eliminated if you move from CGI to FastCGI (or your preferred daemonizer). So don't dismiss CGI out of hand. It's not as bad as you remember. -johnnnnnn [1] http://www.alsonkemp.com/haskell/reflections-on-leaving-haskell/ --===============3657642542220762778==-- From orclev@gmail.com Thu Apr 8 13:35:59 2010 From: Kyle Murphy To: web-devel@haskell.org Subject: Re: [web-devel] What frameworks are there? Date: Thu, 08 Apr 2010 13:37:46 -0430 Message-ID: In-Reply-To: <0B8AD3CE-1A0D-460A-984A-D2679C296E60@cs.uu.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3543510531985547871==" --===============3543510531985547871== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable I guess my biggest problem with the state of web development in Haskell as it currently stands is that there's no good easily accessible tutorials on how to go about doing things. There are lots of example programs scattered around, and some of them are even documented reasonably well that you can look at them and sort of figure out how they go together using the various pieces, but once you try to go beyond those specific bits and pieces you end up wandering off into the weeds. What I'm looking for most of all is one set of documentation I can look through and figure out how to put a simple application together that supports handling GET/POST requests, storing and retrieving session info, and ideally a simple long term storage solution such as HSQL. Right now I feel like just to put together a simple page that handles form submission I need to have mastered 4 or 5 different libraries, all documented in different locations. When I first started trying to do web development in Haskell I looked at the Happstack tutorials, and that worked fairly well, I was able to take a simple paste bin application and modify it to add some javascript into the generated page, however even that fairly trivial modification meant I had to go digging through the Text.XHTML documentation, which consisted solely of the automaticlly generated hadock. Furthmore I'm still not entirely sure how the various pieces of Happs actually fit together, or what pieces are provided by Happs, and what pieces are provided by other external libraries. Yesod is a similar situation in which I'm not entirely sure what's provided where and where to go to find the documentation of that. I'm sure an expert Haskell developer can just glance over the hadock for a library and figure out how to put all the pieces together, but as a Haskell newbie I often get lost trying to figure out how to do things that in other languages would be fairly trivial. Most of the time when I'm lost on how to do something it isn't even because what I want to do is terribly difficult, it's just that the documentation on how to do something assumes that you essentially already know how to do it and are just looking for clarrification on the details, a situation that I usually resolve by either trial and error, or by looking for some piece of code somewhere that does what I want and trying to puzzle out how it actually goes about doing that. Part of this seems to be caused by most of the libraries/frameworks being documented solely in hadock, which is ok for a quick reference, but sucks for trying to learn how to use a library/framework. Even though it's true there's a lot of usefull info contained in just the signature of a function, if that's the first time you've been exposed to that function and aren't entirely sure of its purpose, that information isn't enough to really understand the function, at least for non-trivial functions. The big frameworks like Happs, Turbinado, and hopefully soon Yesod, do seem to be fairly well documented, but the fact that they're built on top of a bunch of the other libraries like HSQL, HStringTemplate, and Text.XHTML that aren't well documented undermines the ability to fully understand them, as before you can really make the most use out of their documentation you must first go puzzle your way through the poor documentation of all the support libraries. Further complicating matters is the scattered way in which libraries are documented. For all I know, there's really excellent documentation for Text.XHTML, but just looking at it on hackage, and a quick google search doesn't seem to reveal anything particularly useful. The hackage page for Text.XHTML has a link for more info, but going to the page that supposedly contains more info I'm greeted with a 404 page. It would be one thing if this was the exceptional case, but from what I've seen that's pretty much par for the course. -R. Kyle Murphy -- Curiosity was framed, Ignorance killed the cat. On Thu, Apr 8, 2010 at 10:15, Sebastiaan Visser wrote: > Kyle, > > What functionality do you need? What do you want this `framework' to offer > you? There are plenty of packages for Haskell that help you to write web > applications, all of them offering some functionality. It's very unlikely > you'll find one single package that satisfies all your requirements. > > I advice you to look around and see what package there are and how these > might help you. > > For example, I'm currently thinking about building a web application using: > - The Salvia server interface (not surprisingly, this one is written by > me) > - The Haskell bindings to the Berkeley XML database for long-term storage. > - The Salvia-session package for in-memory session storage. > - The HXT xml library. > - The regular-xmlpickler for generic XML printing/parsing (using HXT > picklers). > - The BlazeHtml package for building up HTML pages (fast). > - The formlets package for generating flexible web forms. > - The CleverCSS package (and salvia integration) for improved css support. > - probably even more... > > Although I agree it is not always easy to get a grip on what are the best > techniques available for Haskell web development, there are plenty of tools > available. It will probably take some time to get to know all these > libraries, but due to the clear separation of concerns and Haskell's neat > type system, integration is almost never a problem. > > I sincerely hope this might help you and does not scare you :-) > > Regards, > > Sebastiaan > > On Apr 8, 2010, at 3:29 PM, Kyle Murphy wrote: > > -R. Kyle Murphy > > -- > > Curiosity was framed, Ignorance killed the cat. > > > > > > On Thu, Apr 8, 2010 at 04:17, Alistair Bayley > wrote: > > Uh... > > > > >From http://hackage.haskell.org/packages/pkg-list.html#cat:web > > > > 1. happs > > 2. yesod > > 3. hack > > 4. salvia > > 5. kibro > > 6. hsp (barely a framework, I think) > > > > From the descriptions of those all but kibro, and happs/yesod which have > been mentioned, I would classify as bits of frameworks, rather than a full > framework like happs or yesod. Kibro looks interesting, but I can't find any > documentation at all but the rather meager hadoc info on hackage itself, > which tells me next to nothing about the framework. It also looks like Kibro > is a CGI framework and not a full application server. > > > > Other frameworks not on hackage, possibly not under active development: > > > > 7. hvac ( > http://fmapfixreturn.wordpress.com/2008/03/23/ann-hvac-01b-a-transactional-= declarative-framework-for-lightweight-web-applications/ > > ) > > 8. turbinado ( possibly abandoned: http://github.com/alsonkemp/turbinado) > > 9. WASH ( http://www.haskell.org/haskellwiki/WaSh , > > http://www.informatik.uni-freiburg.de/~thiemann/WASH/) > > > > Hadn't heard of Turbinado and I'm checking that out now (it at least has > some documentation even if a few of the links seem to be broken). WASH > likewise looks interesting, although I'm not terribly thrilled about using > CGI (I will if I have to, but I'd be more comfortable with a full > application server). hvac looks like it has potential, although the lack of > documentation probably means I won't be using it. > > > > There are some other bits which don't qualify as full frameworks, but > > might well be useful in their own right: > > > > - HStringTemplate > > - formlets > > > > And there's bound to be stuff that I've missed. > > > > Alistair > > > > Yes, and I've actually looked at both HStringTemplate and formlets > (briefly) with the idea to either use them in conjunction with one of the > other frameworks (Yesod I know uses HStringTemplate, at least for the > moment, and I think Happs has some integration with formlets). > > > > As was mentioned by Gour in another followup to this, there's also > Hakyll, which is an interesting possibility, but I'm not sure I'd be happy > with the result. In particular it would ruin my plans for integrating with > Google Checkout as I was planning on using the server side XML interface. > > > > Based on the feedback I've gotten so far, my list of possibilities in > order of preferance seems to be: > > 1) Yesod > > 2) Turbinado (might change, need to look at this more) > > 3) Happs > > 4) WASH > > 5) Hakyll (if I can stomache using static generation) > > 6) All the poorly documented ones like hvac, and kibro > > 7) Roll my own out of the various pieces > > > > --===============3543510531985547871== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SSBndWVzcyBteSB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JiMzOTt2ZSBnb3R0ZW4gc28gZmFyLCBteSBsaXN0IG9mIHBvc3NpYmlsaXRp ZXMgaW4gb3JkZXIgb2YgcHJlZmVyYW5jZSBzZWVtcyB0byBiZTo8YnI+CiZndDsgMSkgWWVzb2Q8 YnI+CiZndDsgMikgVHVyYmluYWRvIChtaWdodCBjaGFuZ2UsIG5lZWQgdG8gbG9vayBhdCB0aGlz IG1vcmUpPGJyPgomZ3Q7IDMpIEhhcHBzPGJyPgomZ3Q7IDQpIFdBU0g8YnI+CiZndDsgNSkgSGFr eWxsIChpZiBJIGNhbiBzdG9tYWNoZSB1c2luZyBzdGF0aWMgZ2VuZXJhdGlvbik8YnI+CiZndDsg NikgQWxsIHRoZSBwb29ybHkgZG9jdW1lbnRlZCBvbmVzIGxpa2UgaHZhYywgYW5kIGtpYnJvPGJy PgomZ3Q7IDcpIFJvbGwgbXkgb3duIG91dCBvZiB0aGUgdmFyaW91cyBwaWVjZXM8YnI+CiZndDs8 YnI+Cjxicj4KPC9kaXY+PC9kaXY+PC9ibG9ja3F1b3RlPjwvZGl2Pjxicj4K --===============3543510531985547871==-- From michael@snoyman.com Thu Apr 8 17:20:20 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] What frameworks are there? Date: Thu, 08 Apr 2010 14:52:08 -0700 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4165055586218899731==" --===============4165055586218899731== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Kyle, You're 100% correct about the state of documentation. I think we need to figure out a nice, centralized place to put up quality Haskell documentation, and actually work at it. The obvious place is the Haskell wiki, but a downside is that many people do not have accounts. For github projects- like Yesod- we could use the wiki pages there, but that's not exactly standardized. In addition, I think it will help library authors to know *where* the documentation is lacking. For example, I know that I haven't written much documentation on the Handler datatype in Yesod. However, I'm not sure if anyone actually *cares* about that, or if instead a nice introduction to the authentication framework would be more welcome. I assume we won't come up with any great solutions to the documentation issue in the immediate future; in the interim, if people want to see some documentation on any of my packages, please do one of the following: * File an issue on the appropriate github projects making a request for documentation. Be as clear as possible. * Start a Wiki page (either Github or Haskell wiki) with your questions and e-mail me to let me know it's there. * Send an e-mail to the web-devel list with the question. * As a last resort, e-mail me privately. I'd much prefer that these discussions happen in public so that others can learn and contribute. I'm more than open to better suggestions. I'll also appreciate any help in improving my documentation. Michael On Thu, Apr 8, 2010 at 11:07 AM, Kyle Murphy wrote: > I guess my biggest problem with the state of web development in Haskell as > it currently stands is that there's no good easily accessible tutorials on > how to go about doing things. There are lots of example programs scattered > around, and some of them are even documented reasonably well that you can > look at them and sort of figure out how they go together using the various > pieces, but once you try to go beyond those specific bits and pieces you end > up wandering off into the weeds. What I'm looking for most of all is one set > of documentation I can look through and figure out how to put a simple > application together that supports handling GET/POST requests, storing and > retrieving session info, and ideally a simple long term storage solution > such as HSQL. > > Right now I feel like just to put together a simple page that handles form > submission I need to have mastered 4 or 5 different libraries, all > documented in different locations. When I first started trying to do web > development in Haskell I looked at the Happstack tutorials, and that worked > fairly well, I was able to take a simple paste bin application and modify it > to add some javascript into the generated page, however even that fairly > trivial modification meant I had to go digging through the Text.XHTML > documentation, which consisted solely of the automaticlly generated hadock. > Furthmore I'm still not entirely sure how the various pieces of Happs > actually fit together, or what pieces are provided by Happs, and what pieces > are provided by other external libraries. Yesod is a similar situation in > which I'm not entirely sure what's provided where and where to go to find > the documentation of that. I'm sure an expert Haskell developer can just > glance over the hadock for a library and figure out how to put all the > pieces together, but as a Haskell newbie I often get lost trying to figure > out how to do things that in other languages would be fairly trivial. Most > of the time when I'm lost on how to do something it isn't even because what > I want to do is terribly difficult, it's just that the documentation on how > to do something assumes that you essentially already know how to do it and > are just looking for clarrification on the details, a situation that I > usually resolve by either trial and error, or by looking for some piece of > code somewhere that does what I want and trying to puzzle out how it > actually goes about doing that. > > Part of this seems to be caused by most of the libraries/frameworks being > documented solely in hadock, which is ok for a quick reference, but sucks > for trying to learn how to use a library/framework. Even though it's true > there's a lot of usefull info contained in just the signature of a function, > if that's the first time you've been exposed to that function and aren't > entirely sure of its purpose, that information isn't enough to really > understand the function, at least for non-trivial functions. The big > frameworks like Happs, Turbinado, and hopefully soon Yesod, do seem to be > fairly well documented, but the fact that they're built on top of a bunch of > the other libraries like HSQL, HStringTemplate, and Text.XHTML that aren't > well documented undermines the ability to fully understand them, as before > you can really make the most use out of their documentation you must first > go puzzle your way through the poor documentation of all the support > libraries. > > Further complicating matters is the scattered way in which libraries are > documented. For all I know, there's really excellent documentation for > Text.XHTML, but just looking at it on hackage, and a quick google search > doesn't seem to reveal anything particularly useful. The hackage page for > Text.XHTML has a link for more info, but going to the page that supposedly > contains more info I'm greeted with a 404 page. It would be one thing if > this was the exceptional case, but from what I've seen that's pretty much > par for the course. > > > -R. Kyle Murphy > -- > Curiosity was framed, Ignorance killed the cat. > > > On Thu, Apr 8, 2010 at 10:15, Sebastiaan Visser wrote: > >> Kyle, >> >> What functionality do you need? What do you want this `framework' to offer >> you? There are plenty of packages for Haskell that help you to write web >> applications, all of them offering some functionality. It's very unlikely >> you'll find one single package that satisfies all your requirements. >> >> I advice you to look around and see what package there are and how these >> might help you. >> >> For example, I'm currently thinking about building a web application >> using: >> - The Salvia server interface (not surprisingly, this one is written by >> me) >> - The Haskell bindings to the Berkeley XML database for long-term >> storage. >> - The Salvia-session package for in-memory session storage. >> - The HXT xml library. >> - The regular-xmlpickler for generic XML printing/parsing (using HXT >> picklers). >> - The BlazeHtml package for building up HTML pages (fast). >> - The formlets package for generating flexible web forms. >> - The CleverCSS package (and salvia integration) for improved css >> support. >> - probably even more... >> >> Although I agree it is not always easy to get a grip on what are the best >> techniques available for Haskell web development, there are plenty of tools >> available. It will probably take some time to get to know all these >> libraries, but due to the clear separation of concerns and Haskell's neat >> type system, integration is almost never a problem. >> >> I sincerely hope this might help you and does not scare you :-) >> >> Regards, >> >> Sebastiaan >> >> On Apr 8, 2010, at 3:29 PM, Kyle Murphy wrote: >> > -R. Kyle Murphy >> > -- >> > Curiosity was framed, Ignorance killed the cat. >> > >> > >> > On Thu, Apr 8, 2010 at 04:17, Alistair Bayley >> wrote: >> > Uh... >> > >> > >From http://hackage.haskell.org/packages/pkg-list.html#cat:web >> > >> > 1. happs >> > 2. yesod >> > 3. hack >> > 4. salvia >> > 5. kibro >> > 6. hsp (barely a framework, I think) >> > >> > From the descriptions of those all but kibro, and happs/yesod which have >> been mentioned, I would classify as bits of frameworks, rather than a full >> framework like happs or yesod. Kibro looks interesting, but I can't find a= ny >> documentation at all but the rather meager hadoc info on hackage itself, >> which tells me next to nothing about the framework. It also looks like Kib= ro >> is a CGI framework and not a full application server. >> > >> > Other frameworks not on hackage, possibly not under active development: >> > >> > 7. hvac ( >> http://fmapfixreturn.wordpress.com/2008/03/23/ann-hvac-01b-a-transactional= -declarative-framework-for-lightweight-web-applications/ >> > ) >> > 8. turbinado ( possibly abandoned: >> http://github.com/alsonkemp/turbinado ) >> > 9. WASH ( http://www.haskell.org/haskellwiki/WaSh , >> > http://www.informatik.uni-freiburg.de/~thiemann/WASH/) >> > >> > Hadn't heard of Turbinado and I'm checking that out now (it at least has >> some documentation even if a few of the links seem to be broken). WASH >> likewise looks interesting, although I'm not terribly thrilled about using >> CGI (I will if I have to, but I'd be more comfortable with a full >> application server). hvac looks like it has potential, although the lack of >> documentation probably means I won't be using it. >> > >> > There are some other bits which don't qualify as full frameworks, but >> > might well be useful in their own right: >> > >> > - HStringTemplate >> > - formlets >> > >> > And there's bound to be stuff that I've missed. >> > >> > Alistair >> > >> > Yes, and I've actually looked at both HStringTemplate and formlets >> (briefly) with the idea to either use them in conjunction with one of the >> other frameworks (Yesod I know uses HStringTemplate, at least for the >> moment, and I think Happs has some integration with formlets). >> > >> > As was mentioned by Gour in another followup to this, there's also >> Hakyll, which is an interesting possibility, but I'm not sure I'd be happy >> with the result. In particular it would ruin my plans for integrating with >> Google Checkout as I was planning on using the server side XML interface. >> > >> > Based on the feedback I've gotten so far, my list of possibilities in >> order of preferance seems to be: >> > 1) Yesod >> > 2) Turbinado (might change, need to look at this more) >> > 3) Happs >> > 4) WASH >> > 5) Hakyll (if I can stomache using static generation) >> > 6) All the poorly documented ones like hvac, and kibro >> > 7) Roll my own out of the various pieces >> > >> >> > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > > --===============4165055586218899731== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 S3lsZSw8ZGl2Pjxicj48L2Rpdj48ZGl2PllvdSYjMzk7cmUgMTAwJSBjb3JyZWN0IGFib3V0IHRo ZSBzdGF0ZSBvZiBkb2N1bWVudGF0aW9uLiBJIHRoaW5rIHdlIG5lZWQgdG8gZmlndXJlIG91dCBh IG5pY2UsIGNlbnRyYWxpemVkIHBsYWNlIHRvIHB1dCB1cCBxdWFsaXR5IEhhc2tlbGwgZG9jdW1l bnRhdGlvbiwgYW5kIGFjdHVhbGx5IHdvcmsgYXQgaXQuPC9kaXY+PGRpdj48YnI+PC9kaXY+Cjxk aXY+VGhlIG9idmlvdXMgcGxhY2UgaXMgdGhlIEhhc2tlbGwgd2lraSwgYnV0IGEgZG93bnNpZGUg aXMgdGhhdCBtYW55IHBlb3BsZSBkbyBub3QgaGF2ZSBhY2NvdW50cy4gRm9yIGdpdGh1YiBwcm9q ZWN0cy0gbGlrZSBZZXNvZC0gd2UgY291bGQgdXNlIHRoZSB3aWtpIHBhZ2VzIHRoZXJlLCBidXQg dGhhdCYjMzk7cyBub3QgZXhhY3RseSBzdGFuZGFyZGl6ZWQuPC9kaXY+PGRpdj48YnI+CjwvZGl2 PjxkaXY+SW4gYWRkaXRpb24sIEkgdGhpbmsgaXQgd2lsbCBoZWxwIGxpYnJhcnkgYXV0aG9ycyB0 byBrbm93ICp3aGVyZSogdGhlIGRvY3VtZW50YXRpb24gaXMgbGFja2luZy4gRm9yIGV4YW1wbGUs IEkga25vdyB0aGF0IEkgaGF2ZW4mIzM5O3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icj4KJmd0OyAxKSBZZXNvZDxicj4KJmd0OyAyKSBUdXJiaW5hZG8gKG1pZ2h0IGNo YW5nZSwgbmVlZCB0byBsb29rIGF0IHRoaXMgbW9yZSk8YnI+CiZndDsgMykgSGFwcHM8YnI+CiZn dDsgNCkgV0FTSDxicj4KJmd0OyA1KSBIYWt5bGwgKGlmIEkgY2FuIHN0b21hY2hlIHVzaW5nIHN0 YXRpYyBnZW5lcmF0aW9uKTxicj4KJmd0OyA2KSBBbGwgdGhlIHBvb3JseSBkb2N1bWVudGVkIG9u ZXMgbGlrZSBodmFjLCBhbmQga2licm88YnI+CiZndDsgNykgUm9sbCBteSBvd24gb3V0IG9mIHRo ZSB2YXJpb3VzIHBpZWNlczxicj4KJmd0Ozxicj4KPGJyPgo8L2Rpdj48L2Rpdj48L2Jsb2NrcXVv dGU+PC9kaXY+PGJyPgo8L2Rpdj48L2Rpdj48YnI+X19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX188YnI+CndlYi1kZXZlbCBtYWlsaW5nIGxpc3Q8YnI+CjxhIGhy ZWY9Im1haWx0bzp3ZWItZGV2ZWxAaGFza2VsbC5vcmciPndlYi1kZXZlbEBoYXNrZWxsLm9yZzwv YT48YnI+CjxhIGhyZWY9Imh0dHA6Ly93d3cuaGFza2VsbC5vcmcvbWFpbG1hbi9saXN0aW5mby93 ZWItZGV2ZWwiIHRhcmdldD0iX2JsYW5rIj5odHRwOi8vd3d3Lmhhc2tlbGwub3JnL21haWxtYW4v bGlzdGluZm8vd2ViLWRldmVsPC9hPjxicj4KPGJyPjwvYmxvY2txdW90ZT48L2Rpdj48YnI+PC9k aXY+Cg== --===============4165055586218899731==-- From simon.hengel@wiktory.org Fri Apr 9 02:11:45 2010 From: Simon Hengel To: web-devel@haskell.org Subject: [web-devel] The state of documentation (was What frameworks are there?) Date: Fri, 09 Apr 2010 08:36:51 +0200 Message-ID: <20100409063651.GA3098@x200> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1681548744797468249==" --===============1681548744797468249== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > You're 100% correct about the state of documentation. I think we need > to figure out a nice, centralized place to put up quality Haskell > documentation, and actually work at it. My feeling is that we lack mostly short, tutorial-style introductions, that just get you started with a topic/library. Ideally we'd have a way to automatically verify (say test) that those examples actually work. Haddock 'head' has some very new and immature support for 'examples', and I'm working on integrating it with my DocTest package. Besides that, a way to write larger tutorials (that we can test) would also be nice. > I'm more than open to better suggestions. I'll also appreciate any > help in improving my documentation. I'm working on a (very) short introduction to WAI, not sure when I'll have time to finish it. Cheers, Simon --===============1681548744797468249==-- From niklas.broberg@gmail.com Fri Apr 9 05:31:36 2010 From: Niklas Broberg To: web-devel@haskell.org Subject: Re: [web-devel] What frameworks are there? Date: Fri, 09 Apr 2010 13:03:25 +0300 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2262949796020277959==" --===============2262949796020277959== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit > 6. hsp  (barely a framework, I think) HSP is a templating system, indeed not a full framework*. You'd use it together with happstack ftw (and possibly any other server framework, should be modular enough). :-) /Niklas * At one point it used to be, back when there were no other real server frameworks available, but we cut support for all that stuff when happs came along and did things better. --===============2262949796020277959==-- From gour@gour-nitai.com Fri Apr 9 06:01:09 2010 From: Gour To: web-devel@haskell.org Subject: [web-devel] Re: The state of documentation Date: Fri, 09 Apr 2010 12:32:14 +0200 Message-ID: <20100409123214.0c751a3f@gaura-nitai> In-Reply-To: <20100409063651.GA3098@x200> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4584764654835421013==" --===============4584764654835421013== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Fri, 9 Apr 2010 08:36:51 +0200 >>>>>> "Simon" == Simon Hengel wrote: Simon> My feeling is that we lack mostly short, tutorial-style Simon> introductions, that just get you started with a topic/library. I agree. Moreover, practically every 'framework' (except Happs) is more or less one-man show band, i.e. it works for their authors without docs, but that's not the way one can build community around it...And without some 'critical' mass of users, one is reluctant to invest time/energy into such products...Kind a catch-22. :-( Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- --===============4584764654835421013== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuNC4xMCAoR05V L0xpbnV4KQoKaUVZRUFSRUNBQVlGQWt1L0FpNEFDZ2tRVThlRThmbHY5ZllrR1FDZU42UlpBSzI4 SDl6U0o0aEx1K04yVE9DdwpubkFBblIza294N1BBYUt5QnpSRDdlbEhFR1FNYU5sdAo9R2VCbwot LS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============4584764654835421013==-- From michael@snoyman.com Fri Apr 9 10:34:19 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Re: The state of documentation Date: Fri, 09 Apr 2010 08:06:08 -0700 Message-ID: In-Reply-To: <20100409123214.0c751a3f@gaura-nitai> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1065148117538297606==" --===============1065148117538297606== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Fri, Apr 9, 2010 at 3:32 AM, Gour wrote: > On Fri, 9 Apr 2010 08:36:51 +0200 > >>>>>> "Simon" == Simon Hengel wrote: > > Simon> My feeling is that we lack mostly short, tutorial-style > Simon> introductions, that just get you started with a topic/library. > > I agree. > > Moreover, practically every 'framework' (except Happs) is more or less > one-man show band, i.e. it works for their authors without docs, but > that's not the way one can build community around it...And without > some 'critical' mass of users, one is reluctant to invest time/energy > into such products...Kind a catch-22. :-( > > > I can't speak for others, but I personally don't have a problem investing in documentation on my one-man-show libraries. In the specific case of Yesod, I *know* it's going to have some major changes in the next release, so it's not worth it right now. In general, I think the problem for library writers is that- since *we* wrote the code- we don't know what's confusing about it. As far as we're concerned, our code is beautiful, elegant, simple and self-documenting (until we look at it again six months later). We really need an outside voice to tell us what's lacking. So instead of saying "fizzbuzz has no documentation," maybe say "I saw the fizzbuzz tutorial on creating foobars, but I couldn't figure out how to extend that for wibbles. Could you write a tutorial for that?" Michael --===============1065148117538297606== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gRnJpLCBBcHIgOSwgMjAxMCBhdCAz OjMyIEFNLCBHb3VyIDxzcGFuIGRpcj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFpbHRvOmdvdXJAZ291 ci1uaXRhaS5jb20iPmdvdXJAZ291ci1uaXRhaS5jb208L2E+Jmd0Ozwvc3Bhbj4gd3JvdGU6PGJy PjxibG9ja3F1b3RlIGNsYXNzPSJnbWFpbF9xdW90ZSIgc3R5bGU9Im1hcmdpbjowIDAgMCAuOGV4 O2JvcmRlci1sZWZ0OjFweCAjY2NjIHNvbGlkO3BhZGRpbmctbGVmdDoxZXg7Ij4KT24gRnJpLCA5 IEFwciAyMDEwIDA4OjM2OjUxICswMjAwPGJyPgomZ3Q7Jmd0OyZndDsmZ3Q7Jmd0OyZndDsgJnF1 b3Q7U2ltb24mcXVvdDsgPT0gU2ltb24gSGVuZ2VsIHdyb3RlOjxicj4KPGJyPgpTaW1vbiZndDsg TXkgZmVlbGluZyBpcyB0aGF0IHdlIGxhY2sgbW9zdGx5IHNob3J0LCB0dXRvcmlhbC1zdHlsZTxi cj4KU2ltb24mZ3Q7IGludHJvZHVjdGlvbnMsIHRoYXQganVzdCBnZXQgeW91IHN0YXJ0ZWQgd2l0 aCBhIHRvcGljL2xpYnJhcnkuPGJyPgo8YnI+CkkgYWdyZWUuPGJyPgo8YnI+Ck1vcmVvdmVyLCBw cmFjdGljYWxseSBldmVyeSAmIzM5O2ZyYW1ld29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IzM5O3JlIGNvbmNlcm5lZCwgb3VyIGNvZGUgaXMgYmVhdXRp ZnVsLCBlbGVnYW50LCBzaW1wbGUgYW5kIHNlbGYtZG9jdW1lbnRpbmcgKHVudGlsIHdlIGxvb2sg YXQgaXQgYWdhaW4gc2l4IG1vbnRocyBsYXRlcikuIFdlIHJlYWxseSBuZWVkIGFuIG91dHNpZGUg dm9pY2UgdG8gdGVsbCB1cyB3aGF0JiMzOTtzIGxhY2tpbmcuPC9kaXY+CjxkaXY+PGJyPjwvZGl2 PjxkaXY+U28gaW5zdGVhZCBvZiBzYXlpbmcgJnF1b3Q7Zml6emJ1enogaGFzIG5vIGRvY3VtZW50 YXRpb24sJnF1b3Q7IG1heWJlIHNheSAmcXVvdDtJIHNhdyB0aGUgZml6emJ1enogdHV0b3JpYWwg b24gY3JlYXRpbmcgZm9vYmFycywgYnV0IEkgY291bGRuJiMzOTt0IGZpZ3VyZSBvdXQgaG93IHRv IGV4dGVuZCB0aGF0IGZvciB3aWJibGVzLiBDb3VsZCB5b3Ugd3JpdGUgYSB0dXRvcmlhbCBmb3Ig dGhhdD8mcXVvdDs8L2Rpdj4KPGRpdj48YnI+PC9kaXY+PGRpdj5NaWNoYWVsPC9kaXY+PC9kaXY+ Cg== --===============1065148117538297606==-- From gour@gour-nitai.com Fri Apr 9 12:33:21 2010 From: Gour To: web-devel@haskell.org Subject: [web-devel] Re: The state of documentation Date: Fri, 09 Apr 2010 19:04:38 +0200 Message-ID: <20100409190438.47057d2e@gaura-nitai> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8654947896198978021==" --===============8654947896198978021== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Fri, 9 Apr 2010 08:06:08 -0700 >>>>>> "Michael" == Michael Snoyman wrote: Michael> I can't speak for others, but I personally don't have a Michael> problem investing in documentation on my one-man-show Michael> libraries. In the specific case of Yesod, I *know* it's going Michael> to have some major changes in the next release, so it's not Michael> worth it right now. OK. Let's wait that Yesod becomes more mature, then we'll evaluate it again. Michael> In general, I think the problem for library writers is that- Michael> since *we* wrote the code- we don't know what's confusing Michael> about it. Well, I agree it's not easy to put ineself in another's shoes, but here lies the difference. ;) Michael> As far as we're concerned, our code is beautiful, elegant, Michael> simple and self-documenting (until we look at it again six Michael> months later). :-) Michael> We really need an outside voice to tell us what's lacking. Simple tutorials to get us going. Have you seen the Django tutorial written in several parts? Michael> So instead of saying "fizzbuzz has no documentation," maybe Michael> say "I saw the fizzbuzz tutorial on creating foobars, but I Michael> couldn't figure out how to extend that for wibbles. Could you Michael> write a tutorial for that?" Well, at the moment I am playing with Hakyll and can just recommend every library writer to check Hakyll's tutorials at http://jaspervdj.be/hakyll/tutorials.html Psychologically it is very encouraging to be provided with few simple steps and achieve something instead of starring at the Haddock-generated docs only. Even the Haskell language (which is not at all simple) has "Haskell in 5 steps" & "Learn Haskell in 10 minutes" tutorials. One may say it's kind of cheating, but if the easy introductory material sparks enough interest in the noob user, there is good chance that he/she will investigate further. Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- --===============8654947896198978021== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuNC4xMCAoR05V L0xpbnV4KQoKaUVZRUFSRUNBQVlGQWt1L1hpWUFDZ2tRVThlRThmbHY5ZmI1OVFDZU45KzBFTGJO VWpkUEFsenE4RVVvS09GRAo3ZVFBbmpSVU1iTWQyOXpVR25WZTdUK2pRWmxUTDFrSAo9UVJydQot LS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============8654947896198978021==-- From orclev@gmail.com Fri Apr 9 13:35:38 2010 From: Kyle Murphy To: web-devel@haskell.org Subject: Re: [web-devel] Re: The state of documentation Date: Fri, 09 Apr 2010 14:07:28 -0400 Message-ID: In-Reply-To: <20100409190438.47057d2e@gaura-nitai> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9093648655656913764==" --===============9093648655656913764== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Fri, Apr 9, 2010 at 13:04, Gour wrote: > OK. Let's wait that Yesod becomes more mature, then we'll evaluate it > again. > Fair enough. > Well, I agree it's not easy to put ineself in another's shoes, but > here lies the difference. ;) > > Michael> As far as we're concerned, our code is beautiful, elegant, > Michael> simple and self-documenting (until we look at it again six > Michael> months later). > > :-) > > Michael> We really need an outside voice to tell us what's lacking. > > Simple tutorials to get us going. Have you seen the Django tutorial > written in several parts? > > Michael> So instead of saying "fizzbuzz has no documentation," maybe > Michael> say "I saw the fizzbuzz tutorial on creating foobars, but I > Michael> couldn't figure out how to extend that for wibbles. Could you > Michael> write a tutorial for that?" > > Well, at the moment I am playing with Hakyll and can just recommend > every library writer to check Hakyll's tutorials at > > http://jaspervdj.be/hakyll/tutorials.html > > Psychologically it is very encouraging to be provided with few simple > steps and achieve something instead of starring at the > Haddock-generated docs only. > > Even the Haskell language (which is not at all simple) has "Haskell > in 5 steps" & "Learn Haskell in 10 minutes" tutorials. > > One may say it's kind of cheating, but if the easy introductory > material sparks enough interest in the noob user, there is good chance > that he/she will investigate further. > The problem is really that there's multiple levels of documentation. At the lowest, and least "user friendly" you've got the haddock which isn't much more than a collection of function signatures. It assumes that if you're reading it, you're already more or less familiar with the framework and how to go about doing what you want. The next highest level of documentation, what's severely lacking in the Haskell community in general, and the web development community in particular, is the in depth documentation for the libraries/frameworks. These documents aren't quite tutorials, but they go beyond just telling you the minimal information you need to use a function. This sort of document would typically have a section for each of the major use cases of your framework/library, and possibly a few brief code snippets showing how you go about doing particular things. For instance, in the Text.XHTML package, this document would most likely list the various functions for generating html elements like br, as well as have a section talking about the attribute op (!), the Html concatination op (+++), and the Html nesting op (<<), and provide examples of how to construct a few example pages. It's this level of documentation that's really missing, and where most people would head to once they finish following along on some tutorial. If all the libraries you used in your tutorials provided this level of documentation all you would need to do in your tutorial is to mention which libraries you used, and if you're feeling generous provide a link to their documentation. Unfortunately, that's not the state that the vast majority of Haskell libraries are in, there being only haddock, and if you're lucky a tutorial or two. This unfortunately puts the tutorial writers in a rather awkward position where even if the main framework, happs lets say, is well documented, all the support libraries that are necessary to put together a working tutorial aren't, and thus confuse newbies looking to use the tutorial. One solution, although a rather bad one, is for the tutorial writers to help fill in the missing documentation, either directly, or by writing yet more tutorials to document the support libraries. This is bad for a number of reasons, not the least of which is that a tutorial isn't the place to document huge swaths of a framework, which is something best left to the intermediate documentation mentioned previously (with the haddock being used to document the minute details, and the not often visited cranies). The other reason this is a bad solution is that as an example, the creator of Yesod, who decides to write a tutorial on using it, should not then be obliged to create documentation for lets say HStringTemplate just because he happens to need it for his tutorial. The better long term solution is to encourage some kind of detailed documentation to be produced for the majority of Haskell libraries. I'm hesitant to say it should be required, as obviously such a requirement might discourage people from bothering to share the work they do, but at the same time something needs to be done to encourage documentation beyond the simple haddock that's used as the sole documentation of the vast majority of libraries (many of which don't even provide anything in the haddock besides the function signature, something that's easy enough to get from ghci). As a final thought, haddock itself might even be leveraged to provide this higher level documentation, it certainly has the capability of doing so, it just generally isn't used in that way. The brief summary most people put at the top of the generated haddock, which usually consists of a one or two sentence description of what the library provides, could instead be used to provide details of all the use cases, and links to the appropiate pieces of documentation. As an example, consider this documentation of the Java Pattern class ( http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html ). If the majority of Haskell libraries contained as thorough documentation as that in their haddock, you'd rarely even need to consult a tutorial or other documentation. -R. Kyle Murphy -- Curiosity was framed, Ignorance killed the cat. --===============9093648655656913764== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxkaXYgY2xhc3M9ImdtYWlsX3F1b3RlIj5PbiBGcmksIEFwciA5LCAyMDEwIGF0IDEzOjA0 LCBHb3VyIDxzcGFuIGRpcj0ibHRyIj4mbHQ7PG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lcywgYW5kIGxpbmtzIHRvIHRoZSBhcHByb3BpYXRlIHBpZWNlcyBvZiBkb2N1 bWVudGF0aW9uLiBBcyBhbiBleGFtcGxlLCBjb25zaWRlciB0aGlzIGRvY3VtZW50YXRpb24gb2Yg dGhlIEphdmEgUGF0dGVybiBjbGFzcyAoIDxhIGhyZWY9Imh0dHA6Ly9qYXZhLnN1bi5jb20vajJz ZS8xLjUuMC9kb2NzL2FwaS9qYXZhL3V0aWwvcmVnZXgvUGF0dGVybi5odG1sIj5odHRwOi8vamF2 YS5zdW4uY29tL2oyc2UvMS41LjAvZG9jcy9hcGkvamF2YS91dGlsL3JlZ2V4L1BhdHRlcm4uaHRt bDwvYT4gKS4gSWYgdGhlIG1ham9yaXR5IG9mIEhhc2tlbGwgbGlicmFyaWVzIGNvbnRhaW5lZCBh cyB0aG9yb3VnaCBkb2N1bWVudGF0aW9uIGFzIHRoYXQgaW4gdGhlaXIgaGFkZG9jaywgeW91JiMz OTtkIHJhcmVseSBldmVuIG5lZWQgdG8gY29uc3VsdCBhIHR1dG9yaWFsIG9yIG90aGVyIGRvY3Vt ZW50YXRpb24uPGJyPgo8L2Rpdj48L2Rpdj48YnIgY2xlYXI9ImFsbCI+LVIuIEt5bGUgTXVycGh5 PGJyPi0tPGJyPkN1cmlvc2l0eSB3YXMgZnJhbWVkLCBJZ25vcmFuY2Uga2lsbGVkIHRoZSBjYXQu PGJyPgo8YnI+Cg== --===============9093648655656913764==-- From simon.hengel@wiktory.org Fri Apr 9 13:43:20 2010 From: Simon Hengel To: web-devel@haskell.org Subject: Re: [web-devel] Re: The state of documentation Date: Fri, 09 Apr 2010 20:15:09 +0200 Message-ID: <20100409181509.GB3275@x200> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1459690064556834047==" --===============1459690064556834047== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > As a final thought, haddock itself might even be leveraged to provide > this higher level documentation, it certainly has the capability of > doing so A very good point. --===============1459690064556834047==-- From gour@gour-nitai.com Fri Apr 9 14:05:34 2010 From: Gour To: web-devel@haskell.org Subject: [web-devel] Re: The state of documentation Date: Fri, 09 Apr 2010 20:36:48 +0200 Message-ID: <20100409203648.4a8bef67@gaura-nitai> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9215486495307484087==" --===============9215486495307484087== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Fri, 9 Apr 2010 14:07:28 -0400 >>>>>> "Kyle" == Kyle Murphy wrote: Kyle> The next highest level of documentation, what's severely lacking Kyle> in the Haskell community in general, and the web development Kyle> community in particular, is the in depth documentation for the Kyle> libraries/frameworks. These documents aren't quite tutorials, Kyle> but they go beyond just telling you the minimal information you Kyle> need to use a function. This sort of document would typically Kyle> have a section for each of the major use cases of your Kyle> framework/library, and possibly a few brief code snippets Kyle> showing how you go about doing particular things. For instance, Kyle> in the Text.XHTML package, this document would most likely list Kyle> the various functions for generating html elements like br, as Kyle> well as have a section talking about the attribute op (!), the Kyle> Html concatination op (+++), and the Html nesting op (<<), and Kyle> provide examples of how to construct a few example pages. It's Kyle> this level of documentation that's really missing, and where Kyle> most people would head to once they finish following along on Kyle> some tutorial. If we consider that Django is nicely documented and can be used as example, do you think about stuff called 'topic guides' listed at http://docs.djangoproject.com/en/dev/intro/whatsnext/#intro-whatsnext i.e. something in between tutorial and API reference? Here is blog post about it: http://jacobian.org/writing/great-documentation/what-to-write/ Kyle> As a final thought, haddock itself might even be leveraged to Kyle> provide this higher level documentation, it certainly has the Kyle> capability of doing so, it just generally isn't used in that way. Kyle> The brief summary most people put at the top of the generated Kyle> haddock, which usually consists of a one or two sentence Kyle> description of what the library provides, could instead be used Kyle> to provide details of all the use cases, and links to the Kyle> appropiate pieces of documentation. Long ago I was suggesting on 'cafe' that it would be nice if the haddock documentation would have some 'examples of usage', but it looks it is too much and we are still far from it... Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- --===============9215486495307484087== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuNC4xMCAoR05V L0xpbnV4KQoKaUVZRUFSRUNBQVlGQWt1L2M4QUFDZ2tRVThlRThmbHY5ZmFtb2dDZ2gyeDArczNK dnFQV0NHbVFqQVNwM1VqMwp6V01Bb01VZWhaWDkwbVFIWXlHQ0N6TmVuTTFVWVlPSwo9MXkvNQot LS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============9215486495307484087==-- From orclev@gmail.com Fri Apr 9 14:30:21 2010 From: Kyle Murphy To: web-devel@haskell.org Subject: Re: [web-devel] Re: The state of documentation Date: Fri, 09 Apr 2010 15:02:12 -0400 Message-ID: In-Reply-To: <20100409203648.4a8bef67@gaura-nitai> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4342469528857890003==" --===============4342469528857890003== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit That blog post was excellent and fairly well captures the spirit of what I was getting at, although I do disagree somewhat about the auto-generated docs. I don't have any problem with auto-generated docs in and of themselves, assuming that you also insert into that documentation the sort of details discussed in the "topic guides". A great example of this is most of the POD used in Perl modules, where at least the first few paragraphs of documentation are typically devoted to essentially being a "topic guide" for that module. I think what she was really complaining about in that post is exactly the situation we have in hackage currently where there is for all intents and purpose absolutely no documentation provided for the vast majority of libraries beyond the automatically generated signatures and the odd sentence or two. Something I'd like to see become common in haddock is for instance, a good general description, with references to sub-modules in the main module of a package. Each sub-module would then function as a topic guide for the features of that module, with the specific API details contained in the function descriptions. If I have some time this weekend maybe I'll pull down the source for Text.XHTML, and try to update its documentation to provide an example of what I'm getting at. -R. Kyle Murphy -- Curiosity was framed, Ignorance killed the cat. On Fri, Apr 9, 2010 at 14:36, Gour wrote: > On Fri, 9 Apr 2010 14:07:28 -0400 > >>>>>> "Kyle" == Kyle Murphy wrote: > > Kyle> The next highest level of documentation, what's severely lacking > Kyle> in the Haskell community in general, and the web development > Kyle> community in particular, is the in depth documentation for the > Kyle> libraries/frameworks. These documents aren't quite tutorials, > Kyle> but they go beyond just telling you the minimal information you > Kyle> need to use a function. This sort of document would typically > Kyle> have a section for each of the major use cases of your > Kyle> framework/library, and possibly a few brief code snippets > Kyle> showing how you go about doing particular things. For instance, > Kyle> in the Text.XHTML package, this document would most likely list > Kyle> the various functions for generating html elements like br, as > Kyle> well as have a section talking about the attribute op (!), the > Kyle> Html concatination op (+++), and the Html nesting op (<<), and > Kyle> provide examples of how to construct a few example pages. It's > Kyle> this level of documentation that's really missing, and where > Kyle> most people would head to once they finish following along on > Kyle> some tutorial. > > If we consider that Django is nicely documented and can be used as > example, do you think about stuff called 'topic guides' listed at > > http://docs.djangoproject.com/en/dev/intro/whatsnext/#intro-whatsnext > > i.e. something in between tutorial and API reference? > > Here is blog post about it: > > http://jacobian.org/writing/great-documentation/what-to-write/ > > Kyle> As a final thought, haddock itself might even be leveraged to > Kyle> provide this higher level documentation, it certainly has the > Kyle> capability of doing so, it just generally isn't used in that way. > Kyle> The brief summary most people put at the top of the generated > Kyle> haddock, which usually consists of a one or two sentence > Kyle> description of what the library provides, could instead be used > Kyle> to provide details of all the use cases, and links to the > Kyle> appropiate pieces of documentation. > > Long ago I was suggesting on 'cafe' that it would be nice if the > haddock documentation would have some 'examples of usage', but it > looks it is too much and we are still far from it... > > > Sincerely, > Gour > > -- > > Gour | Hlapicina, Croatia | GPG key: F96FF5F6 > ---------------------------------------------------------------- > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > > --===============4342469528857890003== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 VGhhdCBibG9nIHBvc3Qgd2FzIGV4Y2VsbGVudCBhbmQgZmFpcmx5IHdlbGwgY2FwdHVyZXMgdGh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fX19fX19fX19fX19fX19fX19fX19fX19fX19fPGJyPgp3 ZWItZGV2ZWwgbWFpbGluZyBsaXN0PGJyPgo8YSBocmVmPSJtYWlsdG86d2ViLWRldmVsQGhhc2tl bGwub3JnIj53ZWItZGV2ZWxAaGFza2VsbC5vcmc8L2E+PGJyPgo8YSBocmVmPSJodHRwOi8vd3d3 Lmhhc2tlbGwub3JnL21haWxtYW4vbGlzdGluZm8vd2ViLWRldmVsIiB0YXJnZXQ9Il9ibGFuayI+ aHR0cDovL3d3dy5oYXNrZWxsLm9yZy9tYWlsbWFuL2xpc3RpbmZvL3dlYi1kZXZlbDwvYT48YnI+ Cjxicj48L2Jsb2NrcXVvdGU+PC9kaXY+PGJyPgo= --===============4342469528857890003==-- From orclev@gmail.com Sat Apr 10 02:44:51 2010 From: Kyle Murphy To: web-devel@haskell.org Subject: Re: [web-devel] Re: The state of documentation Date: Sat, 10 Apr 2010 03:16:44 -0400 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2159377907313735361==" --===============2159377907313735361== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit I managed to find some time to put together an example update of the documentation for xhtml package with the sorts of changes I'd like to see applied to as much of hackage as possible.you can find the udated haddock at http://tenletters.org/haddock/index.html Depending on the feedback I get on this updated documentation I might try to get in touch with the xhtml maintainer and have my changes merged in to the official repository. Let me know what you guys think. -R. Kyle Murphy -- Curiosity was framed, Ignorance killed the cat. On Fri, Apr 9, 2010 at 15:02, Kyle Murphy wrote: > That blog post was excellent and fairly well captures the spirit of what I > was getting at, although I do disagree somewhat about the auto-generated > docs. I don't have any problem with auto-generated docs in and of > themselves, assuming that you also insert into that documentation the sort > of details discussed in the "topic guides". A great example of this is most > of the POD used in Perl modules, where at least the first few paragraphs of > documentation are typically devoted to essentially being a "topic guide" for > that module. I think what she was really complaining about in that post is > exactly the situation we have in hackage currently where there is for all > intents and purpose absolutely no documentation provided for the vast > majority of libraries beyond the automatically generated signatures and the > odd sentence or two. > > Something I'd like to see become common in haddock is for instance, a good > general description, with references to sub-modules in the main module of a > package. Each sub-module would then function as a topic guide for the > features of that module, with the specific API details contained in the > function descriptions. If I have some time this weekend maybe I'll pull down > the source for Text.XHTML, and try to update its documentation to provide an > example of what I'm getting at. > > > -R. Kyle Murphy > -- > Curiosity was framed, Ignorance killed the cat. > > > On Fri, Apr 9, 2010 at 14:36, Gour wrote: > >> On Fri, 9 Apr 2010 14:07:28 -0400 >> >>>>>> "Kyle" == Kyle Murphy wrote: >> >> Kyle> The next highest level of documentation, what's severely lacking >> Kyle> in the Haskell community in general, and the web development >> Kyle> community in particular, is the in depth documentation for the >> Kyle> libraries/frameworks. These documents aren't quite tutorials, >> Kyle> but they go beyond just telling you the minimal information you >> Kyle> need to use a function. This sort of document would typically >> Kyle> have a section for each of the major use cases of your >> Kyle> framework/library, and possibly a few brief code snippets >> Kyle> showing how you go about doing particular things. For instance, >> Kyle> in the Text.XHTML package, this document would most likely list >> Kyle> the various functions for generating html elements like br, as >> Kyle> well as have a section talking about the attribute op (!), the >> Kyle> Html concatination op (+++), and the Html nesting op (<<), and >> Kyle> provide examples of how to construct a few example pages. It's >> Kyle> this level of documentation that's really missing, and where >> Kyle> most people would head to once they finish following along on >> Kyle> some tutorial. >> >> If we consider that Django is nicely documented and can be used as >> example, do you think about stuff called 'topic guides' listed at >> >> http://docs.djangoproject.com/en/dev/intro/whatsnext/#intro-whatsnext >> >> i.e. something in between tutorial and API reference? >> >> Here is blog post about it: >> >> http://jacobian.org/writing/great-documentation/what-to-write/ >> >> Kyle> As a final thought, haddock itself might even be leveraged to >> Kyle> provide this higher level documentation, it certainly has the >> Kyle> capability of doing so, it just generally isn't used in that way. >> Kyle> The brief summary most people put at the top of the generated >> Kyle> haddock, which usually consists of a one or two sentence >> Kyle> description of what the library provides, could instead be used >> Kyle> to provide details of all the use cases, and links to the >> Kyle> appropiate pieces of documentation. >> >> Long ago I was suggesting on 'cafe' that it would be nice if the >> haddock documentation would have some 'examples of usage', but it >> looks it is too much and we are still far from it... >> >> >> Sincerely, >> Gour >> >> -- >> >> Gour | Hlapicina, Croatia | GPG key: F96FF5F6 >> ---------------------------------------------------------------- >> >> _______________________________________________ >> web-devel mailing list >> web-devel@haskell.org >> http://www.haskell.org/mailman/listinfo/web-devel >> >> > --===============2159377907313735361== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SSBtYW5hZ2VkIHRvIGZpbmQgc29tZSB0aW1lIHRvIHB1dCB0b2dldGhlciBhbiBleGFtcGxlIHVw ZGF0ZSBvZiB0aGUgZG9jdW1lbnRhdGlvbiBmb3IgeGh0bWwgcGFja2FnZSB3aXRoIHRoZSBzb3J0 cyBvZiBjaGFuZ2VzIEkmIzM5O2QgbGlrZSB0byBzZWUgYXBwbGllZCB0byBhcyBtdWNoIG9mIGhh Y2thZ2UgYXMgcG9zc2libGUueW91IGNhbiBmaW5kIHRoZSB1ZGF0ZWQgaGFkZG9jayBhdCA8YSBo cmVmPSJodHRwOi8vdGVubGV0dGVycy5vcmcvaGFkZG9jay9pbmRleC5odG1sIj5odHRwOi8vdGVu bGV0dGVycy5vcmcvaGFkZG9jay9pbmRleC5odG1sPC9hPjxicj4KPGJyPkRlcGVuZGluZyBvbiB0 aGUgZmVlZGJhY2sgSSBnZXQgb24gdGhpcyB1cGRhdGVkIGRvY3VtZW50YXRpb24gSSBtaWdodCB0 cnkgdG8gZ2V0IGluIHRvdWNoIHdpdGggdGhlIHhodG1sIG1haW50YWluZXIgYW5kIGhhdmUgbXkg Y2hhbmdlcyBtZXJnZWQgaW4gdG8gdGhlIG9mZmljaWFsIHJlcG9zaXRvcnkuIExldCBtZSBrbm93 IHdoYXQgeW91IGd1eXMgdGhpbmsuPGJyPjxiciBjbGVhcj0iYWxsIj4KLVIuIEt5bGUgTXVycGh5 PGJyPi0tPGJyPkN1cmlvc2l0eSB3YXMgZnJhbWVkLCBJZ25vcmFuY2Uga2ls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nI+CjwvYmxvY2txdW90ZT48L2Rpdj48YnI+Cg== --===============2159377907313735361==-- From thaldyron@gmail.com Sat Apr 10 07:09:59 2010 From: Peter Robinson To: web-devel@haskell.org Subject: Re: [web-devel] web-routes-quasi Date: Sat, 10 Apr 2010 13:41:32 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4220834013838174225==" --===============4220834013838174225== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 6 April 2010 21:38, Michael Snoyman wrote: > It's like you read my mind... I very consciously designed this in such a way > that it would be possible to do this. More to the point: I think it would be > possible to use web-routes-quasi to create a RESTful API and then > auto-generate the basic API documentation. I'd like to eventually figure out > a way to support GET and POST parameters as well for this. > Anyway, for the basic [String] methods, I can add support for it in the > future; I'd rather wait until we have the rest of web-routes settled down > first. > (Of course, a patch is always welcome.) Here are some more thoughts on the above point: The handler functions take the user supplied type, a function (MyRoute -> String), and the fields of the corresponding MyRoute constructors as parameters. - Wouldn't it be simpler to automatically derive an instance of Show for the MyRoute type? (Since MyRoute is created on the fly anyway, I don't see why anyone would want to derive a different Show instance.) - About the possibility of querying the supported methods: The use case scenario I have in mind is having a default handler for handling OPTIONS that returns the available methods. Currently this won't work since that part of the resource information is unavailable inside the handler. Do you have any thoughts on how to change the design to make this possible? Peter --===============4220834013838174225==-- From michael@snoyman.com Sun Apr 11 00:28:11 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] web-routes-quasi Date: Sat, 10 Apr 2010 22:00:06 -0700 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7493245100175611609==" --===============7493245100175611609== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Sat, Apr 10, 2010 at 4:41 AM, Peter Robinson wrote: > On 6 April 2010 21:38, Michael Snoyman wrote: > > It's like you read my mind... I very consciously designed this in such a > way > > that it would be possible to do this. More to the point: I think it would > be > > possible to use web-routes-quasi to create a RESTful API and then > > auto-generate the basic API documentation. I'd like to eventually figure > out > > a way to support GET and POST parameters as well for this. > > Anyway, for the basic [String] methods, I can add support for it in the > > future; I'd rather wait until we have the rest of web-routes settled down > > first. > > (Of course, a patch is always welcome.) > > Here are some more thoughts on the above point: > > The handler functions take the user supplied type, a function (MyRoute -> > String), and the fields of the corresponding MyRoute constructors as > parameters. > > - Wouldn't it be simpler to automatically derive an instance of Show for > the MyRoute type? (Since MyRoute is created on the fly anyway, I don't > see why anyone would want to derive a different Show instance.) > > Multiple problems: * The rest of web-routes doesn't use Show that way. * Usually, we'll need another parameter to create this function, such as the application root. * Show is usually the inverse of Read. I suppose we could make the Read instance the other side, but that we're just not following what is normally expected of these instances, which is to return Haskell-formatted data. - About the possibility of querying the supported methods: The use case > scenario I have in mind is having a default handler for handling OPTIONS > that returns the available methods. Currently this won't work since that > part > of the resource information is unavailable inside the handler. Do you have > any > thoughts on how to change the design to make this possible? Well, the simplest thing I can do is make the [Resource] result from the quasi-quoting available, which would give you enough information to write something to intercept OPTIONS requests before handing them to the rest of the application. Does that sound good enough? Michael --===============7493245100175611609== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gU2F0LCBBcHIgMTAsIDIwMTAgYXQg NDo0MSBBTSwgUGV0ZXIgUm9iaW5zb24gPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWls dG86dGhhbGR5cm9uQGdtYWlsLmNvbSI+dGhhbGR5cm9uQGdtYWlsLmNvbTwvYT4mZ3Q7PC9zcGFu PiB3cm90ZTo8YnI+PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0ibWFyZ2lu OjAgMCAwIC44ZXg7Ym9yZGVyLWxlZnQ6MXB4ICNjY2Mgc29saWQ7cGFkZGluZy1sZWZ0OjFleDsi Pgo8ZGl2IGNsY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dpdmUgeW91IGVub3VnaCBpbmZvcm1hdGlvbiB0 byB3cml0ZSBzb21ldGhpbmcgdG8gaW50ZXJjZXB0IE9QVElPTlMgcmVxdWVzdHMgYmVmb3JlIGhh bmRpbmcgdGhlbSB0byB0aGUgcmVzdCBvZiB0aGUgYXBwbGljYXRpb24uIERvZXMgdGhhdCBzb3Vu ZCBnb29kIGVub3VnaD88L2Rpdj4KPGRpdj48YnI+PC9kaXY+PGRpdj5NaWNoYWVswqA8L2Rpdj48 L2Rpdj4K --===============7493245100175611609==-- From gour@gour-nitai.com Mon Apr 12 01:22:11 2010 From: Gour To: web-devel@haskell.org Subject: [web-devel] Hamlet & Haml Date: Mon, 12 Apr 2010 07:53:32 +0200 Message-ID: <20100412075332.3b58ecdb@gaura-nitai> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0905727075928335948==" --===============0905727075928335948== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hello! Many/Some RoR folks swear at Haml/Sass (http://haml-lang.com/) and I see there is Hamlet project at Github (http://github.com/snoyberg/hamlet) saying "Haml-like template files that are compile-time checked", so I'm curious if it targets to be Haml-compatible or just "haml-like" ? Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- --===============0905727075928335948== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuNC4xMCAoR05V L0xpbnV4KQoKaUVZRUFSRUNBQVlGQWt2Q3RWd0FDZ2tRVThlRThmbHY5ZlpLUHdDZmN3S250T0Ix NlVPT3kvR3RUVjVuM0RNVQpEb1lBbXdSOGRaTmFCeDhhTEpHV2p3eks5U0hXN04yTgo9V2Fibwot LS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============0905727075928335948==-- From michael@snoyman.com Mon Apr 12 01:42:17 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Hamlet & Haml Date: Sun, 11 Apr 2010 23:14:15 -0700 Message-ID: In-Reply-To: <20100412075332.3b58ecdb@gaura-nitai> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5916093952187605424==" --===============5916093952187605424== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Sun, Apr 11, 2010 at 10:53 PM, Gour wrote: > Hello! > > Many/Some RoR folks swear at Haml/Sass (http://haml-lang.com/) and I > see there is Hamlet project at Github > (http://github.com/snoyberg/hamlet) > > saying "Haml-like template files that are compile-time checked", so > I'm curious if it targets to be Haml-compatible or just "haml-like" ? > > > Sincerely, > Gour Funny to see this mentioned right now; I'm in the middle of incorporating it into Yesod. It's most definitely haml-like: haml itself allows embedding of arbitrary Ruby code, so that's not really something I'm interested in here. I'll put up a mini tutorial on it when it's polished, but there's really not much to the syntax. Just to give an idea of the niche it's trying to fill: * Quasi-quoted templates are embeddable directly in your Haskell files and included in the binary. * All variables are compile-time checked. * Allows for on-demand loading of IO values, eg you can have conditionals in the template and only load data from a database if needed. * It uses enumerators for looping, so it should fit nicely in memory. * Deals with the string problem by having a very simple datatype: data Html = Encoded Text | Unencoded Text (Html will probably be renamed to something else). * Has a monadic interface so you can use the nice features of the Hamlet monad without using the Hamlet syntax and quasi-quoter. * Allows embedding of other templates. The code for integration into Yesod is literally being written right now (just took a break to check my e-mail), so I should have more to say soon. If anyone's dying to know the details, send me an e-mail and I'll try to put together a blog post. Michael --===============5916093952187605424== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gU3VuLCBBcHIgMTEsIDIwMTAgYXQg MTA6NTMgUE0sIEdvdXIgPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWlsdG86Z291ckBn b3VyLW5pdGFpLmNvbSI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cnkgc2ltcGxl IGRhdGF0eXBlOiBkYXRhIEh0bWwgPSBFbmNvZGVkIFRleHQgfCBVbmVuY29kZWQgVGV4dCAoSHRt bCB3aWxsIHByb2JhYmx5IGJlIHJlbmFtZWQgdG8gc29tZXRoaW5nIGVsc2UpLjwvZGl2PjxkaXY+ KiBIYXMgYSBtb25hZGljIGludGVyZmFjZSBzbyB5b3UgY2FuIHVzZSB0aGUgbmljZSBmZWF0dXJl cyBvZiB0aGUgSGFtbGV0IG1vbmFkIHdpdGhvdXQgdXNpbmcgdGhlIEhhbWxldCBzeW50YXggYW5k IHF1YXNpLXF1b3Rlci48L2Rpdj4KPGRpdj4qIEFsbG93cyBlbWJlZGRpbmcgb2Ygb3RoZXIgdGVt cGxhdGVzLjwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+VGhlIGNvZGUgZm9yIGludGVncmF0aW9u IGludG8gWWVzb2QgaXMgbGl0ZXJhbGx5IGJlaW5nIHdyaXR0ZW4gcmlnaHQgbm93IChqdXN0IHRv b2sgYSBicmVhayB0byBjaGVjayBteSBlLW1haWwpLCBzbyBJIHNob3VsZCBoYXZlIG1vcmUgdG8g c2F5IHNvb24uIElmIGFueW9uZSYjMzk7cyBkeWluZyB0byBrbm93IHRoZSBkZXRhaWxzLCBzZW5k IG1lIGFuIGUtbWFpbCBhbmQgSSYjMzk7bGwgdHJ5IHRvIHB1dCB0b2dldGhlciBhIGJsb2cgcG9z dC48L2Rpdj4KPGRpdj48YnI+PC9kaXY+PGRpdj5NaWNoYWVswqA8L2Rpdj48L2Rpdj4K --===============5916093952187605424==-- From thaldyron@gmail.com Mon Apr 12 03:46:10 2010 From: Peter Robinson To: web-devel@haskell.org Subject: Re: [web-devel] web-routes-quasi Date: Mon, 12 Apr 2010 10:17:46 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0725205189595568058==" --===============0725205189595568058== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 11 April 2010 07:00, Michael Snoyman wrote: >> - Wouldn't it be simpler to automatically derive an instance of Show for >> the MyRoute type? (Since MyRoute is created on the fly anyway, I don't >> see why anyone would want to derive a different Show instance.) >> > Multiple problems: > * The rest of web-routes doesn't use Show that way. > * Usually, we'll need another parameter to create this function, such as the > application root. > * Show is usually the inverse of Read. I suppose we could make the Read > instance the other side, but that we're just not following what is normally > expected of these instances, which is to return Haskell-formatted data. Right. I've noticed that your newest approach uses an "explode" function which makes the type signature of handler functions shorter. :) >> - About the possibility of querying the supported methods: The use case >> scenario I have in mind is having a default handler for handling OPTIONS >> that returns the available methods. Currently this won't work since that >> part >> of the resource information is unavailable inside the handler. Do you have >> any >> thoughts on how to change the design to make this possible? > > Well, the simplest thing I can do is make the [Resource] result from the > quasi-quoting available, which would give you enough information to write > something to intercept OPTIONS requests before handing them to the rest of > the application. Does that sound good enough? Yes, sounds good. (Alternatively, I could separate parseRoutes from createRoutes and make the resources a top level declaration, which wouldn't require any changes on your part...) Peter --===============0725205189595568058==-- From agocorona@gmail.com Mon Apr 12 04:12:45 2010 From: "Alberto G. Corona" To: web-devel@haskell.org Subject: Re: [web-devel] web-routes-quasi Date: Mon, 12 Apr 2010 10:44:42 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2884249911306998105==" --===============2884249911306998105== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Hi Michael, I´m involved in the development of an application server (not a framework) with rather different goals than Yessod (its´nt so elegant). I will tell more about it whenever there is something solid enough to play with it. Just a few questions to clarify my mind: When you mention WAI you mean Web Access Initiative? I checked your Network.WAI package and it seems that gzip facilities and so on have nothing in common with usability and accesibility issues. - Could you point me to documentation about web-routes? I´m in the internet business since a few years, so I suspect that I know this with another name. Thank you a lot. 2010/4/3 Michael Snoyman > web-routes-quasi is now at the point where it can be used for sites, and > I'd love to hear some feedback. I've put together a little sample that > demonstrates how you can use quasi-quoting and define your routes, embed > subsites and serve the resulting application via WAI. (My example uses WAI, > but the package itself is not tied to WAI.) > > The code is on github[1]; the main function for the blog is in blog.hs > (with the lowercase b). I believe this just depends on Jeremy's web-routes > package, wai and wai-extra. > > Note that I did not use web-routes-wai; I think there are some problems in > there for breaking up the pathinfo, and I didn't have time to dig through > it. Also, this package currently ignores entirely the defaultPage component > of Site, though if there is desire support can be added for it. > > One minor bug is that you can't have an alternate GET, POST, PUT or DELETE > constructor imported; hopefully that will get cleaned up. > > Any comments and suggestions are welcome! My goal is to port Yesod over to > this as soon as the web-routes set of packages are released, so if you're > interested in Yesod, you should be interested in this too ;). > > Michael > > [1] http://github.com/snoyberg/web-routes-quasi > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > > --===============2884249911306998105== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SGkgTWljaGFlbCw8ZGl2Pjxicj48ZGl2Pkm0bSBpbnZvbHZlZCBpbiB0aGUgZGV2ZWxvcG1lbnQg b2YgYW4gYXBwbGljYXRpb24gc2VydmVyIChub3QgYSBmcmFtZXdvcmspIHdpdGggcmF0aGVyIGRp ZmZlcmVudCBnb2FscyB0aGFuIFllc3NvZCAoaXRztG50IHNvIGVsZWdhbnQpLiBJIHdpbGwgdGVs bCBtb3JlIGFib3V0IGl0IHdoZW5ldmVyIHRoZXJlIGlzIHNvbWV0aGluZyBzb2xpZCBlbm91Z2gg dG8gcGxheSB3aXRoIGl0LjwvZGl2Pgo8ZGl2Pjxicj48ZGl2Pkp1c3QgYSBmZXcgcXVlc3Rpb25z IHRvIGNsYXJpZnkgbXkgbWluZDo8L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PldoZW4geW91IG1l bnRpb24gV0FJIHlvdSBtZWFuIFdlYiBBY2Nlc3MgSW5pdGlhdGl2ZT8gSSBjaGVja2VkIHlvdXIg TmV0d29yay5XQUkgcGFja2FnZSBhbmQgaXQgc2VlbXMgd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911306998105==-- From gour@gour-nitai.com Mon Apr 12 05:44:57 2010 From: Gour To: web-devel@haskell.org Subject: [web-devel] Re: Hamlet & Haml Date: Mon, 12 Apr 2010 12:16:19 +0200 Message-ID: <20100412121619.0e1a5467@gaura-nitai> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7665770966851698866==" --===============7665770966851698866== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Sun, 11 Apr 2010 23:14:15 -0700 >>>>>> "Michael" == Michael Snoyman wrote: Michael> Funny to see this mentioned right now; I'm in the middle of Michael> incorporating it into Yesod. It's most definitely haml-like: Heh...somehow I've stumbled upon Haml/Sass after researching about static-site generators (StaticMatic supports Haml) and then thought about Haskell...which has brought me to Hamlet. :-) The wikipedia page (http://en.wikipedia.org/wiki/Haml#Implementations) lists severeal implementations, that's why I've asked if Hamlet could be counted as one? Michael> haml itself allows embedding of arbitrary Ruby code, so that's Michael> not really something I'm interested in here. Same here. No interest in Ruby. Michael> I'll put up a mini tutorial on it when it's polished, but Michael> there's really not much to the syntax. Just to give an idea of Michael> the niche it's trying to fill: Michael> Michael> * Quasi-quoted templates are embeddable directly in your Michael> Haskell files and included in the binary. Michael> * All variables are compile-time checked. Michael> * Allows for on-demand loading of IO values, eg you can have Michael> conditionals in the template and only load data from a Michael> database if needed. Michael> * It uses enumerators for looping, so it should fit nicely in Michael> memory. Michael> * Deals with the string problem by having a very simple Michael> datatype: data Html = Encoded Text | Unencoded Text (Html will Michael> probably be renamed to something else). Michael> * Has a monadic interface so you can use the nice features of Michael> the Hamlet monad without using the Hamlet syntax and Michael> quasi-quoter. Michael> * Allows embedding of other templates. It looks very good. *thumb up* Michael> The code for integration into Yesod is literally being written Michael> right now (just took a break to check my e-mail), so I should Michael> have more to say soon. If anyone's dying to know the details, Michael> send me an e-mail and I'll try to put together a blog post. No rush here. ;) (We'll use Hakyll for now.) Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- --===============7665770966851698866== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuNC4xMCAoR05V L0xpbnV4KQoKaUVZRUFSRUNBQVlGQWt2Qzh2TUFDZ2tRVThlRThmbHY5ZmJXNVFDZ29vQi84elZU SCs0KytLb0Q4Wi9VSXlDawo0QjhBb0lRYnhYMkJVc0ZsSHNvRTRhZUl6eFBsZUF2ZAo9Q1pkMwot LS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============7665770966851698866==-- From michael@snoyman.com Mon Apr 12 10:31:00 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] web-routes-quasi Date: Mon, 12 Apr 2010 08:02:59 -0700 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1425382960396140309==" --===============1425382960396140309== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, Apr 12, 2010 at 1:17 AM, Peter Robinson wrote: > On 11 April 2010 07:00, Michael Snoyman wrote: > >> - Wouldn't it be simpler to automatically derive an instance of Show for > >> the MyRoute type? (Since MyRoute is created on the fly anyway, I don't > >> see why anyone would want to derive a different Show instance.) > >> > > Multiple problems: > > * The rest of web-routes doesn't use Show that way. > > * Usually, we'll need another parameter to create this function, such as > the > > application root. > > * Show is usually the inverse of Read. I suppose we could make the Read > > instance the other side, but that we're just not following what is > normally > > expected of these instances, which is to return Haskell-formatted data. > > Right. I've noticed that your newest approach uses an "explode" function > which makes the type signature of handler functions shorter. :) > > Wow, I can't believe anyone was able to follow that code ;). My hat's off to you. Someone (maybe you) mentioned earlier that web-routes-quasi is geared more towards framework writers; I think this is probably very true. Nonetheless, before release I'll put in proper documentation about the type signatures of all the parameters, since the whole thing can be very tricky. I myself had trouble figuring it out for integration into Yesod, and I wrote all the packages involved! > >> - About the possibility of querying the supported methods: The use case > >> scenario I have in mind is having a default handler for handling OPTIONS > >> that returns the available methods. Currently this won't work since that > >> part > >> of the resource information is unavailable inside the handler. Do you > have > >> any > >> thoughts on how to change the design to make this possible? > > > > Well, the simplest thing I can do is make the [Resource] result from the > > quasi-quoting available, which would give you enough information to write > > something to intercept OPTIONS requests before handing them to the rest > of > > the application. Does that sound good enough? > > Yes, sounds good. (Alternatively, I could separate parseRoutes from > createRoutes > and make the resources a top level declaration, which wouldn't require any > changes on your part...) > > Actually, that sounds like a much better idea. I'm trying to ensure that web-routes-quasi generated code compiles without warnings on -Wall, and exporting information that won't be used normally would generate an unused warning. Michael --===============1425382960396140309== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gTW9uLCBBcHIgMTIsIDIwMTAgYXQg MToxNyBBTSwgUGV0ZXIgUm9iaW5zb24gPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWls dG86dGhhbGR5cm9uQGdtYWlsLmNvbSI+dGhhbGR5cm9uQGdtYWlsLmNvbTwvYT4mZ3Q7PC9zcGFu PiB3cm90ZTo8YnI+PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0ibWFyZ2lu OjAgMCAwIC44ZXg7Ym9yZGVyLWxlZnQ6MXB4ICNjY2Mgc29saWQ7cGFkZGluZy1sZWZ0OjFleDsi Pgo8ZGl2IGNsYXNzPSJpbSI+T24gMTEgQXByaWwgMjAxMCAwNzowMCwgTWljaGFlbCBTbm95bWFu ICZsdDs8YSBocmVmPSJtYWlsdG86bWljaGFlbEBzbm95bWFuLmNvbSI+bWljaGFlbEBzbm95bWFu LmNvbTwvYT4mZ3Q7IHdyb3RlOjxicj4KJmd0OyZndDsgLSBXb3VsZG4mIzM5O3QgaXQgYmUgc2lt cGxlciB0byBhdXR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0aXZlbHksIEkgY291bGQgc2VwYXJhdGUg cGFyc2VSb3V0ZXMgZnJvbTxicj4KY3JlYXRlUm91dGVzPGJyPgphbmQgbWFrZSB0aGUgcmVzb3Vy Y2VzIGEgdG9wIGxldmVsIGRlY2xhcmF0aW9uLCB3aGljaCB3b3VsZG4mIzM5O3QgcmVxdWlyZSBh bnk8YnI+CmNoYW5nZXMgb24geW91ciBwYXJ0Li4uKTxicj4KPGZvbnQgY29sb3I9IiM4ODg4ODgi Pjxmb250IGNsYXNzPSJBcHBsZS1zdHlsZS1zcGFuIiBjb2xvcj0iIzAwMDAwMCI+PGZvbnQgY2xh c3M9IkFwcGxlLXN0eWxlLXNwYW4iIGNvbG9yPSIjODg4ODg4Ij48YnI+PC9mb250PjwvZm9udD48 L2ZvbnQ+PC9ibG9ja3F1b3RlPjxkaXY+QWN0dWFsbHksIHRoYXQgc291bmRzIGxpa2UgYSBtdWNo IGJldHRlciBpZGVhLiBJJiMzOTttIHRyeWluZyB0byBlbnN1cmUgdGhhdCB3ZWItcm91dGVzLXF1 YXNpIGdlbmVyYXRlZCBjb2RlIGNvbXBpbGVzIHdpdGhvdXQgd2FybmluZ3Mgb24gLVdhbGwsIGFu ZCBleHBvcnRpbmcgaW5mb3JtYXRpb24gdGhhdCB3b24mIzM5O3QgYmUgdXNlZCBub3JtYWxseSB3 b3VsZCBnZW5lcmF0ZSBhbiB1bnVzZWQgd2FybmluZy48L2Rpdj4KPGRpdj48YnI+PC9kaXY+PGRp dj5NaWNoYWVsPC9kaXY+PC9kaXY+Cg== --===============1425382960396140309==-- From michael@snoyman.com Mon Apr 12 10:33:28 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] web-routes-quasi Date: Mon, 12 Apr 2010 08:05:27 -0700 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6346732679961656255==" --===============6346732679961656255== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit On Mon, Apr 12, 2010 at 1:44 AM, Alberto G. Corona wrote: > Hi Michael, > > I´m involved in the development of an application server (not a framework) > with rather different goals than Yessod (its´nt so elegant). I will tell > more about it whenever there is something solid enough to play with it. > > Just a few questions to clarify my mind: > > When you mention WAI you mean Web Access Initiative? I checked your > Network.WAI package and it seems that gzip facilities and so on have nothing > in common with usability and accesibility issues. > > No, it stands for Web Application Interface. It's a standardized interface between web applications and web servers, so you can write an application once and have it run on multiple backends, eg CGI, FastCGI, stand-alone server. > - Could you point me to documentation about web-routes? I´m in the internet > business since a few years, so I suspect that I know this with another name. > > Thank you a lot. > > web-routes is not yet released; the code is available at http://src.seereason.com/web-routes/. I believe Jeremy will be releasing it in the not-too-distant future, and there will be more documentation available then. I also just wrote a blog entry[1] that tangentially addressed it. Michael [1] http://www.snoyman.com/blog/entry/whats-cooking-with-yesod/ > 2010/4/3 Michael Snoyman > >> web-routes-quasi is now at the point where it can be used for sites, and >> I'd love to hear some feedback. I've put together a little sample that >> demonstrates how you can use quasi-quoting and define your routes, embed >> subsites and serve the resulting application via WAI. (My example uses WAI, >> but the package itself is not tied to WAI.) >> >> The code is on github[1]; the main function for the blog is in blog.hs >> (with the lowercase b). I believe this just depends on Jeremy's web-routes >> package, wai and wai-extra. >> >> Note that I did not use web-routes-wai; I think there are some problems in >> there for breaking up the pathinfo, and I didn't have time to dig through >> it. Also, this package currently ignores entirely the defaultPage component >> of Site, though if there is desire support can be added for it. >> >> One minor bug is that you can't have an alternate GET, POST, PUT or DELETE >> constructor imported; hopefully that will get cleaned up. >> >> Any comments and suggestions are welcome! My goal is to port Yesod over to >> this as soon as the web-routes set of packages are released, so if you're >> interested in Yesod, you should be interested in this too ;). >> >> Michael >> >> [1] http://github.com/snoyberg/web-routes-quasi >> >> _______________________________________________ >> web-devel mailing list >> web-devel@haskell.org >> http://www.haskell.org/mailman/listinfo/web-devel >> >> > --===============6346732679961656255== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 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tcXVhc2k8L2E+PC9kaXY+Cjxicj48L2Rpdj48L2Rp dj48ZGl2IGNsYXNzPSJpbSI+X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX188YnI+CndlYi1kZXZlbCBtYWlsaW5nIGxpc3Q8YnI+CjxhIGhyZWY9Im1haWx0bzp3 ZWItZGV2ZWxAaGFza2VsbC5vcmciIHRhcmdldD0iX2JsYW5rIj53ZWItZGV2ZWxAaGFza2VsbC5v cmc8L2E+PGJyPgo8YSBocmVmPSJodHRwOi8vd3d3Lmhhc2tlbGwub3JnL21haWxtYW4vbGlzdGlu Zm8vd2ViLWRldmVsIiB0YXJnZXQ9Il9ibGFuayI+aHR0cDovL3d3dy5oYXNrZWxsLm9yZy9tYWls bWFuL2xpc3RpbmZvL3dlYi1kZXZlbDwvYT48YnI+Cjxicj48L2Rpdj48L2Jsb2NrcXVvdGU+PC9k aXY+PGJyPjwvZGl2PjwvZGl2PjwvZGl2Pgo8L2Jsb2NrcXVvdGU+PC9kaXY+PGJyPgo= --===============6346732679961656255==-- From thaldyron@gmail.com Mon Apr 12 12:25:35 2010 From: Peter Robinson To: web-devel@haskell.org Subject: Re: [web-devel] web-routes-quasi Date: Mon, 12 Apr 2010 18:57:12 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8954685016718772491==" --===============8954685016718772491== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On 12 April 2010 17:02, Michael Snoyman wrote: > On Mon, Apr 12, 2010 at 1:17 AM, Peter Robinson wrote: >> On 11 April 2010 07:00, Michael Snoyman wrote: >> >> - Wouldn't it be simpler to automatically derive an instance of Show >> >> for >> >> the MyRoute type? (Since MyRoute is created on the fly anyway, I don't >> >> see why anyone would want to derive a different Show instance.) >> >> >> > Multiple problems: >> > * The rest of web-routes doesn't use Show that way. >> > * Usually, we'll need another parameter to create this function, such as >> > the >> > application root. >> > * Show is usually the inverse of Read. I suppose we could make the Read >> > instance the other side, but that we're just not following what is >> > normally >> > expected of these instances, which is to return Haskell-formatted data. >> >> Right. I've noticed that your newest approach uses an "explode" function >> which makes the type signature of handler functions shorter. :) >> > Wow, I can't believe anyone was able to follow that code ;). My hat's off to > you. Well, using -ddump-splices it turned out to be an educative experience as it helped me to understand template haskell and quasi-quoting. The current implementation in GHC seems to be quite different from the one described in t= he original papers, so reading your code helped me fill in the blanks! :) > Someone (maybe you) mentioned earlier that web-routes-quasi is geared more > towards framework writers; I think this is probably very true. It wasn't me, but I do agree. ;) Nevertheless, I think web-routes-quasi together with a templating package will facilitate writing small web apps a lot. > Nonetheless, > before release I'll put in proper documentation about the type signatures of > all the parameters, since the whole thing can be very tricky. I myself had > trouble figuring it out for integration into Yesod, and I wrote all the > packages involved! >> >> - About the possibility of querying the supported methods: The use case >> >> scenario I have in mind is having a default handler for handling >> >> OPTIONS >> >> that returns the available methods. Currently this won't work since >> >> that >> >> part >> >> of the resource information is unavailable inside the handler. Do you >> >> have >> >> any >> >> thoughts on how to change the design to make this possible? >> > >> > Well, the simplest thing I can do is make the [Resource] result from the >> > quasi-quoting available, which would give you enough information to >> > write >> > something to intercept OPTIONS requests before handing them to the rest >> > of >> > the application. Does that sound good enough? >> >> Yes, sounds good. (Alternatively, I could separate parseRoutes from >> createRoutes >> and make the resources a top level declaration, which wouldn't require any >> changes on your part...) >> > Actually, that sounds like a much better idea. I'm trying to ensure that > web-routes-quasi generated code compiles without warnings on -Wall, and > exporting information that won't be used normally would generate an unused > warning. Ok, then let's leave it that way. Peter --===============8954685016718772491==-- From orclev@gmail.com Tue Apr 13 09:24:35 2010 From: Kyle Murphy To: web-devel@haskell.org Subject: Re: [web-devel] Re: The state of documentation Date: Tue, 13 Apr 2010 09:56:37 -0400 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5143554241567685860==" --===============5143554241567685860== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable I haven't received any response on this at all so far, which I'm not sure how to interpret. Does everyone think I should submit the updated documentation to the maintainer of the xhtml package, or is there some issue someone would have with seeing these changes in the official distribution? I'm also not sure I'm completely done updating the docs, I'd like to see some better documentation on the actual functions themselves as well, and I'll probably do that before submitting it as a patch. -R. Kyle Murphy -- Curiosity was framed, Ignorance killed the cat. On Sat, Apr 10, 2010 at 03:16, Kyle Murphy wrote: > I managed to find some time to put together an example update of the > documentation for xhtml package with the sorts of changes I'd like to see > applied to as much of hackage as possible. You can find the updated haddock > at http://tenletters.org/haddock/index.html > > Depending on the feedback I get on this updated documentation I might try > to get in touch with the xhtml maintainer and have my changes merged in to > the official repository. Let me know what you guys think. > > > -R. Kyle Murphy > -- > Curiosity was framed, Ignorance killed the cat. > > > On Fri, Apr 9, 2010 at 15:02, Kyle Murphy wrote: > >> That blog post was excellent and fairly well captures the spirit of what I >> was getting at, although I do disagree somewhat about the auto-generated >> docs. I don't have any problem with auto-generated docs in and of >> themselves, assuming that you also insert into that documentation the sort >> of details discussed in the "topic guides". A great example of this is most >> of the POD used in Perl modules, where at least the first few paragraphs of >> documentation are typically devoted to essentially being a "topic guide" f= or >> that module. I think what she was really complaining about in that post is >> exactly the situation we have in hackage currently where there is for all >> intents and purpose absolutely no documentation provided for the vast >> majority of libraries beyond the automatically generated signatures and the >> odd sentence or two. >> >> Something I'd like to see become common in haddock is for instance, a good >> general description, with references to sub-modules in the main module of a >> package. Each sub-module would then function as a topic guide for the >> features of that module, with the specific API details contained in the >> function descriptions. If I have some time this weekend maybe I'll pull do= wn >> the source for Text.XHTML, and try to update its documentation to provide = an >> example of what I'm getting at. >> >> >> -R. Kyle Murphy >> -- >> Curiosity was framed, Ignorance killed the cat. >> >> >> On Fri, Apr 9, 2010 at 14:36, Gour wrote: >> >>> On Fri, 9 Apr 2010 14:07:28 -0400 >>> >>>>>> "Kyle" =3D=3D Kyle Murphy wrote: >>> >>> Kyle> The next highest level of documentation, what's severely lacking >>> Kyle> in the Haskell community in general, and the web development >>> Kyle> community in particular, is the in depth documentation for the >>> Kyle> libraries/frameworks. These documents aren't quite tutorials, >>> Kyle> but they go beyond just telling you the minimal information you >>> Kyle> need to use a function. This sort of document would typically >>> Kyle> have a section for each of the major use cases of your >>> Kyle> framework/library, and possibly a few brief code snippets >>> Kyle> showing how you go about doing particular things. For instance, >>> Kyle> in the Text.XHTML package, this document would most likely list >>> Kyle> the various functions for generating html elements like br, as >>> Kyle> well as have a section talking about the attribute op (!), the >>> Kyle> Html concatination op (+++), and the Html nesting op (<<), and >>> Kyle> provide examples of how to construct a few example pages. It's >>> Kyle> this level of documentation that's really missing, and where >>> Kyle> most people would head to once they finish following along on >>> Kyle> some tutorial. >>> >>> If we consider that Django is nicely documented and can be used as >>> example, do you think about stuff called 'topic guides' listed at >>> >>> http://docs.djangoproject.com/en/dev/intro/whatsnext/#intro-whatsnext >>> >>> i.e. something in between tutorial and API reference? >>> >>> Here is blog post about it: >>> >>> http://jacobian.org/writing/great-documentation/what-to-write/ >>> >>> Kyle> As a final thought, haddock itself might even be leveraged to >>> Kyle> provide this higher level documentation, it certainly has the >>> Kyle> capability of doing so, it just generally isn't used in that way. >>> Kyle> The brief summary most people put at the top of the generated >>> Kyle> haddock, which usually consists of a one or two sentence >>> Kyle> description of what the library provides, could instead be used >>> Kyle> to provide details of all the use cases, and links to the >>> Kyle> appropiate pieces of documentation. >>> >>> Long ago I was suggesting on 'cafe' that it would be nice if the >>> haddock documentation would have some 'examples of usage', but it >>> looks it is too much and we are still far from it... >>> >>> >>> Sincerely, >>> Gour >>> >>> -- >>> >>> Gour | Hlapicina, Croatia | GPG key: F96FF5F6 >>> ---------------------------------------------------------------- >>> >>> _______________________________________________ >>> web-devel mailing list >>> web-devel@haskell.org >>> http://www.haskell.org/mailman/listinfo/web-devel >>> >>> >> > --===============5143554241567685860== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SSBoYXZlbiYjMzk7dCByZWNlaXZlZCBhbnkgcm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4KPC9kaXY+PC9kaXY+ PC9ibG9ja3F1b3RlPjwvZGl2Pjxicj4K --===============5143554241567685860==-- From orclev@gmail.com Tue Apr 13 14:59:51 2010 From: Kyle Murphy To: web-devel@haskell.org Subject: Re: [web-devel] Re: The state of documentation Date: Tue, 13 Apr 2010 15:31:54 -0400 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4581613652870741382==" --===============4581613652870741382== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Thanks for the feedback. The original docs can be found here ( http://hackage.haskell.org/package/xhtml-3000.2.0.1 ). The changes I added at this point are exclusively in the main description of the Text.XHtml, Text.XHtml.Table, Text.XHtml.Strict, Text.XHtml.Transitional and Text.XHtml.Frameset modules. For the Strict, Transitional, and Frameset modules the only changes from the original is a blurb about checking the main Text.XHtml package for detailed documentation. As for tutorial.happstack.com, no, I don't think that's an example of a "bad tutorial", nor was I complaining that the tutorials available for Haskell are in general bad. My complaint is more that the tutorials can only really be responsible for covering so much material at which point the core documentation (either the auto-generated stuff on hackage, or some other source that's mostly non-existent right now) needs to take up the slack. Text.XHtml is relatively simple, so I was able to provide the kind of documentation it needs directly in the haddock, but for larger non-trivial libraries we really need some kind of standardized location for documentation. Ideally wherever that is should also be intergrated into hackage somehow, as hackage is where most newbies are going to go looking for packages, and the documentation of said packages. That being said, there's currently discussion going on in the other mailing lists about modifications to Hackage to add better support for documentation in general, and user contributed documentation in particular, so maybe it's just a matter of time. -R. Kyle Murphy -- Curiosity was framed, Ignorance killed the cat. On Tue, Apr 13, 2010 at 14:51, Thomas Hartman wrote: > Hi Kyle, > > On the whole I am always thrilled when someone works to improve the > haskell docu, particularly in the web space. > > I am the author of tutorial.happstack.com, which I admit might be an > example of the type of "bad" tutorials you write of, which > nevertheless fill a necessary gap during documentation coallescence. > > The reason I didn't give you any feedback is there wasn't an > easy/fast way for me to see what changes you had made, other than > flipping back and forth from your docu to the original docu, and I'm > not even sure where the existing docu is -- hackage I suppose. > > If you had used github or (plug) patch-tag, you might have gotten > more feedback, or even if you had just (re)stated the type of changes > you had made. > > Anyway thank you for working to improve the state of haskell on web > docu, and of course, contribute back to the xhtml maintainers. > > Cheers, thomas. > > > > On Tue, Apr 13, 2010 at 6:56 AM, Kyle Murphy wrote: > > I haven't received any response on this at all so far, which I'm not sure > > how to interpret. Does everyone think I should submit the updated > > documentation to the maintainer of the xhtml package, or is there some > issue > > someone would have with seeing these changes in the official > distribution? > > I'm also not sure I'm completely done updating the docs, I'd like to see > > some better documentation on the actual functions themselves as well, and > > I'll probably do that before submitting it as a patch. > > > > -R. Kyle Murphy > > -- > > Curiosity was framed, Ignorance killed the cat. > > > > > > On Sat, Apr 10, 2010 at 03:16, Kyle Murphy wrote: > >> > >> I managed to find some time to put together an example update of the > >> documentation for xhtml package with the sorts of changes I'd like to > see > >> applied to as much of hackage as possible. You can find the updated > haddock > >> at http://tenletters.org/haddock/index.html > >> > >> Depending on the feedback I get on this updated documentation I might > try > >> to get in touch with the xhtml maintainer and have my changes merged in > to > >> the official repository. Let me know what you guys think. > >> > >> -R. Kyle Murphy > >> -- > >> Curiosity was framed, Ignorance killed the cat. > >> > >> > >> On Fri, Apr 9, 2010 at 15:02, Kyle Murphy wrote: > >>> > >>> That blog post was excellent and fairly well captures the spirit of > what > >>> I was getting at, although I do disagree somewhat about the > auto-generated > >>> docs. I don't have any problem with auto-generated docs in and of > >>> themselves, assuming that you also insert into that documentation the > sort > >>> of details discussed in the "topic guides". A great example of this is > most > >>> of the POD used in Perl modules, where at least the first few > paragraphs of > >>> documentation are typically devoted to essentially being a "topic > guide" for > >>> that module. I think what she was really complaining about in that post > is > >>> exactly the situation we have in hackage currently where there is for > all > >>> intents and purpose absolutely no documentation provided for the vast > >>> majority of libraries beyond the automatically generated signatures and > the > >>> odd sentence or two. > >>> > >>> Something I'd like to see become common in haddock is for instance, a > >>> good general description, with references to sub-modules in the main > module > >>> of a package. Each sub-module would then function as a topic guide for > the > >>> features of that module, with the specific API details contained in the > >>> function descriptions. If I have some time this weekend maybe I'll pull > down > >>> the source for Text.XHTML, and try to update its documentation to > provide an > >>> example of what I'm getting at. > >>> > >>> -R. Kyle Murphy > >>> -- > >>> Curiosity was framed, Ignorance killed the cat. > >>> > >>> > >>> On Fri, Apr 9, 2010 at 14:36, Gour wrote: > >>>> > >>>> On Fri, 9 Apr 2010 14:07:28 -0400 > >>>> >>>>>> "Kyle" == Kyle Murphy wrote: > >>>> > >>>> Kyle> The next highest level of documentation, what's severely lacking > >>>> Kyle> in the Haskell community in general, and the web development > >>>> Kyle> community in particular, is the in depth documentation for the > >>>> Kyle> libraries/frameworks. These documents aren't quite tutorials, > >>>> Kyle> but they go beyond just telling you the minimal information you > >>>> Kyle> need to use a function. This sort of document would typically > >>>> Kyle> have a section for each of the major use cases of your > >>>> Kyle> framework/library, and possibly a few brief code snippets > >>>> Kyle> showing how you go about doing particular things. For instance, > >>>> Kyle> in the Text.XHTML package, this document would most likely list > >>>> Kyle> the various functions for generating html elements like br, as > >>>> Kyle> well as have a section talking about the attribute op (!), the > >>>> Kyle> Html concatination op (+++), and the Html nesting op (<<), and > >>>> Kyle> provide examples of how to construct a few example pages. It's > >>>> Kyle> this level of documentation that's really missing, and where > >>>> Kyle> most people would head to once they finish following along on > >>>> Kyle> some tutorial. > >>>> > >>>> If we consider that Django is nicely documented and can be used as > >>>> example, do you think about stuff called 'topic guides' listed at > >>>> > >>>> http://docs.djangoproject.com/en/dev/intro/whatsnext/#intro-whatsnext > >>>> > >>>> i.e. something in between tutorial and API reference? > >>>> > >>>> Here is blog post about it: > >>>> > >>>> http://jacobian.org/writing/great-documentation/what-to-write/ > >>>> > >>>> Kyle> As a final thought, haddock itself might even be leveraged to > >>>> Kyle> provide this higher level documentation, it certainly has the > >>>> Kyle> capability of doing so, it just generally isn't used in that > way. > >>>> Kyle> The brief summary most people put at the top of the generated > >>>> Kyle> haddock, which usually consists of a one or two sentence > >>>> Kyle> description of what the library provides, could instead be used > >>>> Kyle> to provide details of all the use cases, and links to the > >>>> Kyle> appropiate pieces of documentation. > >>>> > >>>> Long ago I was suggesting on 'cafe' that it would be nice if the > >>>> haddock documentation would have some 'examples of usage', but it > >>>> looks it is too much and we are still far from it... > >>>> > >>>> > >>>> Sincerely, > >>>> Gour > >>>> > >>>> -- > >>>> > >>>> Gour | Hlapicina, Croatia | GPG key: F96FF5F6 > >>>> ---------------------------------------------------------------- > >>>> > >>>> _______________________________________________ > >>>> web-devel mailing list > >>>> web-devel@haskell.org > >>>> http://www.haskell.org/mailman/listinfo/web-devel > >>>> > >>> > >> > > > > > > _______________________________________________ > > web-devel mailing list > > web-devel@haskell.org > > http://www.haskell.org/mailman/listinfo/web-devel > > > > > > > > -- > Need somewhere to put your code? http://patch-tag.com > Want to build a webapp? http://happstack.com > --===============4581613652870741382== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 VGhhbmtzIGZvciB0aGUgZmVlZGJhY2suIFRoZSBvcmlnaW5hbCBkb2NzIGNhbiBiZSBmb3VuZCBo ZXJlIDxicj4oIDxhIGhyZWY9Imh0dHA6Ly9oYWNrYWdlLmhhc2tlbGwub3JnL3BhY2thZ2UveGh0 bWwtMzAwMC4yLjAuMSI+aHR0cDovL2hhY2thZ2UuaGFza2VsbC5vcmcvcGFja2FnZS94aHRtbC0z MDAwLjIuMC4xPC9hPiApLiBUaGUgPGJyPmNoYW5nZXMgSSBhZGRlZCBhdCB0aGlzIHBvaW50IGFy ZSBleGNsdXNpdmVseSBpbiB0aGUgbWFpbiBkZXNjcmlwdGlvbiA8YnI+Cm9mIHRoZSBUZXh0LlhI dG1sLCBUZXh0LlhIdG1sLlRhYmxlLCBUZXh0LlhIdG1sLlN0cmljdCwgPGJyPlRleHQuWEh0bWwu VHJhbnNpdGlvbmFsIGFuZCBUZXh0LlhIdG1sLkZyYW1lc2V0IG1vZHVsZXMuIEZvciB0aGUgPGJy PlN0cmljdCwgVHJhbnNpdGlv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EgaHJlZj0iaHR0cDovL2hhcHBzdGFjay5jb20iIHRh cmdldD0iX2JsYW5rIj5odHRwOi8vaGFwcHN0YWNrLmNvbTwvYT48YnI+CjwvZm9udD48L2Jsb2Nr cXVvdGU+PC9kaXY+PGJyPgo= --===============4581613652870741382==-- From michael@snoyman.com Tue Apr 13 15:22:30 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Re: The state of documentation Date: Tue, 13 Apr 2010 12:54:31 -0700 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3748242926035302949==" --===============3748242926035302949== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Fri, Apr 9, 2010 at 8:06 AM, Michael Snoyman wrote: > > > On Fri, Apr 9, 2010 at 3:32 AM, Gour wrote: > >> On Fri, 9 Apr 2010 08:36:51 +0200 >> >>>>>> "Simon" == Simon Hengel wrote: >> >> Simon> My feeling is that we lack mostly short, tutorial-style >> Simon> introductions, that just get you started with a topic/library. >> >> I agree. >> >> Moreover, practically every 'framework' (except Happs) is more or less >> one-man show band, i.e. it works for their authors without docs, but >> that's not the way one can build community around it...And without >> some 'critical' mass of users, one is reluctant to invest time/energy >> into such products...Kind a catch-22. :-( >> >> >> I can't speak for others, but I personally don't have a problem investing > in documentation on my one-man-show libraries. In the specific case of > Yesod, I *know* it's going to have some major changes in the next release, > so it's not worth it right now. > > In general, I think the problem for library writers is that- since *we* > wrote the code- we don't know what's confusing about it. As far as we're > concerned, our code is beautiful, elegant, simple and self-documenting > (until we look at it again six months later). We really need an outside > voice to tell us what's lacking. > > So instead of saying "fizzbuzz has no documentation," maybe say "I saw the > fizzbuzz tutorial on creating foobars, but I couldn't figure out how to > extend that for wibbles. Could you write a tutorial for that?" > > > So I finally decided to start on the documentation front. Thanks to everyone who's kicked me to get it done, and thanks in particular to Gour for reviewing some of it for me. I'll be placing on Yesod-related documentation on a new site: http://docs.yesodweb.com/ I'm using Hakyll to generate the site, which is working very nicely. The code is all available on github (http://github.com/snoyberg/yesoddocs), so if anyone wants to make changes, you can either e-mail me or send a patch. It's not *quite* as nice as a wiki for collaboration, but hopefully will be easier to follow. Next goal will be to put up docs on web-routes-quasi. Michael --===============3748242926035302949== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gRnJpLCBBcHIgOSwgMjAxMCBhdCA4 OjA2IEFNLCBNaWNoYWVsIFNub3ltYW4gPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWls dG86bWljaGFlbEBzbm95bWFuLmNvbSI+bWljaGFlbEBzbm95bWFuLmNvbTwvYT4mZ3Q7PC9zcGFu PiB3cm90ZTo8YnI+PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0ibWFyZ2lu OjAgMCAwIC44ZXg7Ym9yZGVyLWxlZnQ6MXB4ICNjY2Mgc29saWQ7cGFkZGluZy1sZWZ0OjFleDsi Pgo8YnI+PGJyPjxkaXYgY2xhc3M9ImdtYWlsX3F1b3RlIj48ZGl2IGNsYXNzPSJpbSI+T24gRnJp LCBBcHIgOSwgMjAxMCBhdCAzOjMyIEFNLCBHb3VyIDxzcGFuIGRpcj0ibHRyIj4mbHQ7PGEgaHJl Zj0ibWFpbHRvOmdvdXJAZ291ci1uaXRhaS5jb20iIHRhcmdldD0iX2JsYW5rIj5nb3VyQGdvdXIt bml0YWkuY29tPC9hPiZndDs8L3NwYW4+IHdyb3RlOjxicj48YmxvY2txdW90ZSBjbGFzcz0iZ21h aWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46MCAwIDAgLjhleDtib3JkZXItbGVmdDoxcHggI2NjYyBz b2xpZDtwYWRkaW5nLWxlZnQ6MWV4Ij4KCk9uIEZyaSwgOSBBcHIgMjAxMCAwODozNjo1MSArMDIw MDxicj4KJmd0OyZndDsmZ3Q7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vdCAqcXVpdGUq IGFzIG5pY2UgYXMgYSB3aWtpIGZvciBjb2xsYWJvcmF0aW9uLCBidXQgaG9wZWZ1bGx5IHdpbGwg YmUgZWFzaWVyIHRvIGZvbGxvdy48L2Rpdj4KPGRpdj48YnI+PC9kaXY+PGRpdj5OZXh0IGdvYWwg d2lsbCBiZSB0byBwdXQgdXAgZG9jcyBvbiB3ZWItcm91dGVzLXF1YXNpLjwvZGl2PjxkaXY+PGJy PjwvZGl2PjxkaXY+TWljaGFlbDwvZGl2PjwvZGl2Pgo= --===============3748242926035302949==-- From michael@snoyman.com Tue Apr 13 15:50:56 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Re: The state of documentation Date: Tue, 13 Apr 2010 13:22:58 -0700 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5018230411912400231==" --===============5018230411912400231== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit I'm torn on this one. I'm not going to bother retroactively doing documentation for 0.0.0; however, once I release 0.2.0, and I work on 0.4.0, I'd like people to have access to documentation on released code as well as development code. I'm not quite certain... As far as that intro page, I was providing that table more as a comparison, but I think I'll be removing it entirely. Michael On Tue, Apr 13, 2010 at 1:18 PM, Thomas Hartman < thomashartman1@googlemail.com> wrote: > It looks great. > > My only possible nit is that it seems odd to include docu for 0.0.0 as > well as 0.0.2, why not just do the latest and let the past be done? > > On Tue, Apr 13, 2010 at 12:54 PM, Michael Snoyman > wrote: > > > > > > On Fri, Apr 9, 2010 at 8:06 AM, Michael Snoyman > wrote: > >> > >> > >> On Fri, Apr 9, 2010 at 3:32 AM, Gour wrote: > >>> > >>> On Fri, 9 Apr 2010 08:36:51 +0200 > >>> >>>>>> "Simon" == Simon Hengel wrote: > >>> > >>> Simon> My feeling is that we lack mostly short, tutorial-style > >>> Simon> introductions, that just get you started with a topic/library. > >>> > >>> I agree. > >>> > >>> Moreover, practically every 'framework' (except Happs) is more or less > >>> one-man show band, i.e. it works for their authors without docs, but > >>> that's not the way one can build community around it...And without > >>> some 'critical' mass of users, one is reluctant to invest time/energy > >>> into such products...Kind a catch-22. :-( > >>> > >>> > >> I can't speak for others, but I personally don't have a problem > investing > >> in documentation on my one-man-show libraries. In the specific case of > >> Yesod, I *know* it's going to have some major changes in the next > release, > >> so it's not worth it right now. > >> In general, I think the problem for library writers is that- since *we* > >> wrote the code- we don't know what's confusing about it. As far as we're > >> concerned, our code is beautiful, elegant, simple and self-documenting > >> (until we look at it again six months later). We really need an outside > >> voice to tell us what's lacking. > >> So instead of saying "fizzbuzz has no documentation," maybe say "I saw > the > >> fizzbuzz tutorial on creating foobars, but I couldn't figure out how to > >> extend that for wibbles. Could you write a tutorial for that?" > >> > > So I finally decided to start on the documentation front. Thanks to > everyone > > who's kicked me to get it done, and thanks in particular to Gour for > > reviewing some of it for me. I'll be placing on Yesod-related > documentation > > on a new site: > > http://docs.yesodweb.com/ > > I'm using Hakyll to generate the site, which is working very nicely. The > > code is all available on github (http://github.com/snoyberg/yesoddocs), > so > > if anyone wants to make changes, you can either e-mail me or send a > patch. > > It's not *quite* as nice as a wiki for collaboration, but hopefully will > be > > easier to follow. > > Next goal will be to put up docs on web-routes-quasi. > > Michael > > _______________________________________________ > > web-devel mailing list > > web-devel@haskell.org > > http://www.haskell.org/mailman/listinfo/web-devel > > > > > > > > -- > Need somewhere to put your code? http://patch-tag.com > Want to build a webapp? http://happstack.com > --===============5018230411912400231== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SSYjMzk7bSB0b3JuIG9uIHRoaXMgb25lLiBJJiMzOTttIG5vdCBnb2luZyB0byBib3RoZXIgcmV0 cm9hY3RpdmVseSBkb2luZyBkb2N1bWVudGF0aW9uIGZvciAwLjAuMDsgaG93ZXZlciwgb25jZSBJ IHJlbGVhc2UgMC4yLjAsIGFuZCBJIHdvcmsgb24gMC40LjAsIEkmIzM5O2QgbGlrZSBwZW9wbGUg dG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d2lsbCBiZSB0byBw dXQgdXAgZG9jcyBvbiB3ZWItcm91dGVzLXF1YXNpLjxicj4KJmd0OyBNaWNoYWVsPGJyPgo8L2Rp dj48L2Rpdj48ZGl2PjxkaXY+PC9kaXY+PGRpdiBjbGFzcz0iaDUiPiZndDsgX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX188YnI+CiZndDsgd2ViLWRldmVsIG1h aWxpbmcgbGlzdDxicj4KJmd0OyA8YSBocmVmPSJtYWlsdG86d2ViLWRldmVsQGhhc2tlbGwub3Jn Ij53ZWItZGV2ZWxAaGFza2VsbC5vcmc8L2E+PGJyPgomZ3Q7IDxhIGhyZWY9Imh0dHA6Ly93d3cu aGFza2VsbC5vcmcvbWFpbG1hbi9saXN0aW5mby93ZWItZGV2ZWwiIHRhcmdldD0iX2JsYW5rIj5o dHRwOi8vd3d3Lmhhc2tlbGwub3JnL21haWxtYW4vbGlzdGluZm8vd2ViLWRldmVsPC9hPjxicj4K Jmd0Ozxicj4KJmd0Ozxicj4KPGJyPgo8YnI+Cjxicj4KLS08YnI+Ck5lZWQgc29tZXdoZXJlIHRv IHB1dCB5b3VyIGNvZGU/IDxhIGhyZWY9Imh0dHA6Ly9wYXRjaC10YWcuY29tIiB0YXJnZXQ9Il9i bGFuayI+aHR0cDovL3BhdGNoLXRhZy5jb208L2E+PGJyPgpXYW50IHRvIGJ1aWxkIGEgd2ViYXBw PyA8YSBocmVmPSJodHRwOi8vaGFwcHN0YWNrLmNvbSIgdGFyZ2V0PSJfYmxhbmsiPmh0dHA6Ly9o YXBwc3RhY2suY29tPC9hPjxicj4KPC9kaXY+PC9kaXY+PC9ibG9ja3F1b3RlPjwvZGl2Pjxicj48 L2Rpdj4K --===============5018230411912400231==-- From james@neurogami.com Thu Apr 15 02:43:58 2010 From: James Britt To: web-devel@haskell.org Subject: Re: [web-devel] Re: Hamlet & Haml Date: Thu, 15 Apr 2010 00:16:04 -0700 Message-ID: <4BC6BD34.1090106@neurogami.com> In-Reply-To: <20100412121619.0e1a5467@gaura-nitai> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6325206557685804380==" --===============6325206557685804380== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Gour wrote: > On Sun, 11 Apr 2010 23:14:15 -0700 >>>>>>> "Michael" == Michael Snoyman wrote: > > Michael> Funny to see this mentioned right now; I'm in the middle of > Michael> incorporating it into Yesod. It's most definitely haml-like: > > Heh...somehow I've stumbled upon Haml/Sass after researching about > static-site generators (StaticMatic supports Haml) and then thought > about Haskell...which has brought me to Hamlet. :-) > > The wikipedia page (http://en.wikipedia.org/wiki/Haml#Implementations) > lists severeal implementations, that's why I've asked if Hamlet could > be counted as one? > > Michael> haml itself allows embedding of arbitrary Ruby code, so that's > Michael> not really something I'm interested in here. > > Same here. No interest in Ruby. The use of Ruby is orthogonal to Haml. Ruby implementations allow for inserting Ruby. There's no reason any other implementation has to do that. It's meant to output (x)html. A Haskell version could have inline Haskell. Or not. (That said, I can't stand Haml, and it's popularity among Rubyists is depressing. I'd avoid it just as much were it part of any Haskell lib.) James -- Neurogami - Smart application development http://www.neurogami.com james@neurogami.com --===============6325206557685804380==-- From michael@snoyman.com Thu Apr 15 10:51:27 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Re: Hamlet & Haml Date: Thu, 15 Apr 2010 08:23:34 -0700 Message-ID: In-Reply-To: <4BC6BD34.1090106@neurogami.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7509948814997154369==" --===============7509948814997154369== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Thu, Apr 15, 2010 at 12:16 AM, James Britt wrote: > Gour wrote: > > On Sun, 11 Apr 2010 23:14:15 -0700 > >>>>>>> "Michael" == Michael Snoyman wrote: > > > > Michael> Funny to see this mentioned right now; I'm in the middle of > > Michael> incorporating it into Yesod. It's most definitely haml-like: > > > > Heh...somehow I've stumbled upon Haml/Sass after researching about > > static-site generators (StaticMatic supports Haml) and then thought > > about Haskell...which has brought me to Hamlet. :-) > > > > The wikipedia page (http://en.wikipedia.org/wiki/Haml#Implementations) > > lists severeal implementations, that's why I've asked if Hamlet could > > be counted as one? > > > > Michael> haml itself allows embedding of arbitrary Ruby code, so that's > > Michael> not really something I'm interested in here. > > > > Same here. No interest in Ruby. > > The use of Ruby is orthogonal to Haml. Ruby implementations allow for > inserting Ruby. There's no reason any other implementation has to do that. > It's meant to output (x)html. A Haskell version could have inline > Haskell. Or not. > > I really was saying that I don't want to allow embedding of arbitrary code in templates. > (That said, I can't stand Haml, and it's popularity among Rubyists is > depressing. I'd avoid it just as much were it part of any Haskell lib.) > > Out of curiosity, why? I've never really used it large-scale before, but it seems to work rather nicely. Michael --===============7509948814997154369== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gVGh1LCBBcHIgMTUsIDIwMTAgYXQg MTI6MTYgQU0sIEphbWVzIEJyaXR0IDxzcGFuIGRpcj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFpbHRv OmphbWVzQG5ldXJvZ2FtaS5jb20iPmphbWVzQG5ldXJvZ2FtaS5jb208L2E+Jmd0Ozwvc3Bhbj4g d3JvdGU6PGJyPjxibG9ja3F1b3RlIGNsYXNzPSJnbWFpbF9xdW90ZSIgc3R5bGU9Im1hcmdpbjow IDAgMCAuOGV4O2JvcmRlci1sZWZ0OjFweCAjY2NjIHNvbGlkO3BhZGRpbmctbGVmdDoxZXg7Ij4K PGRpdiBjbGFzcz0iaW0iPkdvdXIgd3JvdGU6PGJyPgomZ3Q7IE9uIFN1biwgMTEgQXByIDIwMTAg MjM6MTQ6MTUgLTA3MDA8YnI+CiZndDsmZ3Q7Jmd0OyZndDsmZ3Q7Jmd0OyZndDsgJnF1b3Q7TWlj aGFlbCZxdW90OyA9PSBNaWNoYWVsIFNub3ltY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hbnkgSGFza2Vs bCBsaWIuKTxicj4KPGJyPjwvYmxvY2txdW90ZT48ZGl2Pk91dCBvZiBjdXJpb3NpdHksIHdoeT8g SSYjMzk7dmUgbmV2ZXIgcmVhbGx5IHVzZWQgaXQgbGFyZ2Utc2NhbGUgYmVmb3JlLCBidXQgaXQg c2VlbXMgdG8gd29yayByYXRoZXIgbmljZWx5LjwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+TWlj aGFlbDwvZGl2PjwvZGl2Pgo= --===============7509948814997154369==-- From jeremy@n-heptane.com Fri Apr 16 18:36:59 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: [web-devel] Re: web-routes-quasi Date: Fri, 16 Apr 2010 18:09:05 -0500 Message-ID: <6D7FB2DE-AC08-4065-BAC9-E4C142AFFD02@n-heptane.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8961613177752731229==" --===============8961613177752731229== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hello, I poked at it a bit, but don't have anything especially interesting to say. Obviously, I would like it if there was ways to do things like map integers to newtyped values. Or to allow the use of 'variables' other than strings and ints. But, I am not actually clear that those things can be implemented :) Once I actually try to use quasi for a project I will likely have more feedback. - jeremy On Apr 2, 2010, at 5:51 PM, Michael Snoyman wrote: > web-routes-quasi is now at the point where it can be used for sites, > and I'd love to hear some feedback. I've put together a little > sample that demonstrates how you can use quasi-quoting and define > your routes, embed subsites and serve the resulting application via > WAI. (My example uses WAI, but the package itself is not tied to WAI.) > > The code is on github[1]; the main function for the blog is in > blog.hs (with the lowercase b). I believe this just depends on > Jeremy's web-routes package, wai and wai-extra. > > Note that I did not use web-routes-wai; I think there are some > problems in there for breaking up the pathinfo, and I didn't have > time to dig through it. Also, this package currently ignores > entirely the defaultPage component of Site, though if there is > desire support can be added for it. > > One minor bug is that you can't have an alternate GET, POST, PUT or > DELETE constructor imported; hopefully that will get cleaned up. > > Any comments and suggestions are welcome! My goal is to port Yesod > over to this as soon as the web-routes set of packages are released, > so if you're interested in Yesod, you should be interested in this > too ;). > > Michael > > [1] http://github.com/snoyberg/web-routes-quasi --===============8961613177752731229== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGh0bWw+PGJvZHkgc3R5bGU9IndvcmQtd3JhcDogYnJlYWstd29yZDsgLXdlYmtpdC1uYnNwLW1v ZGU6IHNwYWNlOyAtd2Via2l0LWxpbmUtYnJlYWs6IGFmdGVyLXdoaXRlLXNwYWNlOyAiPkhlbGxv LDxkaXY+PGJyPjwvZGl2PjxkaXY+SSBwb2tlZCBhdCBpdCBhIGJpdCwgYnV0IGRvbid0IGhhdmUg YW55dGhpbmcgZXNwZWNpYWxseSBpbnRlcmVzdGluZyB0byBzYXkuPC9kaXY+PGRpdj48YnI+PC9k aXY+PGRpdj5PYnZpb3VzbHksIEkgd291bGQgbGlrZSBpdCBpZiB0aGVyZSB3YXMgd2F5cyB0byBk byB0aGluZ3MgbGlrZSBtYXAgaW50ZWdlcnMgdG8gbmV3dHlwZWQgdmFsdWVzLiBPciB0byBhbGxv dyB0aGUgdXNlIG9mICd2YXJpYWJsZXMnIG90aGVyIHRoYW4gc3RyaW5ncyBhbmQgaW50cy4gQnV0 LCBJIGFtIG5vdCBhY3R1YWxseSBjbGVhciB0aGF0IHRob3NlIHRoaW5ncyBjYW4gYmUgaW1wbGVt ZW50ZWQgOik8L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2Pk9uY2UgSSBhY3R1YWxseSB0cnkgdG8g dXNlIHF1YXNpIGZvciBhIHByb2plY3QgSSB3aWxsIGxpa2VseSBoYXZlIG1vcmUgZmVlZGJhY2su PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj4tIGplcmVteTwvZGl2PjxkaXY+PGJyPjxkaXY+PGRp dj5PbiBBcHIgMiwgMjAxMCwgYXQgNTo1MSBQTSwgTWljaGFlbCBTbm95bWFuIHdyb3RlOjwvZGl2 Pj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gcGFja2FnZSBjdXJyZW50 bHkgaWdub3JlcyBlbnRpcmVseSB0aGUgZGVmYXVsdFBhZ2UgY29tcG9uZW50IG9mIFNpdGUsIHRo b3VnaCBpZiB0aGVyZSBpcyBkZXNpcmUgc3VwcG9ydCBjYW4gYmUgYWRkZWQgZm9yIGl0LjwvZGl2 PiA8ZGl2Pjxicj48L2Rpdj48ZGl2Pk9uZSBtaW5vciBidWcgaXMgdGhhdCB5b3UgY2FuJ3QgaGF2 ZSBhbiBhbHRlcm5hdGUgR0VULCBQT1NULCBQVVQgb3IgREVMRVRFIGNvbnN0cnVjdG9yIGltcG9y dGVkOyBob3BlZnVsbHkgdGhhdCB3aWxsIGdldCBjbGVhbmVkIHVwLjwvZGl2PjxkaXY+PGJyPjwv ZGl2PjxkaXY+QW55IGNvbW1lbnRzIGFuZCBzdWdnZXN0aW9ucyBhcmUgd2VsY29tZSEgTXkgZ29h bCBpcyB0byBwb3J0IFllc29kIG92ZXIgdG8gdGhpcyBhcyBzb29uIGFzIHRoZSB3ZWItcm91dGVz IHNldCBvZiBwYWNrYWdlcyBhcmUgcmVsZWFzZWQsIHNvIGlmIHlvdSdyZSBpbnRlcmVzdGVkIGlu IFllc29kLCB5b3Ugc2hvdWxkIGJlIGludGVyZXN0ZWQgaW4gdGhpcyB0b28gOykuPC9kaXY+IDxk aXY+PGJyPjwvZGl2PjxkaXY+TWljaGFlbDwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+WzFdJm5i c3A7PGEgaHJlZj0iaHR0cDovL2dpdGh1Yi5jb20vc25veWJlcmcvd2ViLXJvdXRlcy1xdWFzaSI+ aHR0cDovL2dpdGh1Yi5jb20vc25veWJlcmcvd2ViLXJvdXRlcy1xdWFzaTwvYT48L2Rpdj48L2Js b2NrcXVvdGU+PC9kaXY+PGJyPjwvZGl2PjwvYm9keT48L2h0bWw+ --===============8961613177752731229==-- From michael@snoyman.com Fri Apr 16 19:35:39 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: [web-devel] Re: web-routes-quasi Date: Fri, 16 Apr 2010 17:07:50 -0700 Message-ID: In-Reply-To: <6D7FB2DE-AC08-4065-BAC9-E4C142AFFD02@n-heptane.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3242333516161199687==" --===============3242333516161199687== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cool. I agree that other types would be interesting, but as you said, implementation is a little tricky. I'm still in the process of modifying it as I integrate it with Yesod. In particular, support for subsites is getting better. I'm hoping it gets to the point of proper web plugins. Michael On Fri, Apr 16, 2010 at 4:09 PM, Jeremy Shaw wrote: > Hello, > > I poked at it a bit, but don't have anything especially interesting to say. > > Obviously, I would like it if there was ways to do things like map integers > to newtyped values. Or to allow the use of 'variables' other than strings > and ints. But, I am not actually clear that those things can be implemented > :) > > Once I actually try to use quasi for a project I will likely have more > feedback. > > - jeremy > > On Apr 2, 2010, at 5:51 PM, Michael Snoyman wrote: > > web-routes-quasi is now at the point where it can be used for sites, and > I'd love to hear some feedback. I've put together a little sample that > demonstrates how you can use quasi-quoting and define your routes, embed > subsites and serve the resulting application via WAI. (My example uses WAI, > but the package itself is not tied to WAI.) > > The code is on github[1]; the main function for the blog is in blog.hs > (with the lowercase b). I believe this just depends on Jeremy's web-routes > package, wai and wai-extra. > > Note that I did not use web-routes-wai; I think there are some problems in > there for breaking up the pathinfo, and I didn't have time to dig through > it. Also, this package currently ignores entirely the defaultPage component > of Site, though if there is desire support can be added for it. > > One minor bug is that you can't have an alternate GET, POST, PUT or DELETE > constructor imported; hopefully that will get cleaned up. > > Any comments and suggestions are welcome! My goal is to port Yesod over to > this as soon as the web-routes set of packages are released, so if you're > interested in Yesod, you should be interested in this too ;). > > Michael > > [1] http://github.com/snoyberg/web-routes-quasi > > > --===============3242333516161199687== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 Q29vbC4gSSBhZ3JlZSB0aGF0IG90aGVyIHR5cGVzIH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pdj48YnI+PC9kaXY+PGRp dj5BbnkgY29tbWVudHMgYW5kIHN1Z2dlc3Rpb25zIGFyZSB3ZWxjb21lISBNeSBnb2FsIGlzIHRv IHBvcnQgWWVzb2Qgb3ZlciB0byB0aGlzIGFzIHNvb24gYXMgdGhlIHdlYi1yb3V0ZXMgc2V0IG9m IHBhY2thZ2VzIGFyZSByZWxlYXNlZCwgc28gaWYgeW91JiMzOTtyZSBpbnRlcmVzdGVkIGluIFll c29kLCB5b3Ugc2hvdWxkIGJlIGludGVyZXN0ZWQgaW4gdGhpcyB0b28gOykuPC9kaXY+CiA8ZGl2 Pjxicj48L2Rpdj48ZGl2Pk1pY2hhZWw8L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PlsxXcKgPGEg aHJlZj0iaHR0cDovL2dpdGh1Yi5jb20vc25veWJlcmcvd2ViLXJvdXRlcy1xdWFzaSIgdGFyZ2V0 PSJfYmxhbmsiPmh0dHA6Ly9naXRodWIuY29tL3Nub3liZXJnL3dlYi1yb3V0ZXMtcXVhc2k8L2E+ PC9kaXY+PC9ibG9ja3F1b3RlPjwvZGl2Pjxicj48L2Rpdj48L2Rpdj48L2Rpdj4KPC9kaXY+PC9i bG9ja3F1b3RlPjwvZGl2Pjxicj48L2Rpdj4K --===============3242333516161199687==-- From james@neurogami.com Sat Apr 17 01:44:51 2010 From: James Britt To: web-devel@haskell.org Subject: Re: [web-devel] Re: Hamlet & Haml Date: Fri, 16 Apr 2010 23:17:03 -0700 Message-ID: <4BC9525F.6020100@neurogami.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7243822595807609338==" --===============7243822595807609338== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Michael Snoyman wrote: > Out of curiosity, why? I've never really used it large-scale before, but > it seems to work rather nicely. Mostly because of its absolutist use of whitespace, and it insists I treat HTML as a set of DOM nodes instead of as a document. Plus, it's ugly. You can read my willfully rant-y explanation here: http://www.jamesbritt.com/2009/4/29/thoughts-on-haml James -- Neurogami - Smart application development http://www.neurogami.com james@neurogami.com --===============7243822595807609338==-- From john.m.bender@gmail.com Sat Apr 17 02:44:28 2010 From: John Bender To: web-devel@haskell.org Subject: Re: [web-devel] Re: Hamlet & Haml Date: Sat, 17 Apr 2010 00:16:41 -0700 Message-ID: In-Reply-To: <4BC9525F.6020100@neurogami.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4252345787464392886==" --===============4252345787464392886== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Notably in your rant you site static indentation and "most forms" of static typing as "solving problems that don't come up in real life code". Haskell would seem to be an interesting choice for your development efforts in both cases then no? ;) I think you make a fine point about xhtml being a great tool, but if you plan to embed some form of syntax into your templates and avoid data binding Haml is one of the better solutions out there. Best John PS I assume the forms of static typing you were referring too look a bit more like Java/C#/C++ and less like Haskell. On Fri, Apr 16, 2010 at 11:17 PM, James Britt wrote: > Michael Snoyman wrote: > > Out of curiosity, why? I've never really used it large-scale before, but >> it seems to work rather nicely. >> > > > Mostly because of its absolutist use of whitespace, and it insists I treat > HTML as a set of DOM nodes instead of as a document. > > Plus, it's ugly. > > > > You can read my willfully rant-y explanation here: > > http://www.jamesbritt.com/2009/4/29/thoughts-on-haml > > > James > > -- > > Neurogami - Smart application development > > http://www.neurogami.com > > james@neurogami.com > > > > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > --===============4252345787464392886== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PG1ldGEgaHR0cC1lcXVpdj0iY29udGVudC10eXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7IGNoYXJz ZXQ9dXRmLTgiPjxmb250IGNsYXNzPSJBcHBsZS1zdHlsZS1zcGFuIiBjb2xvcj0iIzU0NTQ1NCIg ZmFjZT0iVmVyZGFuYSwgQXJpYWwsIEhlbHZldGljYSwgc2Fucy1zZXJpZiI+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 13:20:20 2010 From: James Britt To: web-devel@haskell.org Subject: Re: [web-devel] Re: Hamlet & Haml Date: Sat, 17 Apr 2010 10:52:32 -0700 Message-ID: <4BC9F560.6060903@neurogami.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2130618666533246072==" --===============2130618666533246072== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit John Bender wrote: > Notably in your rant you site static indentation and "most forms" of > static typing as "solving problems that don't come up in real life > code". Haskell would seem to be an interesting choice for your > development efforts in both cases then no? ;) Oh, yes. :) I think if Haml, Yaml, and other hard-line indentation formats used Haskell's off-side rule I'd find them easier to work with. Haml, for example, demands a very specific indentation; off by one extra space and you get slapped, even if visually it is quite clear what is going on. It makes for extra work for me. The offside rule for Haskell also seems to make more sense in the context of function equations (e.g. this-side = that-side). Having Haskell tell me "Think of this code as a set of equations" makes sense. Haml's "Think of your essay document with embedded metadata as a rigid hierarchy of nodes" feels forced. > > I think you make a fine point about xhtml being a great tool, but if you > plan to embed some form of syntax into your templates and avoid data > binding Haml is one of the better solutions out there. Almost all of the Haml I've had to deal with is used in Rails projects, and data binding and embedded code is all over the place. Sort of the worst of both worlds. :) (And I find it harder to fix other people's code when it's in Haml. Haml seems to favor writing over re-writing. But I'm ranting again.) I don't mind mixing code in with templates, I'd much prefer I be given the choice as to when that is appropriate. I just try to avoid it since it makes things harder in the long run. But for knocking something out just to explore an idea it's great. For example, I used to do JSP and ASP development, and I could write large chunks of code inline the page markup to see if something was a useful path. If so, I would then refactor the code out of the markup up and bundle it up in something faster/cleaner/easier to test. But with everything in the page I could refresh the browser and see my results and avoid having to run the compiler, etc. The risk, though, is that being undisciplined can lead to the stereotypical worst-case PHP kind of code. James --===============2130618666533246072==-- From michael@snoyman.com Sun Apr 18 00:32:35 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Re: Hamlet & Haml Date: Sat, 17 Apr 2010 22:04:49 -0700 Message-ID: In-Reply-To: <4BC9F560.6060903@neurogami.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7415669208589538779==" --===============7415669208589538779== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Sat, Apr 17, 2010 at 10:52 AM, James Britt wrote: > John Bender wrote: > >> Notably in your rant you site static indentation and "most forms" of >> static typing as "solving problems that don't come up in real life code". >> Haskell would seem to be an interesting choice for your development efforts >> in both cases then no? ;) >> > > Oh, yes. :) > > I think if Haml, Yaml, and other hard-line indentation formats used > Haskell's off-side rule I'd find them easier to work with. > > Haml, for example, demands a very specific indentation; off by one extra > space and you get slapped, even if visually it is quite clear what is going > on. It makes for extra work for me. > > The offside rule for Haskell also seems to make more sense in the context > of function equations (e.g. this-side =3D that-side). > > Having Haskell tell me "Think of this code as a set of equations" makes > sense. Haml's "Think of your essay document with embedded metadata as a > rigid hierarchy of nodes" feels forced. > > > I'm sorry, I'm not familiar enough with the indentation rules you're referring to; could you explain it more throughly? This might be a case where I accidentally solved a problem ;). > >> I think you make a fine point about xhtml being a great tool, but if you >> plan to embed some form of syntax into your templates and avoid data bindi= ng >> Haml is one of the better solutions out there. >> > > Almost all of the Haml I've had to deal with is used in Rails projects, and > data binding and embedded code is all over the place. Sort of the worst of > both worlds. :) (And I find it harder to fix other people's code when it's > in Haml. Haml seems to favor writing over re-writing. But I'm ranting > again.) > > I don't mind mixing code in with templates, I'd much prefer I be given the > choice as to when that is appropriate. I just try to avoid it since it > makes things harder in the long run. But for knocking something out just to > explore an idea it's great. > > For example, I used to do JSP and ASP development, and I could write large > chunks of code inline the page markup to see if something was a useful > path. If so, I would then refactor the code out of the markup up and bundle > it up in something faster/cleaner/easier to test. But with everything in > the page I could refresh the browser and see my results and avoid having to > run the compiler, etc. > > The risk, though, is that being undisciplined can lead to the stereotypical > worst-case PHP kind of code. > > > James > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > --===============7415669208589538779== Content-Type: text/html Content-Transfer-Enc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CByZWZyZXNoIHRoZSBicm93c2VyIGFuZCBzZWUgbXkgcmVzdWx0cyBhbmQgYXZvaWQgaGF2 aW5nIHRvIHJ1biB0aGUgY29tcGlsZXIsIGV0Yy48YnI+Cgo8YnI+ClRoZSByaXNrLCB0aG91Z2gs IGlzIHRoYXQgYmVpbmcgdW5kaXNjaXBsaW5lZCBjYW4gbGVhZCB0byB0aGUgc3RlcmVvdHlwaWNh bCB3b3JzdC1jYXNlIFBIUCBraW5kIG9mIGNvZGUuPGJyPjxmb250IGNvbG9yPSIjODg4ODg4Ij4K PGJyPgo8YnI+CkphbWVzPC9mb250PjxkaXY+PGRpdj48L2Rpdj48ZGl2IGNsYXNzPSJoNSI+PGJy PgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXzxicj4Kd2Vi LWRldmVsIG1haWxpbmcgbGlzdDxicj4KPGEgaHJlZj0ibWFpbHRvOndlYi1kZXZlbEBoYXNrZWxs Lm9yZyIgdGFyZ2V0PSJfYmxhbmsiPndlYi1kZXZlbEBoYXNrZWxsLm9yZzwvYT48YnI+CjxhIGhy ZWY9Imh0dHA6Ly93d3cuaGFza2VsbC5vcmcvbWFpbG1hbi9saXN0aW5mby93ZWItZGV2ZWwiIHRh cmdldD0iX2JsYW5rIj5odHRwOi8vd3d3Lmhhc2tlbGwub3JnL21haWxtYW4vbGlzdGluZm8vd2Vi LWRldmVsPC9hPjxicj4KPC9kaXY+PC9kaXY+PC9ibG9ja3F1b3RlPjwvZGl2Pjxicj4K --===============7415669208589538779==-- From gour@gour-nitai.com Sun Apr 18 06:03:47 2010 From: Gour To: web-devel@haskell.org Subject: [web-devel] Re: Hamlet & Haml Date: Sun, 18 Apr 2010 12:35:52 +0200 Message-ID: <20100418123552.4053474d@gaura-nitai> In-Reply-To: <4BC9F560.6060903@neurogami.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8458492682321584457==" --===============8458492682321584457== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Sat, 17 Apr 2010 10:52:32 -0700 >>>>>> "James" == James Britt wrote: James> Almost all of the Haml I've had to deal with is used in Rails James> projects, and data binding and embedded code is all over the James> place. Sort of the worst of both worlds. :) Hamlet /= Haml ;) Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- --===============8458492682321584457== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuNC4xMCAoR05V L0xpbnV4KQoKaUVZRUFSRUNBQVlGQWt2SzRJZ0FDZ2tRVThlRThmbHY5ZllZYkFDZ3lBczlYRWdR WUZxZFExUzN0Vzg1YzFnMwpvQUFBbjJsVjRVT1FoUnFqN05IZWtDUFBGc3B5b2FvOQo9Y1l6UQot LS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============8458492682321584457==-- From orclev@gmail.com Tue Apr 20 09:30:25 2010 From: Kyle Murphy To: web-devel@haskell.org Subject: [web-devel] Question about happstack Date: Tue, 20 Apr 2010 10:02:49 -0400 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3064052871568719794==" --===============3064052871568719794== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit I had downloaded and was experimenting with a simple Happstack based pastebin a while ago, and was making reasonable progress in figuring out Happstack and how to go about handling various situations. I hadn't touched the code in a while and decided I wanted to eperiment with it last night, so I made a few tweaks and attempted to re-compile it. Now, I'm finding that neither my modified version, nor the original version I downloaded will compile, as they complain about not being able to find an instance of MonadIO for (ServerPartT IO). I also tried writing up a trivial server based on the documentation provided by Happstack itself, and that also fails to compile complaining about no instance found for MonadIO (ServerPartT IO). Specifically the error seems to be triggered by the use of liftIO anywhere inside a ServerPartT monad. Looking at the source code for happstack-server, I can see in Happstack.Server.SimpleHTTP that the GeneralizedNewtypeDeriving pragma is set, and that in the newtype for ServerPartT it has deriving MonadIO. Why can't ghc seem to find the MonadIO instance for ServerPartT, when ServerPartT is declared as deriving it? It also seems strange that this just started happening recently. I've upgraded a number of packages recently, but I can't say for sure what I changed since the last time I was able to compile something based on happstack successfully. Is it possible that some change with mtl or some other package is causing this error? Near as I can tell, this is occurring in happstack-server-0.4.1, although since I'm away from my personal computer right now I can't provide the versions for any of the other packages. If anyone would like further details I can provide them late tonight when I get home, but till then the best I can do is provide the source of one of the programs I attempted to compile (hosted interestingly enough by a later build of the same code): http://tenletters.org/1 -R. Kyle Murphy -- Curiosity was framed, Ignorance killed the cat. --===============3064052871568719794== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SSBoYWQgZG93bmxvYWRlZCBhbmQgd2FzIGV4cGVyaW1lbnRpbmcgd2l0aCBhIHNpbXBsZSBIYXBw c3RhY2sgYmFzZWQgcGFzdGViaW4gYSB3aGlsZSBhZ28sIGFuZCB3YXMgbWFraW5nIHJlYXNvbmFi bGUgcHJvZ3Jlc3MgaW4gZmlndXJpbmcgb3V0IEhhcHBzdGFjayBhbmQgaG93IHRvIGdvIGFib3V0 IGhhbmRsaW5nIHZhcmlvdXMgc2l0dWF0aW9ucy4gSSBoYWRuJiMzOTt0IHRvdWNoZWQgdGhlIGNv ZGUgaW4gYSB3aGlsZSBhbmQgZGVjaWRlZCBJIHdhbnRlZCB0byBlcGVyaW1lbnQgd2l0aCBpdCBs YXN0IG5pZ2h0LCBzbyBJIG1hZGUgYSBmZXcgdHdlYWtzIGFuZCBhdHRlbXB0ZWQgdG8gcmUtY29t cGlsZSBpdC4gTm93LCBJJiMzOTttIGZpbmRpbmcgdGhhdCBuZWl0aGVyIG15IG1vZGlmaWVkIHZl cnNpb24sIG5vciB0aGUgb3JpZ2luYWwgdmVyc2lvbiBJIGRvd25sb2FkZWQgd2lsbCBjb21waWxl LCBhcyB0aGV5IGNvbXBsYWluIGFib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GwiPi1SLiBL eWxlIE11cnBoeTxicj4tLTxicj5DdXJpb3NpdHkgd2FzIGZyYW1lZCwgSWdub3JhbmNlIGtpbGxl ZCB0aGUgY2F0Ljxicj4K --===============3064052871568719794==-- From orclev@gmail.com Tue Apr 20 12:57:37 2010 From: Kyle Murphy To: web-devel@haskell.org Subject: Re: [web-devel] Question about happstack Date: Tue, 20 Apr 2010 13:30:00 -0400 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6043992397086565375==" --===============6043992397086565375== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable I'm not sure I understand your question. I've got the happstack-server package installed, as well as various other happstack packages. In fact I used cabal to download the source for happstack-server which contains the newtype declaration for ServerPartT in order to verify that it does in fact declare a MonadIO instance for ServerPartT (which it does by deriving it as opposed to explicitly declaring it). It rather thoroughly puzzles me that GHC seems to think there's no MonadIO instance for ServerPartT, but I can go take a look at the source code and see it declared. I can really only think of two possible explanations aside from a defect in GHC itself, which is that either there's something wrong with the way ServerPartT is being exported/imported, or there's some kind of mismatch between the MonadIO declaration in the version of mtl I'm using, and whatever is being used to build happstack-server. Of course by the same token I'm a pretty big newbie with Haskell, so there's probably quite a few other possible explanations that I can't even begin to think of. -R. Kyle Murphy -- Curiosity was framed, Ignorance killed the cat. On Tue, Apr 20, 2010 at 13:07, davean wrote: > I'm away from my computer right now also, but I seem to recall having this > issue myself at one point; do you also have happstack? > > On Tue, Apr 20, 2010 at 10:02 AM, Kyle Murphy wrote: > >> I had downloaded and was experimenting with a simple Happstack based >> pastebin a while ago, and was making reasonable progress in figuring out >> Happstack and how to go about handling various situations. I hadn't touched >> the code in a while and decided I wanted to eperiment with it last night, = so >> I made a few tweaks and attempted to re-compile it. Now, I'm finding that >> neither my modified version, nor the original version I downloaded will >> compile, as they complain about not being able to find an instance of >> MonadIO for (ServerPartT IO). I also tried writing up a trivial server bas= ed >> on the documentation provided by Happstack itself, and that also fails to >> compile complaining about no instance found for MonadIO (ServerPartT IO). >> Specifically the error seems to be triggered by the use of liftIO anywhere >> inside a ServerPartT monad. >> >> Looking at the source code for happstack-server, I can see in >> Happstack.Server.SimpleHTTP that the GeneralizedNewtypeDeriving pragma is >> set, and that in the newtype for ServerPartT it has deriving MonadIO. Why >> can't ghc seem to find the MonadIO instance for ServerPartT, when >> ServerPartT is declared as deriving it? >> >> It also seems strange that this just started happening recently. I've >> upgraded a number of packages recently, but I can't say for sure what I >> changed since the last time I was able to compile something based on >> happstack successfully. Is it possible that some change with mtl or some >> other package is causing this error? >> >> Near as I can tell, this is occurring in happstack-server-0.4.1, although >> since I'm away from my personal computer right now I can't provide the >> versions for any of the other packages. If anyone would like further detai= ls >> I can provide them late tonight when I get home, but till then the best I >> can do is provide the source of one of the programs I attempted to compile >> (hosted interestingly enough by a later build of the same code): >> http://tenletters.org/1 >> >> -R. Kyle Murphy >> -- >> Curiosity was framed, Ignorance killed the cat. >> >> _______________________________________________ >> web-devel mailing list >> web-devel@haskell.org >> http://www.haskell.org/mailman/listinfo/web-devel >> >> > --===============6043992397086565375== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SSYjMzk7bSBub3Qgc3VyZSBJIHVuZGVyc3RhbmQgeW91ciBxdWVzdGlvbi4gSSYjMzk7dmUgZ290 IHRoZSBoYXBwc3RhY2stc2VydmVyIHBhY2thZ2UgaW5zdGFsbGVkLCBhcyB3ZWxsIGFzIHZhcmlv dXMgb3RoZXIgaGFwcHN0YWNrIHBhY2thZ2VzLiBJbiBmYWN0IEkgdXNlZCBjYWJhbCB0byBkb3du bG9hZCB0aGUgc291cmNlIGZvciBoYXBwc3RhY2stc2VydmVyIHdoaWNoIGNvbnRhaW5zIHRoZSBu ZXd0eXBlIGRlY2xhcmF0aW9uIGZvciBTZXJ2ZXJQYXJ0VCBpbiBvcmRlciB0byB2ZXJpZnkgdGhh dCBpdCBkb2VzIGluIGZhY3QgZGVjbGFyZSBhIE1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fX19fX19fX19fX19fX19fX19fX19fX188 YnI+CndlYi1kZXZlbCBtYWlsaW5nIGxpc3Q8YnI+CjxhIGhyZWY9Im1haWx0bzp3ZWItZGV2ZWxA aGFza2VsbC5vcmciIHRhcmdldD0iX2JsYW5rIj53ZWItZGV2ZWxAaGFza2VsbC5vcmc8L2E+PGJy Pgo8YSBocmVmPSJodHRwOi8vd3d3Lmhhc2tlbGwub3JnL21haWxtYW4vbGlzdGluZm8vd2ViLWRl dmVsIiB0YXJnZXQ9Il9ibGFuayI+aHR0cDovL3d3dy5oYXNrZWxsLm9yZy9tYWlsbWFuL2xpc3Rp bmZvL3dlYi1kZXZlbDwvYT48YnI+Cjxicj48L2Jsb2NrcXVvdGU+PC9kaXY+PGJyPgo8L2Jsb2Nr cXVvdGU+PC9kaXY+PGJyPgo= --===============6043992397086565375==-- From jeremy@n-heptane.com Tue Apr 20 14:51:56 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Question about happstack Date: Tue, 20 Apr 2010 14:24:19 -0500 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0819078075496198700==" --===============0819078075496198700== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Apr 20, 2010, at 9:02 AM, Kyle Murphy wrote: > > It also seems strange that this just started happening recently. > I've upgraded a number of packages recently, but I can't say for > sure what I changed since the last time I was able to compile > something based on happstack successfully. Is it possible that some > change with mtl or some other package is causing this error? I am guessing that some of the libraries you depend on are compiled against one version of mtl, and some are compiled against another version. This is not an error in itself. However, you will run into issues similar to what you have described when GHC tries to use version of MonadIO from different versions of the mtl library. Does "ghc-pkg describe mtl" show more than one version of mtl installed? What happens if you try to unregister the older version? This seems like an issues with the state of your installed system, and not something happstack specific.. - jeremy --===============0819078075496198700== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGh0bWw+PGJvZHkgc3R5bGU9IndvcmQtd3Jhc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aW1pbGFyIHRvIHdoYXQgeW91IGhhdmUgZGVzY3JpYmVkIHdoZW4g R0hDIHRyaWVzIHRvIHVzZSB2ZXJzaW9uIG9mIE1vbmFkSU8gZnJvbSBkaWZmZXJlbnQgdmVyc2lv bnMgb2YgdGhlIG10bCBsaWJyYXJ5LjwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+RG9lcyAiZ2hj LXBrZyBkZXNjcmliZSBtdGwiIHNob3cgbW9yZSB0aGFuIG9uZSB2ZXJzaW9uIG9mIG10bCBpbnN0 YWxsZWQ/IFdoYXQgaGFwcGVucyBpZiB5b3UgdHJ5IHRvIHVucmVnaXN0ZXIgdGhlIG9sZGVyIHZl cnNpb24/Jm5ic3A7PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5UaGlzIHNlZW1zIGxpa2UgYW4g aXNzdWVzIHdpdGggdGhlIHN0YXRlIG9mIHlvdXIgaW5zdGFsbGVkIHN5c3RlbSwgYW5kIG5vdCBz b21ldGhpbmcgaGFwcHN0YWNrIHNwZWNpZmljLi48L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2Pi0g amVyZW15PC9kaXY+PC9ib2R5PjwvaHRtbD4= --===============0819078075496198700==-- From jeremy@n-heptane.com Tue Apr 20 16:32:14 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: [web-devel] ANN: web-routes now on hackage Date: Tue, 20 Apr 2010 16:04:38 -0500 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2392455105509625162==" --===============2392455105509625162== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hello, I have uploaded web-routes to hackage. Now we can work on writing some tutorials/documentation so other people know what it is and why it is awesome :) I'll make a more formal announcement on haskell / haskell-cafe when I have something informative to say about it to strangers. - jeremy --===============2392455105509625162==-- From jeremy@n-heptane.com Tue Apr 20 18:33:34 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: [web-devel] happstack + hamlet Date: Tue, 20 Apr 2010 18:05:38 -0500 Message-ID: <441041EC-1F4B-42CE-BCE0-D07115262B8C@n-heptane.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5759868611496786592==" --===============5759868611496786592== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hello, As an experiment I modified the hamlet demo to use happstack. Was pretty trivial. I just added, -- happstack changes main :: IO () main = simpleHTTP nullConf $ liftIO $ hamletToResponse renderUrls $ template person hamletToResponse :: (Monad m) => (url -> String) -> Hamlet url m () -> m Response hamletToResponse showFn hamlet = do msg <- hamletToText showFn hamlet return $ toResponse_ (B.pack "text/html; charset=UTF-8") (T.encodeUtf8 msg) toResponse_ :: B.ByteString -> L.ByteString -> Response toResponse_ contentType message = let res = Response 200 M.empty nullRsFlags message Nothing in setHeaderBS (B.pack "Content-Type") contentType res The toResponse_ function really belongs in happstack anyway. I am going to add that right now. Normally we would add a ToMessage instance, so you could do: simpleHTTP nullConf $ template person But that won't work for two reasons: 1. we would need a way to pass in the (url -> String) function 2. the toResponse type signature does not allow for the monadic requirements of hamletToText But that is really just an issue with ToMessage class (and why I don't really like that type class much). I would like to make hamletToResponse (or something similar) available to happstack users. I think I probably need to make a new package, happstack-hamlet, to stick it in. I wonder if there is anything else useful that could go in there. I could add some additional instances, such as: mapHamlet :: forall a b url m n. (Monad m) => (m a -> m b) -> Hamlet url m a -> Hamlet url m b mapHamlet f m = Hamlet $ \showFn seed iteratee -> f' (runHamlet m showFn seed iteratee) where f' :: m (Either seed (a, seed)) -> m (Either seed (b, seed)) f' m = do e <- m case e of (Left s) -> return (Left s) (Right (a, seed)) -> do b <- f (return a) return (Right (b, seed)) instance (ServerMonad m) => ServerMonad (Hamlet url m) where askRq = liftHamlet askRq localRq f = mapHamlet (localRq f) instance (FilterMonad r m) => FilterMonad r (Hamlet url m) where setFilter = liftHamlet . setFilter composeFilter = liftHamlet . composeFilter getFilter = mapHamlet getFilter instance (WebMonad a m) => WebMonad a (Hamlet url m) where finishWith = liftHamlet . finishWith So that you could use some of the functionality of the ServerMonad, etc, in your Hamlet templates. But I am not clear how that would be useful yet. - jeremy Anyway, the full code is attached. --===============5759868611496786592== Content-Type: application/octet-stream Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="hamlet-happs.hs" MIME-Version: 1.0 ey0jIExBTkdVQUdFIFF1YXNpUXVvdGVzICMtfQptb2R1bGUgTWFpbiB3aGVyZQoKaW1wb3J0IENv bnRyb2wuTW9uYWQuVHJhbnMoTW9uYWRJTyhsaWZ0SU8pKQppbXBvcnQgcXVhbGlmaWVkIERhdGEu Qnl0ZVN0cmluZy5DaGFyOCAgICAgIGFzIEIKaW1wb3J0IHF1YWxpZmllZCBEYXRhLkJ5dGVTdHJp bmcuTGF6eS5DaGFyOCBhcyBMCmltcG9ydCBxdWFsaWZpZWQgRGF0YS5NYXAgICAgICAgICAgICAg ICAgICAgYXMgTQppbXBvcnQgcXVhbGlmaWVkIERhdGEuVGV4dC5MYXp5LkVuY29kaW5nICAgIGFz IFQgICAgCgppbXBvcnQgVGV4dC5IYW1sZXQKaW1wb3J0IFRleHQuSGFtbGV0Lk1vbmFkIChoYW1s ZXRUb1RleHQpCmltcG9ydCBEYXRhLlRleHQgKHBhY2spCmltcG9ydCBIYXBwc3RhY2suU2VydmVy CgpkYXRhIFBlcnNvbiA9IFBlcnNvbgogICAgeyBuYW1lIDo6IElPIEh0bWxDb250ZW50IC0tIG1h eWJlIGl0IHJlcXVpcmVzIGEgZGF0YWJhc2UgbG9va3VwCiAgICAsIGFnZSA6OiBIdG1sQ29udGVu dAogICAgLCBwYWdlIDo6IFBlcnNvblVybHMKICAgICwgaXNNYXJyaWVkIDo6IEJvb2wKICAgICwg Y2hpbGRyZW4gOjogW0h0bWxDb250ZW50XQogICAgfQpkYXRhIFBlcnNvblVybHMgPSBIb21lcGFn ZSB8IFBlcnNvblBhZ2UgU3RyaW5nCgpyZW5kZXJVcmxzIDo6IFBlcnNvblVybHMgLT4gU3RyaW5n CnJlbmRlclVybHMgSG9tZXBhZ2UgPSAiLyIKcmVuZGVyVXJscyAoUGVyc29uUGFnZSBuYW1lKSA9 ICcvJyA6IG5hbWUKCmZvb3RlciA6OiBNb25hZCBtID0+IGEgLT4gSGFtbGV0IHVybCBtICgpCmZv b3RlciA9IFskaGFtbGV0fAojZm9vdGVyIFRoYW5rIHlvdSwgY29tZSBhZ2Fpbgp8XQoKdGVtcGxh dGUgOjogUGVyc29uIC0+IEhhbWxldCBQZXJzb25VcmxzIElPICgpCnRlbXBsYXRlID0gWyRoYW1s ZXR8CiEhIQolaHRtbAogICAgJWhlYWQKICAgICAgICAldGl0bGUgSGFtbGV0IERlbW8KICAgICVi b2R5CiAgICAgICAgJWgxIEluZm9ybWF0aW9uIG9uICQqbmFtZSQKICAgICAgICAlcCAkKm5hbWUk IGlzICRhZ2UkIHllYXJzIG9sZC4KICAgICAgICAlaDIKICAgICAgICAgICAgJGlmIGlzTWFycmll ZAogICAgICAgICAgICAgICAgPGI+TWFycmllZDwvYj4KICAgICAgICAgICAgJGVsc2UKICAgICAg ICAgICAgICAgIE5vdCA8Yj5tYXJyaWVkPC9iPgogICAgICAgICV1bAogICAgICAgICAgICAkZm9y YWxsIGNoaWxkcmVuIGNoaWxkCiAgICAgICAgICAgICAgICAlbGkgJGNoaWxkJAogICAgICAgICVw CiAgICAgICAgICAgICVhIWhyZWY9QHBhZ2VAIFNlZSB0aGUgcGFnZS4KICAgICAgICBeZm9vdGVy Xgp8XQoKcGVyc29uIDo6IFBlcnNvbgpwZXJzb24gPSBQZXJzb24KICAgICAgICAgICAgeyBuYW1l ID0gcmV0dXJuICQgVW5lbmNvZGVkICQgcGFjayAiTWljaGFlbCIKICAgICAgICAgICAgLCBhZ2Ug PSBVbmVuY29kZWQgJCBwYWNrICJ0d2VudHkgZml2ZSAmIGEgaGFsZiIKICAgICAgICAgICAgLCBw YWdlID0gUGVyc29uUGFnZSAibWljaGFlbCIKICAgICAgICAgICAgLCBpc01hcnJpZWQgPSBUcnVl CiAgICAgICAgICAgICwgY2hpbGRyZW4gPSBbIFVuZW5jb2RlZCAkIHBhY2sgIkFkYW0iCiAgICAg ICAgICAgICAgICAgICAgICAgICAsIFVuZW5jb2RlZCAkIHBhY2sgIkJlbiIKICAgICAgICAgICAg ICAgICAgICAgICAgICwgVW5lbmNvZGVkICQgcGFjayAiQ2hyaXMiCiAgICAgICAgICAgICAgICAg ICAgICAgICBdCiAgICAgICAgICAgIH0KCi0tIGhhcHBzdGFjayBjaGFuZ2VzCgptYWluIDo6IElP ICgpCm1haW4gPSBzaW1wbGVIVFRQIG51bGxDb25mICQgbGlmdElPICQgaGFtbGV0VG9SZXNwb25z ZSByZW5kZXJVcmxzICQgdGVtcGxhdGUgcGVyc29uCgpoYW1sZXRUb1Jlc3BvbnNlIDo6IChNb25h ZCBtKSA9PiAodXJsIC0+IFN0cmluZykgLT4gSGFtbGV0IHVybCBtICgpIC0+IG0gUmVzcG9uc2UK aGFtbGV0VG9SZXNwb25zZSBzaG93Rm4gaGFtbGV0ID0gCiAgICBkbyBtc2cgPC0gaGFtbGV0VG9U ZXh0IHNob3dGbiBoYW1sZXQKICAgICAgIHJldHVybiAkIHRvUmVzcG9uc2VfIChCLnBhY2sgInRl eHQvaHRtbDsgY2hhcnNldD1VVEYtOCIpIChULmVuY29kZVV0ZjggbXNnKQoKdG9SZXNwb25zZV8g OjogQi5CeXRlU3RyaW5nIC0+IEwuQnl0ZVN0cmluZyAtPiBSZXNwb25zZQp0b1Jlc3BvbnNlXyBj b250ZW50VHlwZSBtZXNzYWdlID0KICAgIGxldCByZXMgPSBSZXNwb25zZSAyMDAgTS5lbXB0eSBu dWxsUnNGbGFncyBtZXNzYWdlIE5vdGhpbmcKICAgIGluIHNldEhlYWRlckJTIChCLnBhY2sgIkNv bnRlbnQtVHlwZSIpIGNvbnRlbnRUeXBlIHJlcwo= --===============5759868611496786592==-- From chris@eidhof.nl Wed Apr 21 04:34:26 2010 From: Chris Eidhof To: web-devel@haskell.org Subject: Re: [web-devel] ANN: web-routes now on hackage Date: Wed, 21 Apr 2010 11:06:56 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0963926080398196944==" --===============0963926080398196944== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hey Jeremy, Excellent work, looking great. Thanks for packaging and writing it. I'm not s= ure whether the RouteT should be there (I'm not planning to use a Monad with = the package), but on the other hand: it doesn't add any dependencies. -chris On 20 apr 2010, at 23:04, Jeremy Shaw wrote: > Hello, >=20 > I have uploaded web-routes to hackage. Now we can work on writing some tuto= rials/documentation so other people know what it is and why it is awesome :) >=20 > I'll make a more formal announcement on haskell / haskell-cafe when I have = something informative to say about it to strangers. >=20 > - jeremy > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel --===============0963926080398196944==-- From orclev@gmail.com Wed Apr 21 09:30:53 2010 From: Kyle Murphy To: web-devel@haskell.org Subject: Re: [web-devel] Question about happstack Date: Wed, 21 Apr 2010 10:03:20 -0400 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5315779894682721972==" --===============5315779894682721972== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit I fixed the issue by installing GHC 6.12, and the latest version of haskell-platform. It worries me that when building against two different versions of the same library ghc more or less fails silently. Near as I can tell, it attempts to link against a new version of mtl, records the symbol for MonadIO, then links in happstack, notices that there's no definition for the MonadIO symbol referenced in happstack, and silently ignore the class instance defined in happstack. This seems depressingly non-deterministic, and makes me wonder how hard it would be to create some sort of check when linking to see if two libraries define/reference different classes that have the same name and at least print some sort of warning about it. The fact that mtl defines MonadIO, but a different version than is referenced in happstack should have been enough to at least generate a warning. Of course, for all I know there is an option for GHC that provides such a warning, but I've no idea what it is and it probably should be enabled by default anyway. At this point I think anything remotely web-devel related has been covered, so I think I'll take further discussion of this apparent disconnect between class versions to either the #haskell channel, or maybe the haskell-cafe mailing list. -R. Kyle Murphy -- Curiosity was framed, Ignorance killed the cat. On Tue, Apr 20, 2010 at 15:24, Jeremy Shaw wrote: > On Apr 20, 2010, at 9:02 AM, Kyle Murphy wrote: > > > It also seems strange that this just started happening recently. I've > upgraded a number of packages recently, but I can't say for sure what I > changed since the last time I was able to compile something based on > happstack successfully. Is it possible that some change with mtl or some > other package is causing this error? > > > I am guessing that some of the libraries you depend on are compiled against > one version of mtl, and some are compiled against another version. This is > not an error in itself. However, you will run into issues similar to what > you have described when GHC tries to use version of MonadIO from different > versions of the mtl library. > > Does "ghc-pkg describe mtl" show more than one version of mtl installed? > What happens if you try to unregister the older version? > > This seems like an issues with the state of your installed system, and not > something happstack specific.. > > - jeremy > --===============5315779894682721972== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 wqBJIGZpeGVkIHRoZSBpc3N1ZSBieSBpbnN0YWxsaW5nIEdIQyA2LjEyLCBhbmQgdGhlIGxhdGVz dCB2ZXJzaW9uIG9mIGhhc2tlbGwtcGxhdGZvcm0uIEl0IHdvcnJpZXMgbWUgdGhhdCB3aGVuIGJ1 aWxkaW5nIGFnYWluc3QgdHdvIGRpZmZlcmVudCB2ZXJzaW9ucyBvZiB0aGUgc2FtZSBsaWJyYXJ5 IGdoYyBtb3JlIG9yIGxlc3MgZmFpbHMgc2lsZW50bHkuIE5lYXIgYXMgSSBjYW4gdGVsbCwgaXQg YXR0ZW1wdHMgdG8gbGluayBhZ2FpbnN0IGEgbmV3IHZlcnNpb24gb2YgbXRsLCByZWNvcmRzIHRo ZSBzeW1ib2wgZm9yIE1vbmFkSU8sIHRoZW4gbGlua3MgaW4gaGFwcHN0YWNrLCBub3RpY2VzIHRo YXQgdGhlcmUmIzM5O3Mgbm8gZGVmaW5pdGlvbiBmb3IgdGhlIE1vbmFkSU8gc3ltYm9sIHJlZmVy ZW5jZWQgaW4gaGFwcHN0YWNrLCBhbmQgc2lsZW50bHkgaWdub3JlIHRoZSBjbGFz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zdGF0ZSBv ZiB5b3VyIGluc3RhbGxlZCBzeXN0ZW0sIGFuZCBub3Qgc29tZXRoaW5nIGhhcHBzdGFjayBzcGVj aWZpYy4uPC9kaXY+CjxkaXY+PGJyPjwvZGl2Pjxmb250IGNvbG9yPSIjODg4ODg4Ij48ZGl2Pi0g amVyZW15PC9kaXY+PC9mb250PjwvZGl2PjwvYmxvY2txdW90ZT48L2Rpdj48YnI+Cg== --===============5315779894682721972==-- From michael@snoyman.com Wed Apr 21 12:23:44 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: [web-devel] Simple mime-type package Date: Wed, 21 Apr 2010 09:56:11 -0700 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2111268543011145184==" --===============2111268543011145184== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi all, In Yesod, I have very modest needs when it comes to mime-types. Basically, I want: * a data type to represent mime-types * convert a string to a mime-type * convert a mime-type to a string * determine mime-type of a file based on extension I've stuck all this in a simple module: Web.Mime[1]. However, it seems like this is a perfect candidate for a dedicated package. So I wanted to ask: 1) Is there a package out there- with minimal dependencies- that supplies this functionality? 2) If not, would anyone else find it useful if I split this off into its own package? Michael [1] http://github.com/snoyberg/yesod/blob/ver0.2/Web/Mime.hs --===============2111268543011145184== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SGkgYWxsLDxkaXY+PGJyPjwvZGl2PjxkaXY+SW4gWWVzb2QsIEkgaGF2ZSB2ZXJ5IG1vZGVzdCBu ZWVkcyB3aGVuIGl0IGNvbWVzIHRvIG1pbWUtdHlwZXMuIEJhc2ljYWxseSwgSSB3YW50OjwvZGl2 PjxkaXY+PGJyPjwvZGl2PjxkaXY+KiBhIGRhdGEgdHlwZSB0byByZXByZXNlbnQgbWltZS10eXBl czwvZGl2PjxkaXY+KiBjb252ZXJ0IGEgc3RyaW5nIHRvIGEgbWltZS10eXBlPC9kaXY+CjxkaXY+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010 From: James Britt To: web-devel@haskell.org Subject: Re: [web-devel] Re: Hamlet & Haml Date: Wed, 21 Apr 2010 16:01:59 -0700 Message-ID: <4BCF83E7.3020804@neurogami.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2291252482599294595==" --===============2291252482599294595== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Michael Snoyman wrote: > > > I'm sorry, I'm not familiar enough with the indentation rules you're > referring to; could you explain it more throughly? This might be a case > where I accidentally solved a problem ;). Haml expects that where there is to be indentation, that indentation is to be exactly 2 spaces. Not 1, not 3, or 4, but 2. It isn't enough that a line start in a new column further to the right, it has to start in a very specific column relative to its parent. However, there are cases where the content is such that I want to emphasize it or offset it in some way using whitespace. My experience has been that this isn't allowed. James --===============2291252482599294595==-- From michael@snoyman.com Thu Apr 22 11:23:22 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Re: Hamlet & Haml Date: Thu, 22 Apr 2010 08:55:50 -0700 Message-ID: In-Reply-To: <4BCF83E7.3020804@neurogami.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0216927362270100135==" --===============0216927362270100135== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Wed, Apr 21, 2010 at 4:01 PM, James Britt wrote: > Michael Snoyman wrote: > > >> >> I'm sorry, I'm not familiar enough with the indentation rules you're >> referring to; could you explain it more throughly? This might be a case >> where I accidentally solved a problem ;). >> > > Haml expects that where there is to be indentation, that indentation is to > be exactly 2 spaces. Not 1, not 3, or 4, but 2. It isn't enough that a > line start in a new column further to the right, it has to start in a very > specific column relative to its parent. > > However, there are cases where the content is such that I want to emphasize > it or offset it in some way using whitespace. > > My experience has been that this isn't allowed. > > > Oh, I'm certainly glad I strayed from the Haml specs then! Hamlet allows arbitrary indentation. In fact, some might argue that the indentation rules are *too* lax, but we'll let experience be the deciding factor on that. Basically, here's the rules: * a tab is 4 spaces. I considering not allowing tabs at all, but hopefully people know not to mix spaces and tabs already. * each line has its indentation level calculated * a line is nested within the first line above it with a lower indentation level I actually think that sums things up completely. I have just added a page[1] on the documentation site to explain these rules, thank you for pointing out that it was lacking. Michael [1] http://docs.yesodweb.com/hamlet/indentation.html --===============0216927362270100135== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gV2VkLCBBcHIgMjEsIDIwMTAgYXQg NDowMSBQTSwgSmFtZXMgQnJpdHQgPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWlsdG86 amFtZXNAbmV1cm9nYW1pLmNvbSI+amFtZXNAbmV1cm9nYW1pLmNvbTwvYT4mZ3Q7PC9zcGFuPiB3 cm90ZTo8YnI+PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0ibWFyZ2luOjAg MCAwIC44ZXg7Ym9yZGVyLWxlZnQ6MXB4ICNjY2Mgc29saWQ7cGFkZGluZy1sZWZ0OjFleDsiPgo8 ZGl2IGNsYXNzPSJpbSI+TWljaGFlbCBTbm95bWFuIHdyb3RlOjxicj4KPGJyPgo8YmxvY2txdW90 ZSBjbGFzcz0iZ21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46MCAwIDAgLjhleDtib3JkZXItbGVm dDoxcHggI2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4Ij4KPGJyPgo8YnI+CkkmIzM5O20gc29y cnksIEkmIzM5O20gbm90IGZhbWlsaWFyIGVub3VnaCB3aXRoIHRoZSBpbmRlbnRhdGlvbiBydWxl cyB5b3UmIzM5O3JlIHJlZmVycmluZyB0bzsgY291bGQgeW91IGV4cGxhaW4gaXQgbW9yZSB0aHJv dWdobHk/IFRoaXMgbWlnaHQgYmUgYSBjYXNlIHdoZXJlIEkgYWNjaWRlbnRhbGx5IHNvbHZlZCBh IHByb2JsZW0gOykuPGJyP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man To: web-devel@haskell.org Subject: Re: [web-devel] Simple mime-type package Date: Thu, 22 Apr 2010 08:59:30 -0700 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9034755418444297776==" --===============9034755418444297776== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit A quick look through the docs didn't find a similar module. Do you know where in particular it might be? I'm not familiar with the gitit codebase at all. Michael On Wed, Apr 21, 2010 at 1:24 PM, Thomas Hartman < thomashartman1@googlemail.com> wrote: > there's something like this in gitit I believe. > > On Wed, Apr 21, 2010 at 9:56 AM, Michael Snoyman > wrote: > > Hi all, > > In Yesod, I have very modest needs when it comes to mime-types. > Basically, I > > want: > > * a data type to represent mime-types > > * convert a string to a mime-type > > * convert a mime-type to a string > > * determine mime-type of a file based on extension > > I've stuck all this in a simple module: Web.Mime[1]. However, it seems > like > > this is a perfect candidate for a dedicated package. So I wanted to ask: > > 1) Is there a package out there- with minimal dependencies- that supplies > > this functionality? > > 2) If not, would anyone else find it useful if I split this off into its > own > > package? > > Michael > > [1] http://github.com/snoyberg/yesod/blob/ver0.2/Web/Mime.hs > > _______________________________________________ > > web-devel mailing list > > web-devel@haskell.org > > http://www.haskell.org/mailman/listinfo/web-devel > > > > > > > > -- > Need somewhere to put your code? http://patch-tag.com > Want to build a webapp? http://happstack.com > --===============9034755418444297776== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 QSBxdWljayBsb29rIHRocm91Z2ggdGhlIGRvY3MgZGlkbiYjMzk7dCBmaW5kIGEgc2ltaWxhciBt b2R1bGUuIERvIHlvdSBrbm93IHdoZXJlIGluIHBhcnRpY3VsYXIgaXQgbWlnaHQgYmU/IEkmIzM5 O20gbm90IGZhbWlsaWFyIHdpdGggdGhlIGdpdGl0IGNvZGViYXNlIGF0IGFsbC48ZGl2Pjxicj48 L2Rpdj48ZGl2Pk1pY2hhZWw8YnI+PGJyPjxkaXYgY2xhc3M9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3d3dy5oYXNrZWxsLm9yZy9tYWlsbWFuL2xpc3RpbmZvL3dlYi1k ZXZlbCIgdGFyZ2V0PSJfYmxhbmsiPmh0dHA6Ly93d3cuaGFza2VsbC5vcmcvbWFpbG1hbi9saXN0 aW5mby93ZWItZGV2ZWw8L2E+PGJyPgomZ3Q7PGJyPgomZ3Q7PGJyPgo8Zm9udCBjb2xvcj0iIzg4 ODg4OCI+PGJyPgo8YnI+Cjxicj4KLS08YnI+Ck5lZWQgc29tZXdoZXJlIHRvIHB1dCB5b3VyIGNv ZGU/IDxhIGhyZWY9Imh0dHA6Ly9wYXRjaC10YWcuY29tIiB0YXJnZXQ9Il9ibGFuayI+aHR0cDov L3BhdGNoLXRhZy5jb208L2E+PGJyPgpXYW50IHRvIGJ1aWxkIGEgd2ViYXBwPyA8YSBocmVmPSJo dHRwOi8vaGFwcHN0YWNrLmNvbSIgdGFyZ2V0PSJfYmxhbmsiPmh0dHA6Ly9oYXBwc3RhY2suY29t PC9hPjxicj4KPC9mb250PjwvYmxvY2txdW90ZT48L2Rpdj48YnI+PC9kaXY+Cg== --===============9034755418444297776==-- From jeremy@n-heptane.com Thu Apr 22 12:09:57 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Simple mime-type package Date: Thu, 22 Apr 2010 11:42:21 -0500 Message-ID: <8C58135B-10A1-452B-A0BD-74AF7D1EF405@n-heptane.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8562367390515299570==" --===============8562367390515299570== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hello, I am not especially excited about it. The fact that some mime-types are hard coded, and others are not is an annoying 'inconsistency'. There is no way to extend the list of supported types in user apps. And typeByExt has a rather limited set up extensions, declaring everything else to be application/octet-stream. The use of a type for the mime-types implies that you want to be pattern matching on the constructors in your code ? Can you give a use case for that ? - jeremy On Apr 21, 2010, at 11:56 AM, Michael Snoyman wrote: > Hi all, > > In Yesod, I have very modest needs when it comes to mime-types. > Basically, I want: > > * a data type to represent mime-types > * convert a string to a mime-type > * convert a mime-type to a string > * determine mime-type of a file based on extension > > I've stuck all this in a simple module: Web.Mime[1]. However, it > seems like this is a perfect candidate for a dedicated package. So I > wanted to ask: > > 1) Is there a package out there- with minimal dependencies- that > supplies this functionality? > 2) If not, would anyone else find it useful if I split this off into > its own package? > > Michael > > [1] http://github.com/snoyberg/yesod/blob/ver0.2/Web/Mime.hs > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel --===============8562367390515299570== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGh0bWw+PGJvZHkgc3R5bGU9IndvcmQtd3JhcDogYnJlYWstd29yZDsgLXdlYmtpdC1uYnNwLW1v ZGU6IHNwYWNlOyAtd2Via2l0LWxpbmUtYnJlYWs6IGFmdGVyLXdoaXRlLXNwYWNlOyAiPkhlbGxv LDxkaXY+PGJyPjwvZGl2PjxkaXY+SSBhbSBub3QgZXNwZWNpYWxseSBleGNpdGVkIGFib3V0IGl0 LiBUaGUgZmFjdCB0aGF0IHNvbWUgbWltZS10eXBlcyBhcmUgaGFyZCBjb2RlZCwgYW5kIG90aGVy cyBhcmUgbm90IGlzIGFuIGFubm95aW5nICdpbmNvbnNpc3RlbmN5Jy4mbmJzcDs8L2Rpdj48ZGl2 Pjxicj48L2Rpdj48ZGl2PlRoZXJlIGlzIG5vIHdheSB0byBleHRlbmQgdGhlIGxpc3Qgb2Ygc3Vw cG9ydGVkIHR5cGVzIGluIHVzZXIgYXBwcy4gQW5kIHR5cGVCeUV4dCBoYXMgYSByYXRoZXIgbGlt aXRlZCBzZXQgdXAgZXh0ZW5zaW9ucywgZGVjbGFyaW5nIGV2ZXJ5dGhpbmcgZWxzZSB0byBiZSBh cHBsaWNhdGlvbi9vY3RldC1zdHJlYW0uPC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5UaGUgdXNl IG9mI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GRlZGljYXRlZCBwYWNrYWdl LiBTbyBJIHdhbnRlZCB0byBhc2s6PC9kaXY+IDxkaXY+PGJyPjwvZGl2PjxkaXY+MSkgSXMgdGhl cmUgYSBwYWNrYWdlIG91dCB0aGVyZS0gd2l0aCBtaW5pbWFsIGRlcGVuZGVuY2llcy0gdGhhdCBz dXBwbGllcyB0aGlzIGZ1bmN0aW9uYWxpdHk/PC9kaXY+PGRpdj4yKSBJZiBub3QsIHdvdWxkIGFu eW9uZSBlbHNlIGZpbmQgaXQgdXNlZnVsIGlmIEkgc3BsaXQgdGhpcyBvZmYgaW50byBpdHMgb3du IHBhY2thZ2U/PC9kaXY+PGRpdj48YnI+IDwvZGl2PjxkaXY+TWljaGFlbDwvZGl2PjxkaXY+PGJy PjwvZGl2PjxkaXY+WzFdJm5ic3A7PGEgaHJlZj0iaHR0cDovL2dpdGh1Yi5jb20vc25veWJlcmcv eWVzb2QvYmxvYi92ZXIwLjIvV2ViL01pbWUuaHMiPmh0dHA6Ly9naXRodWIuY29tL3Nub3liZXJn L3llc29kL2Jsb2IvdmVyMC4yL1dlYi9NaW1lLmhzPC9hPjwvZGl2PjxtZXRhIGh0dHAtZXF1aXY9 ImNvbnRlbnQtdHlwZSIgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0PXV0Zi04Ij4gX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX188YnI+d2ViLWRldmVsIG1h aWxpbmcgbGlzdDxicj48YSBocmVmPSJtYWlsdG86d2ViLWRldmVsQGhhc2tlbGwub3JnIj53ZWIt ZGV2ZWxAaGFza2VsbC5vcmc8L2E+PGJyPmh0dHA6Ly93d3cuaGFza2VsbC5vcmcvbWFpbG1hbi9s aXN0aW5mby93ZWItZGV2ZWw8YnI+PC9ibG9ja3F1b3RlPjwvZGl2Pjxicj48L2Rpdj48L2JvZHk+ PC9odG1sPg== --===============8562367390515299570==-- From thaldyron@gmail.com Thu Apr 22 14:59:43 2010 From: Peter Robinson To: web-devel@haskell.org Subject: Re: [web-devel] Simple mime-type package Date: Thu, 22 Apr 2010 21:31:53 +0200 Message-ID: In-Reply-To: <8C58135B-10A1-452B-A0BD-74AF7D1EF405@n-heptane.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4211525706487613702==" --===============4211525706487613702== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable To avoid the hard coding issue, why not simply introduce a MimeType type clas= s? Peter On 22 April 2010 18:42, Jeremy Shaw wrote: > Hello, > I am not especially excited about it. The fact that some mime-types are hard > coded, and others are not is an annoying 'inconsistency'. > There is no way to extend the list of supported types in user apps. And > typeByExt has a rather limited set up extensions, declaring everything else > to be application/octet-stream. > The use of a type for the mime-types implies that you want to be pattern > matching on the constructors in your code ? Can you give a use case for that > ? > - jeremy > On Apr 21, 2010, at 11:56 AM, Michael Snoyman wrote: > > Hi all, > In Yesod, I have very modest needs when it comes to mime-types. Basically, I > want: > * a data type to represent mime-types > * convert a string to a mime-type > * convert a mime-type to a string > * determine mime-type of a file based on extension > I've stuck all this in a simple module: Web.Mime[1]. However, it seems like > this is a perfect candidate for a dedicated package. So I wanted to ask: > 1) Is there a package out there- with minimal dependencies- that supplies > this functionality? > 2) If not, would anyone else find it useful if I split this off into its own > package? > Michael > [1]=C2=A0http://github.com/snoyberg/yesod/blob/ver0.2/Web/Mime.hs > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > > --===============4211525706487613702==-- From jeremy@n-heptane.com Thu Apr 22 15:23:31 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Simple mime-type package Date: Thu, 22 Apr 2010 14:55:33 -0500 Message-ID: <9C78BEFD-6696-4CB7-9AC4-63F820379FF7@n-heptane.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5410379642526622953==" --===============5410379642526622953== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Apr 22, 2010, at 2:31 PM, Peter Robinson wrote: > To avoid the hard coding issue, why not simply introduce a MimeType > type class? What would this class do ? - jeremy --===============5410379642526622953==-- From thaldyron@gmail.com Fri Apr 23 03:54:00 2010 From: Peter Robinson To: web-devel@haskell.org Subject: Re: [web-devel] Simple mime-type package Date: Fri, 23 Apr 2010 10:26:11 +0200 Message-ID: In-Reply-To: <9C78BEFD-6696-4CB7-9AC4-63F820379FF7@n-heptane.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4479124401553368434==" --===============4479124401553368434== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 22 April 2010 21:55, Jeremy Shaw wrote: > On Apr 22, 2010, at 2:31 PM, Peter Robinson wrote: >> To avoid the hard coding issue, why not simply introduce a MimeType type >> class? > > What would this class do ? If extensibility is the main concern, then something like: {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE DeriveDataTypeable #-} module Mime where import Data.Typeable import Data.Convertible.Text class ContentType t where typeByExt :: String -> t toString :: t -> String instance ContentType t => ConvertSuccess t [Char] where convertSuccess = toString data TypeHtml = TypeHtml deriving(Typeable) instance ContentType TypeHtml where typeByExt "html" = TypeHtml toString TypeHtml = "text/html; charset=utf-8" -- Peter --===============4479124401553368434==-- From michael@snoyman.com Fri Apr 23 07:11:32 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Simple mime-type package Date: Fri, 23 Apr 2010 04:44:05 -0700 Message-ID: In-Reply-To: <8C58135B-10A1-452B-A0BD-74AF7D1EF405@n-heptane.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0621894018590420219==" --===============0621894018590420219== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Thu, Apr 22, 2010 at 9:42 AM, Jeremy Shaw wrote: > Hello, > > I am not especially excited about it. The fact that some mime-types are > hard coded, and others are not is an annoying 'inconsistency'. > > There is no way to extend the list of supported types in user apps. And > typeByExt has a rather limited set up extensions, declaring everything else > to be application/octet-stream. > > The use of a type for the mime-types implies that you want to be pattern > matching on the constructors in your code ? Can you give a use case for that > ? > > > I wouldn't say that type implies pattern matching. I think the type makes code much clearer. For example, in Haskell I have: type ChooseRep = [ContentType] -> IO (ContentType, Content) I find that to be *much* clearer than type ChooseRep = [String] -> IO (String, Content) You could argue that I should just be using a type instead of a datatype, but that's an old debate between convenience and compiler type-safety. You could also argue that this should just be newtype ContentType = ContentType String I find three advantages for the current method. First, in theory passing around a TypeHtml constructor takes less memory than a ContentType "text/html; charset=utf-8", but I could be missing something about optimizations here. Second, it's just a lot more convenient to write in the first place. The alternative to having TypeHtml etc constructors would be: typeHtml :: ContentType typeHtml = ContentType "text/html; charset=utf-8" Plus adding each function to the export list is just more tedious. Finally, I find the code *looks* better using a constructor than a function, eg chooseRep [TypeHtml, TypeJson] versus chooseRep [typeHtml, typeJson] though that's just a matter of taste. I'm also not too concerned about the inconsistency, though I see where you're coming from. One of the advantages I'd see of opening this into a standalone package is that in theory the whole community could keep adding mimetypes until this is very comprehensive. I find your argument to be more apropos to the typeByExt function, since that *is* a case where users would want to both extend and override library defaults. I see two options here: * Change typeByExt to have return type "Maybe ContentType", and then users won't need to worry about the TypeOctet appearing all over the place. They can choose whatever default they want. If they want to extend or override, they just need to write their own function to be called before typeByExt. * Don't provide a function at all; instead, provide a Map (or trie) with a number of built-in extension -> mimetype mappings. Users could then just do a lookup, as well as make changes to that Map. Michael --===============0621894018590420219== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gVGh1LCBBcHIgMjIsIDIwMTAgYXQg OTo0MiBBTSwgSmVyZW15IFNoYXcgPHNwYW4gZGlyPSJsdHIiPiZsdD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2FudCB0byBleHRlbmQgb3Igb3Zl cnJpZGUsIHRoZXkganVzdCBuZWVkIHRvIHdyaXRlIHRoZWlyIG93biBmdW5jdGlvbiB0byBiZSBj YWxsZWQgYmVmb3JlIHR5cGVCeUV4dC48L2Rpdj4KPGRpdj4qIERvbiYjMzk7dCBwcm92aWRlIGEg ZnVuY3Rpb24gYXQgYWxsOyBpbnN0ZWFkLCBwcm92aWRlIGEgTWFwIChvciB0cmllKSB3aXRoIGEg bnVtYmVyIG9mIGJ1aWx0LWluIGV4dGVuc2lvbiAtJmd0OyBtaW1ldHlwZSBtYXBwaW5ncy4gVXNl cnMgY291bGQgdGhlbiBqdXN0IGRvIGEgbG9va3VwLCBhcyB3ZWxsIGFzIG1ha2UgY2hhbmdlcyB0 byB0aGF0IE1hcC48L2Rpdj48ZGl2Pjxicj4KPC9kaXY+PGRpdj5NaWNoYWVsPC9kaXY+PC9kaXY+ Cg== --===============0621894018590420219==-- From chris@eidhof.nl Fri Apr 23 08:08:24 2010 From: Chris Eidhof To: web-devel@haskell.org Subject: [web-devel] alpha release: my thesis Date: Fri, 23 Apr 2010 14:40:55 +0200 Message-ID: <69D398C7-710A-4722-B0EB-F5E48385C1F0@eidhof.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7096952431270344183==" --===============7096952431270344183== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hey everyone, Next week I'll be handing in my thesis, which is titled "Web development in H= askell". In my thesis I discuss three libraries that I've developed: one for = data modeling (and persistency), one for continuation-based web programming a= nd a library for generic views. The thesis starts with a small example that s= hows how these libraries play together. If anybody feels like reading it, I've uploaded the current version [1]. If t= here's anything that's unclear: it's not your fault, but probably lousy writi= ng from me. Comments are very much appreciated and can be emailed to me. After finishing my thesis, I plan to build a nice website and tutorial for th= is framework, and prepare everything to release it on hackage. It'll probably= take some time though, but I'll keep this list updated. -chris [1]: http://eidhof.nl/thesis/thesis-alpha.pdf --===============7096952431270344183==-- From chris@eidhof.nl Fri Apr 23 09:21:00 2010 From: Chris Eidhof To: web-devel@haskell.org Subject: Re: [web-devel] alpha release: my thesis Date: Fri, 23 Apr 2010 15:53:30 +0200 Message-ID: <748F99AD-FD51-4E39-9310-135F020A45A3@eidhof.nl> In-Reply-To: <69D398C7-710A-4722-B0EB-F5E48385C1F0@eidhof.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1598910752055492734==" --===============1598910752055492734== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hm, the link didn't render correctly because of the web-devel footer. The cor= rect link is: http://eidhof.nl/thesis/thesis-alpha.pdf Thanks, -chris On 23 apr 2010, at 14:40, Chris Eidhof wrote: > Hey everyone, >=20 > Next week I'll be handing in my thesis, which is titled "Web development in= Haskell". In my thesis I discuss three libraries that I've developed: one fo= r data modeling (and persistency), one for continuation-based web programming= and a library for generic views. The thesis starts with a small example that= shows how these libraries play together. >=20 > If anybody feels like reading it, I've uploaded the current version [1]. If= there's anything that's unclear: it's not your fault, but probably lousy wri= ting from me. Comments are very much appreciated and can be emailed to me. >=20 > After finishing my thesis, I plan to build a nice website and tutorial for = this framework, and prepare everything to release it on hackage. It'll probab= ly take some time though, but I'll keep this list updated. >=20 > -chris >=20 > [1]: http://eidhof.nl/thesis/thesis-alpha.pdf______________________________= _________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel --===============1598910752055492734==-- From chris@eidhof.nl Sat Apr 24 02:16:32 2010 From: Chris Eidhof To: web-devel@haskell.org Subject: Re: [web-devel] alpha release: my thesis Date: Sat, 24 Apr 2010 08:49:05 +0200 Message-ID: <0863F2BA-E262-40C6-B7A1-76647B46EC08@eidhof.nl> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0719024629709879864==" --===============0719024629709879864== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hey Thomas, I think you need to checkout the following packages from github and cabal-ins= tall them: chriseidhof/fclabels chriseidhof/salvia chriseidhof/salvia-protocol chriseidhof/regular-web chriseidhof/Basil And then you could checkout my thesis repository and do a "cd quiz; ghci Quiz= .lhs; main". I'm sure that I've forgotten something, just let me know if you run into prob= lems and I'll fix the instructions. -chris On 23 apr 2010, at 21:14, Thomas Hartman wrote: > I see there's a lot of stuff on github. Yah! >=20 > Could you give the command(s) for >=20 > -- checkout > -- cabal install > -- run the quiz sample app >=20 > cheers, thomas. >=20 >=20 > On Fri, Apr 23, 2010 at 6:53 AM, Chris Eidhof wrote: >> Hm, the link didn't render correctly because of the web-devel footer. The = correct link is: >>=20 >> http://eidhof.nl/thesis/thesis-alpha.pdf >>=20 >> Thanks, >>=20 >> -chris >>=20 >> On 23 apr 2010, at 14:40, Chris Eidhof wrote: >>=20 >>> Hey everyone, >>>=20 >>> Next week I'll be handing in my thesis, which is titled "Web development = in Haskell". In my thesis I discuss three libraries that I've developed: one = for data modeling (and persistency), one for continuation-based web programmi= ng and a library for generic views. The thesis starts with a small example th= at shows how these libraries play together. >>>=20 >>> If anybody feels like reading it, I've uploaded the current version [1]. = If there's anything that's unclear: it's not your fault, but probably lousy w= riting from me. Comments are very much appreciated and can be emailed to me. >>>=20 >>> After finishing my thesis, I plan to build a nice website and tutorial fo= r this framework, and prepare everything to release it on hackage. It'll prob= ably take some time though, but I'll keep this list updated. >>>=20 >>> -chris >>>=20 >>> [1]: http://eidhof.nl/thesis/thesis-alpha.pdf____________________________= ___________________ >>> web-devel mailing list >>> web-devel@haskell.org >>> http://www.haskell.org/mailman/listinfo/web-devel >>=20 >> _______________________________________________ >> web-devel mailing list >> web-devel@haskell.org >> http://www.haskell.org/mailman/listinfo/web-devel >>=20 >=20 >=20 >=20 > --=20 > Need somewhere to put your code? http://patch-tag.com > Want to build a webapp? http://happstack.com --===============0719024629709879864==-- From jaspervdj@gmail.com Sun Apr 25 04:22:31 2010 From: Jasper Van der Jeugt To: web-devel@haskell.org Subject: [web-devel] BlazeHtml: a question about API design Date: Sun, 25 Apr 2010 10:54:49 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3397050671181797992==" --===============3397050671181797992== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hey web-devel mailing list, I'm currently working on the BlazeHtml HTML combinator library, and currently a bit stuck on a piece of API design, for which I need some community feedback. I'll try to explain the problem here as clear as possible. The base idea is, for an HTML combinator library, that you provide combinators that the end user can use to "combine" his document. More specifically, we would have combinators for every HTML element. So, say you have the regular div tag. This would be, in our library, Text.Blaze.Html.Strict.div. That makes sense, but it seems possible that a user wants to use a div as a leaf node (e.g. `
    `). So there are two possible signatures for `div`: div :: Html -- An empty div element. div :: Html -> Html -- The argument is the content of the div element. I'm not sure what we want to do in that case. I so far see two major options: Option 1: We can provide leaf and non-leaf combinators for every tag. I'm not sure if this is overkill or not, but it is, for example not forbidden to have content in an `` tag. We could have these functions in Text.Blaze.Html.Strict and Text.Blaze.Html.Strict.Leaf, for instance. But it must be kind of annoying for the end user to have to write `L.div` instead of just `div`. On the other hand, if we put the *common* uses for the tags (e.g. `img` as leaf, `div` as non-leaf) in the main module, we would get a very inconsistent mess, I assume. So this solution would include: - a module of html combinators as non-leaf elements - a module of html combinators as leaf-elements - the possibility for the end-user to import and qualify them as he/she sees fit; or - add a module with the most common uses and re-export the combinators Option 2: We could only support parent nodes (of the type `Html -> Html`), and introduce another combinator: (/>) :: Html (/>) = mempty I have chosen `/>` here because it resembles the end of a leaf HTML tag (e.g. ``). Then, we would introduce a custom rule. {-# RULES "tag/empty" forall x y. tag x y (/>) = leaf x #-} The `y` here is the closing tag, we pass it as an argument for performance reasons, and you can safely ignore it. This code results in the fact that if we write img (/>) somewhere in our template, it would be rendered to `` when we don't pass `-fenable-rewrite-rules` to the compiler, and `` otherwise. Note that `-O` implies `-fenable-rewrite-rules`. I'm not sure about this solution either, because it sort of feels like a (slightly elegant) hack. I have my doubts with both options, but I would tend to go for (1), because (2) feels more unstable. Anyway, feedback and more ideas would be appreciated :-) Kind regards, Jasper Van der Jeugt --===============3397050671181797992==-- From deniz.a.m.dogan@gmail.com Sun Apr 25 04:33:27 2010 From: Deniz Dogan To: web-devel@haskell.org Subject: Re: [web-devel] BlazeHtml: a question about API design Date: Sun, 25 Apr 2010 11:05:46 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5708572245487493879==" --===============5708572245487493879== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 2010/4/25 Jasper Van der Jeugt : > Hey web-devel mailing list, > > I'm currently working on the BlazeHtml HTML combinator library, and > currently a bit stuck on a piece of API design, for which I need some > community feedback. I'll try to explain the problem here as clear as > possible. > > The base idea is, for an HTML combinator library, that you provide > combinators that the end user can use to "combine" his document. More > specifically, we would have combinators for every HTML element. > > So, say you have the regular div tag. This would be, in our library, > Text.Blaze.Html.Strict.div. That makes sense, but it seems possible > that a user wants to use a div as a leaf node (e.g. `
    `). So > there are two possible signatures for `div`: > > div :: Html -- An empty div element. > div :: Html -> Html -- The argument is the content of the div element. > > I'm not sure what we want to do in that case. I so far see two major option= s: > > Option 1: We can provide leaf and non-leaf combinators for every tag. > I'm not sure if this is overkill or not, but it is, for example not > forbidden to have content in an `` tag. We could have these > functions in Text.Blaze.Html.Strict and Text.Blaze.Html.Strict.Leaf, > for instance. But it must be kind of annoying for the end user to have > to write `L.div` instead of just `div`. On the other hand, if we put > the *common* uses for the tags (e.g. `img` as leaf, `div` as non-leaf) > in the main module, we would get a very inconsistent mess, I assume. > > So this solution would include: > - a module of html combinators as non-leaf elements > - a module of html combinators as leaf-elements > - the possibility for the end-user to import and qualify them as > he/she sees fit; or > - add a module with the most common uses and re-export the combinators > > Option 2: We could only support parent nodes (of the type `Html -> > Html`), and introduce another combinator: > > =C2=A0 =C2=A0(/>) :: Html > =C2=A0 =C2=A0(/>) =3D mempty > > I have chosen `/>` here because it resembles the end of a leaf HTML > tag (e.g. ``). Then, we would introduce a custom rule. > > =C2=A0 =C2=A0{-# RULES > =C2=A0 =C2=A0 =C2=A0 =C2=A0"tag/empty" forall x y. tag x y (/>) =3D leaf x > =C2=A0 =C2=A0 =C2=A0 =C2=A0#-} > > The `y` here is the closing tag, we pass it as an argument for > performance reasons, and you can safely ignore it. This code results > in the fact that if we write > > =C2=A0 =C2=A0img (/>) > > somewhere in our template, it would be rendered to `` when > we don't pass `-fenable-rewrite-rules` to the compiler, and `` > otherwise. Note that `-O` implies `-fenable-rewrite-rules`. I'm not > sure about this solution either, because it sort of feels like a > (slightly elegant) hack. > > I have my doubts with both options, but I would tend to go for (1), > because (2) feels more unstable. Anyway, feedback and more ideas would > be appreciated :-) > > Kind regards, > Jasper Van der Jeugt > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > I like the idea of having a definition for (/>) but at the same time I think you're overthinking this. I would just append an apostrophe to the names of functions that are "self-closing". div =3D "
    " div' =3D "
    " etc. --=20 Deniz Dogan --===============5708572245487493879==-- From miguelimo38@yandex.ru Sun Apr 25 04:35:43 2010 From: Miguel Mitrofanov To: web-devel@haskell.org Subject: Re: [web-devel] BlazeHtml: a question about API design Date: Sun, 25 Apr 2010 13:08:18 +0400 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7209382192725891895==" --===============7209382192725891895== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Why not use classes? class DivType a where div :: a instance DivType Html where ... class IsHtml a where ... instance IsHtml Html where ... instance IsHtml a => DivType (a -> a) where ... Or, maybe better: class DivContents a where div :: a -> Html instance DivContents Html where ... instance DivContents String where ... instance DivContents () where ... and use "div ()" instead of just "div" for empty tag. On 25 Apr 2010, at 12:54, Jasper Van der Jeugt wrote: > Hey web-devel mailing list, > > I'm currently working on the BlazeHtml HTML combinator library, and > currently a bit stuck on a piece of API design, for which I need some > community feedback. I'll try to explain the problem here as clear as > possible. > > The base idea is, for an HTML combinator library, that you provide > combinators that the end user can use to "combine" his document. More > specifically, we would have combinators for every HTML element. > > So, say you have the regular div tag. This would be, in our library, > Text.Blaze.Html.Strict.div. That makes sense, but it seems possible > that a user wants to use a div as a leaf node (e.g. `
    `). So > there are two possible signatures for `div`: > > div :: Html -- An empty div element. > div :: Html -> Html -- The argument is the content of the div element. > > I'm not sure what we want to do in that case. I so far see two major > options: > > Option 1: We can provide leaf and non-leaf combinators for every tag. > I'm not sure if this is overkill or not, but it is, for example not > forbidden to have content in an `` tag. We could have these > functions in Text.Blaze.Html.Strict and Text.Blaze.Html.Strict.Leaf, > for instance. But it must be kind of annoying for the end user to have > to write `L.div` instead of just `div`. On the other hand, if we put > the *common* uses for the tags (e.g. `img` as leaf, `div` as non-leaf) > in the main module, we would get a very inconsistent mess, I assume. > > So this solution would include: > - a module of html combinators as non-leaf elements > - a module of html combinators as leaf-elements > - the possibility for the end-user to import and qualify them as > he/she sees fit; or > - add a module with the most common uses and re-export the combinators > > Option 2: We could only support parent nodes (of the type `Html -> > Html`), and introduce another combinator: > > (/>) :: Html > (/>) = mempty > > I have chosen `/>` here because it resembles the end of a leaf HTML > tag (e.g. ``). Then, we would introduce a custom rule. > > {-# RULES > "tag/empty" forall x y. tag x y (/>) = leaf x > #-} > > The `y` here is the closing tag, we pass it as an argument for > performance reasons, and you can safely ignore it. This code results > in the fact that if we write > > img (/>) > > somewhere in our template, it would be rendered to `` when > we don't pass `-fenable-rewrite-rules` to the compiler, and `` > otherwise. Note that `-O` implies `-fenable-rewrite-rules`. I'm not > sure about this solution either, because it sort of feels like a > (slightly elegant) hack. > > I have my doubts with both options, but I would tend to go for (1), > because (2) feels more unstable. Anyway, feedback and more ideas would > be appreciated :-) > > Kind regards, > Jasper Van der Jeugt > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel --===============7209382192725891895==-- From jaspervdj@gmail.com Sun Apr 25 04:43:35 2010 From: Jasper Van der Jeugt To: web-devel@haskell.org Subject: Re: [web-devel] BlazeHtml: a question about API design Date: Sun, 25 Apr 2010 11:15:52 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4199065582920771056==" --===============4199065582920771056== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Hey, The apostrophe approach might work out. The reason I'm not using classes is efficiency. We had a Html-class approach in the past, but we didn't manage to get all the overhead compiled away, so we couldn't get our solution fast enough using classes (unfortunately). (By fast enough, we mean really really fast). We might add an abstraction layer again later (using classes), but we first need a good performance baseline. Kind regards, Jasper Van der Jeugt On Sun, Apr 25, 2010 at 11:08 AM, Miguel Mitrofanov wrote: > Why not use classes? > > class DivType a where div :: a > instance DivType Html where ... > class IsHtml a where ... > instance IsHtml Html where ... > instance IsHtml a => DivType (a -> a) where ... > > Or, maybe better: > > class DivContents a where div :: a -> Html > instance DivContents Html where ... > instance DivContents String where ... > instance DivContents () where ... > > and use "div ()" instead of just "div" for empty tag. > > On 25 Apr 2010, at 12:54, Jasper Van der Jeugt wrote: > >> Hey web-devel mailing list, >> >> I'm currently working on the BlazeHtml HTML combinator library, and >> currently a bit stuck on a piece of API design, for which I need some >> community feedback. I'll try to explain the problem here as clear as >> possible. >> >> The base idea is, for an HTML combinator library, that you provide >> combinators that the end user can use to "combine" his document. More >> specifically, we would have combinators for every HTML element. >> >> So, say you have the regular div tag. This would be, in our library, >> Text.Blaze.Html.Strict.div. That makes sense, but it seems possible >> that a user wants to use a div as a leaf node (e.g. `
    `). So >> there are two possible signatures for `div`: >> >> div :: Html -- An empty div element. >> div :: Html -> Html -- The argument is the content of the div element. >> >> I'm not sure what we want to do in that case. I so far see two major >> options: >> >> Option 1: We can provide leaf and non-leaf combinators for every tag. >> I'm not sure if this is overkill or not, but it is, for example not >> forbidden to have content in an `` tag. We could have these >> functions in Text.Blaze.Html.Strict and Text.Blaze.Html.Strict.Leaf, >> for instance. But it must be kind of annoying for the end user to have >> to write `L.div` instead of just `div`. On the other hand, if we put >> the *common* uses for the tags (e.g. `img` as leaf, `div` as non-leaf) >> in the main module, we would get a very inconsistent mess, I assume. >> >> So this solution would include: >> - a module of html combinators as non-leaf elements >> - a module of html combinators as leaf-elements >> - the possibility for the end-user to import and qualify them as >> he/she sees fit; or >> - add a module with the most common uses and re-export the combinators >> >> Option 2: We could only support parent nodes (of the type `Html -> >> Html`), and introduce another combinator: >> >>   (/>) :: Html >>   (/>) = mempty >> >> I have chosen `/>` here because it resembles the end of a leaf HTML >> tag (e.g. ``). Then, we would introduce a custom rule. >> >>   {-# RULES >>       "tag/empty" forall x y. tag x y (/>) = leaf x >>       #-} >> >> The `y` here is the closing tag, we pass it as an argument for >> performance reasons, and you can safely ignore it. This code results >> in the fact that if we write >> >>   img (/>) >> >> somewhere in our template, it would be rendered to `` when >> we don't pass `-fenable-rewrite-rules` to the compiler, and `` >> otherwise. Note that `-O` implies `-fenable-rewrite-rules`. I'm not >> sure about this solution either, because it sort of feels like a >> (slightly elegant) hack. >> >> I have my doubts with both options, but I would tend to go for (1), >> because (2) feels more unstable. Anyway, feedback and more ideas would >> be appreciated :-) >> >> Kind regards, >> Jasper Van der Jeugt >> _______________________________________________ >> web-devel mailing list >> web-devel@haskell.org >> http://www.haskell.org/mailman/listinfo/web-devel > > --===============4199065582920771056==-- From gale@sefer.org Sun Apr 25 07:21:27 2010 From: Yitzchak Gale To: web-devel@haskell.org Subject: Re: [web-devel] BlazeHtml: a question about API design Date: Sun, 25 Apr 2010 14:53:45 +0300 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3904456099214086497==" --===============3904456099214086497== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit All of the ideas mentioned so far have already been implemented in some form on hackage. It's worthwhile to browse through and look them over. The classic approach is in the html and xhtml packages. They are basically Jasper's combinator idea, together with Miguel's class idea. There are a few other approaches, but I like your ideas the best. One problem is that these are based on plain String, so it's easy to generate invalid output due to problems with entities and encodings. Also, one would hope that the type system could constrain the document structure to conform to the DTD. But both of those turn out to add a lot of complexity. See the haxml and hxt packages, and Henning's wrapper for them xml-basic, for some ideas. Regards, Yitz --===============3904456099214086497==-- From johan.tibell@gmail.com Sun Apr 25 08:22:34 2010 From: Johan Tibell To: web-devel@haskell.org Subject: Re: [web-devel] BlazeHtml: a question about API design Date: Sun, 25 Apr 2010 14:54:53 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6498992260323752145==" --===============6498992260323752145== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Sun, Apr 25, 2010 at 10:54 AM, Jasper Van der Jeugt wrote: > So, say you have the regular div tag. This would be, in our library, > Text.Blaze.Html.Strict.div. That makes sense, but it seems possible > that a user wants to use a div as a leaf node (e.g. `
    `). So > there are two possible signatures for `div`: > > div :: Html -- An empty div element. > div :: Html -> Html -- The argument is the content of the div element. Note that the far most common use of empty elements like this is when you later want to populate the element using from JavaScript. > I'm not sure what we want to do in that case. I so far see two major option= s: > > Option 1: We can provide leaf and non-leaf combinators for every tag. > I'm not sure if this is overkill or not, but it is, for example not > forbidden to have content in an `` tag. I'm afraid I was wrong when I told you this was the case. The "img" tag (and several others, like "br") must not have any content. Check the HTML spec or try it out in w3's HTML validator. Your problem still remains for tags that may have content, like "div". > I have my doubts with both options, but I would tend to go for (1), > because (2) feels more unstable. Anyway, feedback and more ideas would > be appreciated :-) Given that this problem is quite rare I'd just have the user provide some empty contents in the cases where an empty tag is called for div (text "") With OverloadedStrings it's even shorter: div "" If you care about the distinction between "" and "" you can postpone outputting the start tag until you produced some content and output the different tag form in case you detect that no content was added. This avoid introducing new operators, type classes or doubling the number of combinators. Cheers, Johan --===============6498992260323752145==-- From michael@snoyman.com Sat May 8 17:55:59 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: [web-devel] ANNOUNCE: hamlet 0.2.0 Date: Sun, 09 May 2010 01:29:18 +0300 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8694683119824575854==" --===============8694683119824575854== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi all, I'm happy to announce the second major release of Hamlet[1]. Hamlet is a HTML templating library which works via quasi-quoting, giving you compile-time assurances, type safety and very efficient HTML generation. I wrote a blog post[2] describing the changes in this version of Hamlet. The two most major are reversing of identifier order in references and dropping the template argument. Combined, these changes make a Hamlet template fit in better with Haskell code. All the other changes are noted in that same blog post. The Hamlet documentation[3] has been updated to reflect all changes. Please let me know if the documentation needs clarification on any points. Cheers, Michael [1] http://hackage.haskell.org/package/hamlet-0.2.0 [2] http://www.snoyman.com/blog/entry/hamlet-version-0-2/ [3] http://docs.yesodweb.com/hamlet/ --===============8694683119824575854== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+SGkgYWxsLDxkaXY+PGJyPjwvZGl2PjxkaXY+SSYjMzk7bSBoYXBweSB0 byBhbm5vdW5jZSB0aGUgc2Vjb25kIG1ham9yIHJlbGVhc2Ugb2YgSGFtbGV0WzFdLiBIYW1sZXQg aXMgYSBIVE1MIHRlbXBsYXRpbmcgbGlicmFyeSB3aGljaCB3b3JrcyB2aWEgcXVhc2ktcXVvdGlu ZywgZ2l2aW5nIHlvdSBjb21waWxlLXRpbWUgYXNzdXJhbmNlcywgdHlwZSBzYWZldHkgYW5kIHZl cnkgZWZmaWNpZW50IEhUTUwgZ2VuZXJhdGlvbi48L2Rpdj4KPGRpdj48YnI+PC9kaXY+PGRpdj5J IHdyb3RlIGEgYmxvZyBwb3N0WzJdIGRlc2NyaWJpbmcgdGhlIGNoYW5nZXMgaW4gdGhpcyB2ZXJz aW9uIG9mIEhhbWxldC4gVGhlIHR3byBtb3N0IG1ham9yIGFyZSByZXZlcnNpbmcgb2YgaWRlbnRp ZmllciBvcmRlciBpbiByZWZlcmVuY2VzIGFuZCBkcm9wcGluZyB0aGUgdGVtcGxhdGUgYXJndW1l bnQuIENvbWJpbmVkLCB0aGV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+PG1ldGEgaHR0cC1lcXVpdj0iY29udGVudC10eXBlIiBjb250ZW50PSJ0ZXh0L2h0 bWw7IGNoYXJzZXQ9dXRmLTgiPjwvZGl2Pgo= --===============8694683119824575854==-- From jeremy@n-heptane.com Mon May 10 15:31:24 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: [web-devel] Re: [Haskell-cafe] ANNOUNCE: hamlet 0.2.0 Date: Mon, 10 May 2010 15:04:48 -0500 Message-ID: <9E216901-B855-442D-BCC3-C0D42ED17601@n-heptane.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0028376566558169727==" --===============0028376566558169727== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit I updated happstack-hamlet 0.2.1. Just had to update the example, and bump the version bounds. - jeremy On May 8, 2010, at 5:29 PM, Michael Snoyman wrote: > Hi all, > > I'm happy to announce the second major release of Hamlet[1]. Hamlet > is a HTML templating library which works via quasi-quoting, giving > you compile-time assurances, type safety and very efficient HTML > generation. > > I wrote a blog post[2] describing the changes in this version of > Hamlet. The two most major are reversing of identifier order in > references and dropping the template argument. Combined, these > changes make a Hamlet template fit in better with Haskell code. All > the other changes are noted in that same blog post. > > The Hamlet documentation[3] has been updated to reflect all changes. > Please let me know if the documentation needs clarification on any > points. > > Cheers, > Michael > > [1] http://hackage.haskell.org/package/hamlet-0.2.0 > [2] http://www.snoyman.com/blog/entry/hamlet-version-0-2/ > [3] http://docs.yesodweb.com/hamlet/ > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe --===============0028376566558169727== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGh0bWw+PGhlYWQ+PG1ldGEgaHR0cC1lcXVpdj0iY29udGVudC10eXBlIiBjb250ZW50PSJ0ZXh0 L2h0bWw7IGNoYXJzZXQ9dXRmLTgiPjxtZXRhIGh0dHAtZXF1aXY9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R3ZWIuY29tL2hhbWxldC8iPmh0dHA6Ly9kb2NzLnllc29kd2ViLmNvbS9oYW1s ZXQvPC9hPjwvZGl2PjwvZGl2PiBfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fXzxicj5IYXNrZWxsLUNhZmUgbWFpbGluZyBsaXN0PGJyPjxhIGhyZWY9Im1haWx0 bzpIYXNrZWxsLUNhZmVAaGFza2VsbC5vcmciPkhhc2tlbGwtQ2FmZUBoYXNrZWxsLm9yZzwvYT48 YnI+aHR0cDovL3d3dy5oYXNrZWxsLm9yZy9tYWlsbWFuL2xpc3RpbmZvL2hhc2tlbGwtY2FmZTxi cj48L2Jsb2NrcXVvdGU+PC9kaXY+PGJyPjwvZGl2PjwvZGl2PjwvYm9keT48L2h0bWw+ --===============0028376566558169727==-- From michael@snoyman.com Wed May 12 09:13:24 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: [web-devel] Call for comments: Yesod 0.2 Date: Wed, 12 May 2010 16:46:54 +0300 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1544767305536770365==" --===============1544767305536770365== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi all, I believe my 0.2 branch of Yesod[1] is feature-complete for this release, and it seems to be fairly stable. The documentation on it[2] give a good introduction, and hopefully the haddocks will fill in the gaps. At this point, I wanted to ask the community if they have any changes they'd like to see in this release. I'm planning on releasing some time next week. The main feature which is still prominently missing for this release is a persistence layer; hopefully that will be included in the next major release. If anyone has any ideas on this, I'm all ears. Thanks, Michael [1] http://github.com/snoyberg/yesod/tree/ver0.2 [2] http://docs.yesodweb.com/yesod/ --===============1544767305536770365== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+SGkgYWxsLDxkaXY+PGJyPjwvZGl2PjxkaXY+SSBiZWxpZXZlIG15IDAu MiBicmFuY2ggb2YgWWVzb2RbMV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Gl2PjxkaXY+WzJdwqA8YSBocmVmPSJodHRwOi8vZG9jcy55ZXNvZHdlYi5jb20veWVzb2QvIj5o dHRwOi8vZG9jcy55ZXNvZHdlYi5jb20veWVzb2QvPC9hPjwvZGl2Pgo8bWV0YSBodHRwLWVxdWl2 PSJjb250ZW50LXR5cGUiIGNvbnRlbnQ9InRleHQvaHRtbDsgY2hhcnNldD11dGYtOCI+PG1ldGEg aHR0cC1lcXVpdj0iY29udGVudC10eXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7IGNoYXJzZXQ9dXRm LTgiPjwvZGl2Pgo= --===============1544767305536770365==-- From jeremy@n-heptane.com Wed May 12 12:08:01 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [web-devel] Call for comments: Yesod 0.2 Date: Wed, 12 May 2010 11:41:26 -0500 Message-ID: <887F38D0-755B-45FB-A3BD-A9B0E67D706E@n-heptane.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8951354605838419971==" --===============8951354605838419971== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hello, Is there an update-to-date example that works with Yesod so I can a feel for how it works ? - jeremy On May 12, 2010, at 8:46 AM, Michael Snoyman wrote: > Hi all, > > I believe my 0.2 branch of Yesod[1] is feature-complete for this > release, and it seems to be fairly stable. The documentation on > it[2] give a good introduction, and hopefully the haddocks will fill > in the gaps. > > At this point, I wanted to ask the community if they have any > changes they'd like to see in this release. I'm planning on > releasing some time next week. > > The main feature which is still prominently missing for this release > is a persistence layer; hopefully that will be included in the next > major release. If anyone has any ideas on this, I'm all ears. > > Thanks, > Michael > > [1] http://github.com/snoyberg/yesod/tree/ver0.2 > [2] http://docs.yesodweb.com/yesod/ > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel --===============8951354605838419971== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGh0bWw+PGhlY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lZj0ibWFp bHRvOndlYi1kZXZlbEBoYXNrZWxsLm9yZyI+d2ViLWRldmVsQGhhc2tlbGwub3JnPC9hPjxicj5o dHRwOi8vd3d3Lmhhc2tlbGwub3JnL21haWxtYW4vbGlzdGluZm8vd2ViLWRldmVsPGJyPjwvYmxv Y2txdW90ZT48L2Rpdj48YnI+PC9kaXY+PC9ib2R5PjwvaHRtbD4= --===============8951354605838419971==-- From michael@snoyman.com Wed May 12 12:17:52 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Call for comments: Yesod 0.2 Date: Wed, 12 May 2010 19:51:24 +0300 Message-ID: In-Reply-To: <887F38D0-755B-45FB-A3BD-A9B0E67D706E@n-heptane.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6256384901663683086==" --===============6256384901663683086== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit There's a HelloWorld and five tutorials available on the documentation site[1]. Each of the tutorials is in fact a literate Haskell file in the repo[2], so if you want to experiment, you might just clone the repo and start running code. The first three tutorials are properly commented; the last two are mostly just code. I have not ported over any of my open-source web apps to Yesod 0.2 yet, so most complex examples are not available at the moment. Michael [1] http://docs.yesodweb.com/yesod/ [2] http://github.com/snoyberg/yesoddocs On Wed, May 12, 2010 at 7:41 PM, Jeremy Shaw wrote: > Hello, > > Is there an update-to-date example that works with Yesod so I can a feel > for how it works ? > > - jeremy > > On May 12, 2010, at 8:46 AM, Michael Snoyman wrote: > > Hi all, > > I believe my 0.2 branch of Yesod[1] is feature-complete for this release, > and it seems to be fairly stable. The documentation on it[2] give a good > introduction, and hopefully the haddocks will fill in the gaps. > > At this point, I wanted to ask the community if they have any changes > they'd like to see in this release. I'm planning on releasing some time next > week. > > The main feature which is still prominently missing for this release is a > persistence layer; hopefully that will be included in the next major > release. If anyone has any ideas on this, I'm all ears. > > Thanks, > Michael > > [1] http://github.com/snoyberg/yesod/tree/ver0.2 > [2] http://docs.yesodweb.com/yesod/ > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > > > --===============6256384901663683086== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+VGhlcmUmIzM5O3MgYSBIZWxsb1dvcmxkIGFuZCBmaXZlIHR1dG9yaWFs cyBhdmFpbGFibGUgb24gdGhlIGRvY3VtZW50YXRpb24gc2l0ZVsxXS4gRWFjaCBvZiB0aGUgdHV0 b3JpYWxzIGlzIGluIGZhY3QgYSBsaXRlcmF0ZSBIYXNrZWxsIGZpbGUgaW4gdGhlIHJlcG9bMl0s IHNvIGlmIHlvdSB3YW50IHRvIGV4cGVyaW1lbnQsIHlvdSBtaWdodCBqdXN0IGNsb25lIHRoZSBy ZXBvIGFuZCBzdGFydCBydW5uaW5nIGNvZGUuPGRpdj4KPGJyPjwvZGl2PjxkaXY+VGhlIGZpcnN0 IHRocmVlIHR1dG9yaWFscyBhcmUgcHJvcGVybHkgY29tbWVudGVkOyB0aGUgbGFzdCB0d28gYXJl IG1vc3RseSBqdXN0IGNvZGUuIEkgaGF2ZSBub3QgcG9ydGVkIG92ZXIgYW55IG9mIG15IG9wZW4t c291cmNlIHdlYiBhcHBzIHRvIFllc29kIDAuMiB5ZXQsIHNvIG1vc3QgY29tcGxleCBleGFtcGxl cyBhcmUgbm90IGF2YWlsYWJsZSBhdCB0aGUgbW9tZW50LjwvZGl2Pgo8ZGl2Pjxicj48L2Rpdj48 ZGl2Pk1pY2hhZWw8YnI+PGRpdj48YnI+PC9kaXY+PGRpdj5bMV3CoDxhIGhyZWY9Imh0dHA6Ly9k b2NzLnllc29kd2ViLmNvbS95ZXNvZC8iPmh0dHA6Ly9kb2NzLnllc29kd2ViLmNvbS95ZXNvZC88 L2E+PC9kaXY+PGRpdj48YSBocmVmPSJodHRwOi8vZG9jcy55ZXNvZHdlYi5jb20veWVzb2QvIj48 L2E+WzJdwqA8YSBocmVmPSJodHRwO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90cmVlL3ZlcjAuMjwvYT48L2Rpdj48ZGl2PlsyXcKgPGEgaHJlZj0iaHR0 cDovL2RvY3MueWVzb2R3ZWIuY29tL3llc29kLyIgdGFyZ2V0PSJfYmxhbmsiPmh0dHA6Ly9kb2Nz Lnllc29kd2ViLmNvbS95ZXNvZC88L2E+PC9kaXY+CiA8L2Rpdj48L2Rpdj48L2Rpdj4gX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX188YnI+d2ViLWRldmVsIG1h aWxpbmcgbGlzdDxicj48YSBocmVmPSJtYWlsdG86d2ViLWRldmVsQGhhc2tlbGwub3JnIiB0YXJn ZXQ9Il9ibGFuayI+d2ViLWRldmVsQGhhc2tlbGwub3JnPC9hPjxicj48YSBocmVmPSJodHRwOi8v d3d3Lmhhc2tlbGwub3JnL21haWxtYW4vbGlzdGluZm8vd2ViLWRldmVsIiB0YXJnZXQ9Il9ibGFu ayI+aHR0cDovL3d3dy5oYXNrZWxsLm9yZy9tYWlsbWFuL2xpc3RpbmZvL3dlYi1kZXZlbDwvYT48 YnI+CjwvYmxvY2txdW90ZT48L2Rpdj48YnI+PC9kaXY+PC9kaXY+PC9ibG9ja3F1b3RlPjwvZGl2 Pjxicj48L2Rpdj48L2Rpdj48L2Rpdj4K --===============6256384901663683086==-- From gour@gour-nitai.com Wed May 12 13:19:43 2010 From: Gour To: web-devel@haskell.org Subject: [web-devel] Re: Call for comments: Yesod 0.2 Date: Wed, 12 May 2010 19:52:52 +0200 Message-ID: <20100512195252.2cba48e1@gaura-nitai> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0550141818788267842==" --===============0550141818788267842== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Wed, 12 May 2010 19:51:24 +0300 >>>>>> "Michael" == Michael Snoyman wrote: Michael> The first three tutorials are properly commented; the last two Michael> are mostly just code. I have not ported over any of my Michael> open-source web apps to Yesod 0.2 yet, so most complex Michael> examples are not available at the moment. OK. We're waiting for bloggy. ;) Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- --===============0550141818788267842== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuNC4xMCAoR05V L0xpbnV4KQoKaUVZRUFSRUNBQVlGQWt2cTZ2UUFDZ2tRVThlRThmbHY5ZmFEekFDZUlZMnlqcEky UStDUUhGYmdzUm9vZW1QYQo0RGdBbjNhdERqTVgwVnlBVFhDaDNVRFV6KzJBNzM1Lwo9dlZsZAot LS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============0550141818788267842==-- From asviraspossible@gmail.com Wed May 12 14:23:36 2010 From: Victor Nazarov To: web-devel@haskell.org Subject: Re: [web-devel] Call for comments: Yesod 0.2 Date: Wed, 12 May 2010 22:57:08 +0400 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8348101666626415706==" --===============8348101666626415706== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit On Wed, May 12, 2010 at 5:46 PM, Michael Snoyman wrote: > Hi all, > I believe my 0.2 branch of Yesod[1] is feature-complete for this release, > and it seems to be fairly stable. The documentation on it[2] give a good > introduction, and hopefully the haddocks will fill in the gaps. > At this point, I wanted to ask the community if they have any changes they'd > like to see in this release. I'm planning on releasing some time next week. > The main feature which is still prominently missing for this release is a > persistence layer; hopefully that will be included in the next major > release. If anyone has any ideas on this, I'm all ears. > Thanks, > Michael > [1] http://github.com/snoyberg/yesod/tree/ver0.2 > [2] http://docs.yesodweb.com/yesod/ > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > > Following current Yesod design my wishlist is the follwing. 1. Get read of quasy quotation in URL definition. Instead define a Haskell embedded DSL like happstack's url handling but run it from template haskell like this: First define application routes: module Routes where import Yesod.Routing routes = routingAlternatives [ dir '/' 'Home' // methodGet , dir 'entry' 'Entry' // entriesResources ] entriesResources = routingAlternatives [ placeholder `String 'WithSlug' 'entrySlug' // entryResources , dir '/' 'Index' // methodGet , dir 'new' 'New' // methodGet , dir 'create' 'Create' // methodPost ] entryResources = routingAlternatives [ dir '/' 'Show' // methodGet , dir 'edit' 'Edit' // methodGet , dir 'update' 'Update' // methodPut , dir '/' 'Destroy' // methodDelete ] now in my application just call this function: module Main where import Yesod.Routing import Routes $(mkResources 'MyResources' routes) {- Is the same as -- data structure name is the second parameter of mkResources data MyResources = -- constructor names are concatenation of dir parameters Home | EntryShow String | EntryEdit String | EntryUpdate String | EntryDestroy String | EntryIndex | EntryNew | EntryCreate instance ReadUrl MyResources where ... instance ShowUrl MyResources where ... -} Second wish is to automatically generate datatype for view. Something like this $(defineTemplate 'ShowEntryView' [$hamlet| [$hamlet| !!! %html %head %title $templateTitle$ %body %h1 Yesod Sample Blog %h2 $templateTitle$ %ul#nav $forall templateNavbar nav %li %a!href=@navUrl.nav@ $navTitle.nav$ #content $templateContent$ |]) {- is the same like writing data ShowEntryView = ShowEntryView { templateTitle :: forall a. HtmlContent a => a , templateNavbar :: [ShowEntryViewTemplateNavbar] , templateContent :: forall a. HtmlContent a => a } data ShowEntryViewTemplateNavbar = ShowEntryViewTemplateNavbar { navUrl :: forall a. ShowUrl a => a , navTitle :: forall a. HtmlContent a => a } instance HtmlContent ShowEntryView where ... -} So template is just a datatype and I just render it in controller method. --===============8348101666626415706==-- From michael@snoyman.com Thu May 13 06:07:31 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: [web-devel] Re: Call for comments: Yesod 0.2 Date: Thu, 13 May 2010 13:41:04 +0300 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8051510923485323517==" --===============8051510923485323517== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Just a little heads-up: one small but very important change *will* be sneaking into this release of Yesod after all. You'll be able to define URL datatypes with more than just String and Integer components. The blog post describing it is: http://www.snoyman.com/blog/entry/really-type-safe-urls/ This is a change to the underlying web-routes-quasi library; Jeremy, I believe you asked for exactly this feature a bit ago. Michael On Wed, May 12, 2010 at 4:46 PM, Michael Snoyman wrote: > Hi all, > > I believe my 0.2 branch of Yesod[1] is feature-complete for this release, > and it seems to be fairly stable. The documentation on it[2] give a good > introduction, and hopefully the haddocks will fill in the gaps. > > At this point, I wanted to ask the community if they have any changes > they'd like to see in this release. I'm planning on releasing some time next > week. > > The main feature which is still prominently missing for this release is a > persistence layer; hopefully that will be included in the next major > release. If anyone has any ideas on this, I'm all ears. > > Thanks, > Michael > > [1] http://github.com/snoyberg/yesod/tree/ver0.2 > [2] http://docs.yesodweb.com/yesod/ > --===============8051510923485323517== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+SnVzdCBhIGxpdHRsZSBoZWFkcy11cDogb25lIHNtYWxsIGJ1dCB2ZXJ5 IGltcG9ydGFudCBjaGFuZ2UgKndpbGwqIGJlIHNuZWFraW5nIGludG8gdGhpcyByZWxlYXNlIG9m IFllc29kIGFmdGVyIGFsbC4gWW91JiMzOTtsbCBiZSBhYmxlIHRvIGRlZmluZSBVUkwgZGF0YXR5 cGVzIHdpdGggbW9yZSB0aGFuIGp1c3QgU3RyaW5nIGFuZCBJbnRlZ2VyIGNvbXBvbmVudHMuIFRo ZSBibG9nIHBvc3QgZGVzY3JpYmluZyBpdCBpczrCoDxtZXRhIGh0dHAtZXF1aXY9ImNvbnRlbnQt dHlwZSIgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0PXV0Zi04Ij48YSBocmVmPSJodHRwOi8v d3d3LnNub3ltYW4uY29tL2Jsb2cvZW50cnkvcmVhbGx5LXR5cGUtc2FmZS11cmxzLyI+aHR0cDov L3d3dy5zbm95bWFuLmNvbS9ibG9nL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jwvZGl2Pjxicj48L2Rpdj48L2Rpdj4K --===============8051510923485323517==-- From cmoore@wamboli.com Tue May 18 00:42:27 2010 From: Clint Moore To: web-devel@haskell.org Subject: [web-devel] Web.Encodings + Hack - Not sure what I'm doing wrong. Date: Mon, 17 May 2010 22:16:16 -0700 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4564375258554406539==" --===============4564375258554406539== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The project that I'm working on requires user image galleries. The idea is to allow them to upload images via a form, do some rudimentary processing on the uploaded data and then send it directly to Amazon's S3 service. The problem that I'm running in to is that I can't seem to get the binary data from the post request correctly. When written out to disk with withBinaryFile (hopefully thereby bypassing the new encoding pitfalls in ghc 6.12.x), file(1) says it's 'data'. This seems to be happening if I push it to a new object on S3 as well. I'm secretly hoping I'm doing something obviously wrong here. The code in question is at http://gist.github.com/404636 . Hopefully it's obvious that it's way more frantic what-the-hell-is-going-on-here code than some crackpot's idea of production ready code :) Thanks, web-devel! --===============4564375258554406539==-- From michael@snoyman.com Tue May 18 01:15:09 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Web.Encodings + Hack - Not sure what I'm doing wrong. Date: Tue, 18 May 2010 08:48:57 +0300 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0118218239290683595==" --===============0118218239290683595== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Tue, May 18, 2010 at 8:16 AM, Clint Moore wrote: > The project that I'm working on requires user image galleries. The > idea is to allow them to upload images via a form, do some rudimentary > processing on the uploaded data and then send it directly to Amazon's > S3 service. The problem that I'm running in to is that I can't seem > to get the binary data from the post request correctly. When written > out to disk with withBinaryFile (hopefully thereby bypassing the new > encoding pitfalls in ghc 6.12.x), file(1) says it's 'data'. This > seems to be happening if I push it to a new object on S3 as well. > > I'm secretly hoping I'm doing something obviously wrong here. > > The code in question is at http://gist.github.com/404636 . Hopefully > it's obvious that it's way more frantic what-the-hell-is-going-on-here > code than some crackpot's idea of production ready code :) > > Thanks, web-devel! > Clint, Firstly, would it be possible to modify your gist so that it's runnable on it's own? It's hard to debug what I can't see first hand. Secondly, I'm not certain I understand what you're saying the problem is. You mean that the file contents are simply "data"? Michael --===============0118218239290683595== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gVHVlLCBN YXkgMTgsIDIwMTAgYXQgODoxNiBBTSwgQ2xpbnQgTW9vcmUgPHNwYW4gZGlyPSJsdHIiPiZsdDs8 YSBocmVmPSJtYWlsdG86Y21vb3JlQHdhbWJvbGkuY29tIj5jbW9vcmVAd2FtYm9saS5jb208L2E+ Jmd0Ozwvc3Bhbj4gd3JvdGU6PGJyPjxibG9ja3F1b3RlIGNsYXNzPSJnbWFpbF9xdW90ZSIgc3R5 bGU9Im1hcmdpbjowIDAgMCAuOGV4O2JvcmRlci1sZWZ0OjFweCAjY2NjIHNvbGlkO3BhZGRpbmct bGVmdDoxZXg7Ij4KVGhlIHByb2plY3QgdGhhdCBJJiMzOTttIHdvcmtpbmcgb24gcmVxdWlyZXMg dXNlciBpbWFnZSBnYWxsZXJpZXMuIMKgVGhlPGJyPgppZGVhIGlzIHRvIGFsbG93IHRoZW0gdG8g dXBsb2FkIGltYWdlcyB2aWEgYSBmb3JtLCBkbyBzb21lIHJ1ZGltZW50YXJ5PGJyPgpwcm9jZXNz aW5nIG9uIHRoZSB1cGxvYWRlZCBkYXRhIGFuZCB0aGVuIHNlbmQgaXQgZGlyZWN0bHkgdG8gQW1h em9uJiMzOTtzPGJyPgpTMyBzZXJ2aWNlLiDCoFRoZSBwcm9ibGVtIHRoYXQgSSYjMzk7bSBydW5u aW5nIGluIHRvIGlzIHRoYXQgSSBjYW4mIzM5O3Qgc2VlbTxicj4KdG8gZ2V0IHRo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bW9kaWZ5IHlvdXIgZ2lzdCBzbyB0 aGF0IGl0JiMzOTtzIHJ1bm5hYmxlIG9uIGl0JiMzOTtzIG93bj8gSXQmIzM5O3MgaGFyZCB0byBk ZWJ1ZyB3aGF0IEkgY2FuJiMzOTt0IHNlZSBmaXJzdCBoYW5kLjwvZGl2Pgo8ZGl2Pjxicj48L2Rp dj48ZGl2PlNlY29uZGx5LCBJJiMzOTttIG5vdCBjZXJ0YWluIEkgdW5kZXJzdGFuZCB3aGF0IHlv dSYjMzk7cmUgc2F5aW5nIHRoZSBwcm9ibGVtIGlzLiBZb3UgbWVhbiB0aGF0IHRoZSBmaWxlIGNv bnRlbnRzIGFyZSBzaW1wbHkgJnF1b3Q7ZGF0YSZxdW90Oz88L2Rpdj48ZGl2Pjxicj48L2Rpdj48 ZGl2Pk1pY2hhZWzCoDwvZGl2PjwvZGl2PjwvZGl2Pgo= --===============0118218239290683595==-- From cmoore@wamboli.com Tue May 18 01:56:08 2010 From: Clint Moore To: web-devel@haskell.org Subject: Re: [web-devel] Web.Encodings + Hack - Not sure what I'm doing wrong. Date: Mon, 17 May 2010 23:29:56 -0700 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4473207702496605998==" --===============4473207702496605998== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, May 17, 2010 at 10:48 PM, Michael Snoyman wrote: > Clint, > Firstly, would it be possible to modify your gist so that it's runnable on > it's own? It's hard to debug what I can't see first hand. > Secondly, I'm not certain I understand what you're saying the problem is. > You mean that the file contents are simply "data"? > Michael I was referring to the file command on most unix-es to determine the file type by the magic number. Here's a better explanation: a.png is the original image, and b.png is what I get back from the upload process. $ file a.png b.png a.png: PNG image, 42 x 36, 8-bit colormap, non-interlaced b.png: data $ ls -l a.png b.png -rw-r--r-- 1 cmoore cmoore 611 2010-05-17 23:01 a.png -rw-r--r-- 1 cmoore cmoore 1020 2010-05-17 23:01 b.png $ md5sum a.png b.png 0116a68ff260fcce936b9a60c28a34d7 a.png 46e0b264fb5ab73aa2dfe8f3d40241c7 b.png As far as making the code runnable, I can do that perhaps tomorrow. I'd love to just tar up the code, or push it to github or somesuch, but it's not mine. If I can't figure it out by then I'll write a one-off that demonstrates the problem and put it up. In the hope that it spurs someone's 'oh yea, I remember that, you have to x when you y!' memory, here's what I know about the problem: I know that 1. It's almost certainly not the form used to submit the data because 2. The example file upload script on the haskell wiki works. This is what led me to assume that it wasn't a problem with encoding in ghc 6.12, but now I'm not so sure due to the differences in the file size above. I feel compelled to point out that, as far as the data of the file is concerned, I'm not transforming it (at least my naive Haskell knowledge tels me I'm not). Whether I am writing it out to a file, or pushing it to s3, I'm still getting it from parseMultipart, and then from fileContent. That said, it doesn't make sense that the problem would be web.encodings. It's obviously being used, and more importantly, working in other places. It just seems like the places I could be making a mistake are rather few. Which, hehe, again points to an encoding issue. Thanks again for the help, and I will post it up tomorrow if I still haven't figured it out. --===============4473207702496605998==-- From bulat.ziganshin@gmail.com Tue May 18 02:37:00 2010 From: Bulat Ziganshin To: web-devel@haskell.org Subject: Re[2]: [web-devel] Web.Encodings + Hack - Not sure what I'm doing wrong. Date: Tue, 18 May 2010 11:10:35 +0400 Message-ID: <1192663433.20100518111035@gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7899736924597008310==" --===============7899736924597008310== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hello Clint, Tuesday, May 18, 2010, 10:29:56 AM, you wrote: > $ ls -l a.png b.png > -rw-r--r-- 1 cmoore cmoore 611 2010-05-17 23:01 a.png > -rw-r--r-- 1 cmoore cmoore 1020 2010-05-17 23:01 b.png "od ?.png|head -5" ? it seems like utf8 encoding :)) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com --===============7899736924597008310==-- From cmoore@wamboli.com Tue May 18 02:41:11 2010 From: Clint Moore To: web-devel@haskell.org Subject: Re: Re[2]: [web-devel] Web.Encodings + Hack - Not sure what I'm doing wrong. Date: Tue, 18 May 2010 00:15:00 -0700 Message-ID: In-Reply-To: <1192663433.20100518111035@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6531364887806772099==" --===============6531364887806772099== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit On Tue, May 18, 2010 at 12:10 AM, Bulat Ziganshin wrote: > Hello Clint, > > Tuesday, May 18, 2010, 10:29:56 AM, you wrote: >> $ ls -l a.png b.png >> -rw-r--r-- 1 cmoore cmoore  611 2010-05-17 23:01 a.png >> -rw-r--r-- 1 cmoore cmoore 1020 2010-05-17 23:01 b.png > > "od ?.png|head -5" ? > > it seems like utf8 encoding :)) $ od ?.png | head -5 0000000 050211 043516 005015 005032 000000 006400 044111 051104 0000020 000000 025000 000000 022000 001410 000000 144000 054027 0000040 000031 000400 050005 052114 177505 177777 122244 167244 0000060 021200 177376 176376 176374 143306 163706 163747 126655 0000100 165255 165352 171362 175362 175372 122645 176645 176775 I didn't know od existed. Thanks for that! --===============6531364887806772099==-- From michael@snoyman.com Tue May 18 02:50:40 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Web.Encodings + Hack - Not sure what I'm doing wrong. Date: Tue, 18 May 2010 10:18:08 +0300 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1225725205782532094==" --===============1225725205782532094== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Tue, May 18, 2010 at 9:29 AM, Clint Moore wrote: > On Mon, May 17, 2010 at 10:48 PM, Michael Snoyman > wrote: > > Clint, > > Firstly, would it be possible to modify your gist so that it's runnable > on > > it's own? It's hard to debug what I can't see first hand. > > Secondly, I'm not certain I understand what you're saying the problem is. > > You mean that the file contents are simply "data"? > > Michael > > I was referring to the file command on most unix-es to determine the > file type by the magic number. Here's a better explanation: > > a.png is the original image, and b.png is what I get back from the > upload process. > > $ file a.png b.png > a.png: PNG image, 42 x 36, 8-bit colormap, non-interlaced > b.png: data > $ ls -l a.png b.png > -rw-r--r-- 1 cmoore cmoore 611 2010-05-17 23:01 a.png > -rw-r--r-- 1 cmoore cmoore 1020 2010-05-17 23:01 b.png > $ md5sum a.png b.png > 0116a68ff260fcce936b9a60c28a34d7 a.png > 46e0b264fb5ab73aa2dfe8f3d40241c7 b.png > > > As far as making the code runnable, I can do that perhaps tomorrow. > I'd love to just tar up the code, or push it to github or somesuch, > but it's not mine. If I can't figure it out by then I'll write a > one-off that demonstrates the problem and put it up. > > In the hope that it spurs someone's 'oh yea, I remember that, you have > to x when you y!' memory, here's what I know about the problem: I know > that 1. It's almost certainly not the form used to submit the data > because 2. The example file upload script on the haskell wiki works. > This is what led me to assume that it wasn't a problem with encoding > in ghc 6.12, but now I'm not so sure due to the differences in the > file size above. > > I feel compelled to point out that, as far as the data of the file is > concerned, I'm not transforming it (at least my naive Haskell > knowledge tels me I'm not). Whether I am writing it out to a file, or > pushing it to s3, I'm still getting it from parseMultipart, and then > from fileContent. > > That said, it doesn't make sense that the problem would be > web.encodings. It's obviously being used, and more importantly, > working in other places. It just seems like the places I could be > making a mistake are rather few. Which, hehe, again points to an > encoding issue. > > Thanks again for the help, and I will post it up tomorrow if I still > haven't figured it out. > Sounds like Bulat already solved the problem... but here's a sample of using web-encodings. I recommend using parsePost instead of parseMultipart. Michael --===============1225725205782532094== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gVHVlLCBN YXkgMTgsIDIwMTAgYXQgOToyOSBBTSwgQ2xpbnQgTW9vcmUgPHNwYW4gZGlyPSJsdHIiPiZsdDs8 YSBocmVmPSJtYWlsdG86Y21vb3JlQHdhbWJvbGkuY29tIj5jbW9vcmVAd2FtYm9saS5jb208L2E+ Jmd0Ozwvc3Bhbj4gd3JvdGU6PGJyPjxibG9ja3F1b3RlIGN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k7 dCBtYWtlIHNlbnNlIHRoYXQgdGhlIHByb2JsZW0gd291bGQgYmU8YnI+CndlYi5lbmNvZGluZ3Mu IMKgSXQmIzM5O3Mgb2J2aW91c2x5IGJlaW5nIHVzZWQsIGFuZCBtb3JlIGltcG9ydGFudGx5LDxi cj4Kd29ya2luZyBpbiBvdGhlciBwbGFjZXMuIMKgSXQganVzdCBzZWVtcyBsaWtlIHRoZSBwbGFj ZXMgSSBjb3VsZCBiZTxicj4KbWFraW5nIGEgbWlzdGFrZSBhcmUgcmF0aGVyIGZldy4gwqBXaGlj aCwgaGVoZSwgYWdhaW4gcG9pbnRzIHRvIGFuPGJyPgplbmNvZGluZyBpc3N1ZS48YnI+Cjxicj4K VGhhbmtzIGFnYWluIGZvciB0aGUgaGVscCwgYW5kIEkgd2lsbCBwb3N0IGl0IHVwIHRvbW9ycm93 IGlmIEkgc3RpbGw8YnI+CmhhdmVuJiMzOTt0IGZpZ3VyZWQgaXQgb3V0Ljxicj4KPC9ibG9ja3F1 b3RlPjwvZGl2Pjxicj48ZGl2PlNvdW5kcyBsaWtlIEJ1bGF0IGFscmVhZHkgc29sdmVkIHRoZSBw cm9ibGVtLi4uIGJ1dCBoZXJlJiMzOTtzIGEgc2FtcGxlIG9mIHVzaW5nIHdlYi1lbmNvZGluZ3Mu IEkgcmVjb21tZW5kIHVzaW5nIHBhcnNlUG9zdCBpbnN0ZWFkIG9mIHBhcnNlTXVsdGlwYXJ0Ljwv ZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+TWljaGFlbDwvZGl2PjwvZGl2Pgo= --===============1225725205782532094== Content-Type: text/x-haskell Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="form-data.hs" MIME-Version: 1.0 aW1wb3J0IEhhY2sKaW1wb3J0IFdlYi5FbmNvZGluZ3MKaW1wb3J0IEhhY2suSGFuZGxlci5TaW1w bGVTZXJ2ZXIKaW1wb3J0IHF1YWxpZmllZCBEYXRhLkJ5dGVTdHJpbmcuTGF6eS5DaGFyOCBhcyBM CmltcG9ydCBEYXRhLk1heWJlCgptYWluID0gcnVuIDMwMDAgYXBwCgphcHAgZW52ID0KICAgIGNh c2UgcGF0aEluZm8gZW52IG9mCiAgICAgICAgIi8iIC0+IHJldHVybiAkIFJlc3BvbnNlIDIwMCBb KCJDb250ZW50LVR5cGUiLCAidGV4dC9odG1sIildICQKICAgICAgICAgICAgICAgIEwucGFjayAk IGNvbmNhdAogICAgICAgICAgICAgICAgICAgIFsgIjxmb3JtIG1ldGhvZD0ncG9zdCcgYWN0aW9u PScvdXBsb2FkJyAiCiAgICAgICAgICAgICAgICAgICAgLCAiZW5jdHlwZT0nbXVsdGlwYXJ0L2Zv cm0tZGF0YSc+IgogICAgICAgICAgICAgICAgICAgICwgIjxpbnB1dCB0eXBlPSdmaWxlJyBuYW1l PSdmaWxlJz4iCiAgICAgICAgICAgICAgICAgICAgLCAiPGlucHV0IHR5cGU9J3N1Ym1pdD4iCiAg ICAgICAgICAgICAgICAgICAgLCAiPC9mb3JtPiIKICAgICAgICAgICAgICAgICAgICBdCiAgICAg ICAgIi91cGxvYWQiIC0+IGRvCiAgICAgICAgICAgIGxldCBjdCA9IGZyb21KdXN0ICQgbG9va3Vw ICJDb250ZW50LVR5cGUiICQgaHR0cCBlbnYKICAgICAgICAgICAgbGV0IGNsID0gZnJvbUp1c3Qg JCBsb29rdXAgIkNvbnRlbnQtTGVuZ3RoIiAkIGh0dHAgZW52CiAgICAgICAgICAgIGxldCAoXywg WyhfLCBGaWxlSW5mbyBfIGN0JyBjb250ZW50KV0pID0KICAgICAgICAgICAgICAgICAgICBwYXJz ZVBvc3QgY3QgY2wgJCBoYWNrSW5wdXQgZW52CiAgICAgICAgICAgIGxldCBmaWxlbmFtZSA9ICJ0 ZXN0Lm91dHB1dCIKICAgICAgICAgICAgTC53cml0ZUZpbGUgZmlsZW5hbWUgY29udGVudAogICAg ICAgICAgICBsZXQgY3QnJyA9IEwudW5wYWNrIGN0JwogICAgICAgICAgICBSZXNwb25zZSAyMDAg WygiQ29udGVudC1UeXBlIiwgY3QnJyldIGBmbWFwYCBMLnJlYWRGaWxlIGZpbGVuYW1lCg== --===============1225725205782532094==-- From cmoore@wamboli.com Tue May 18 03:43:39 2010 From: Clint Moore To: web-devel@haskell.org Subject: Re: [web-devel] Web.Encodings + Hack - Not sure what I'm doing wrong. Date: Tue, 18 May 2010 01:17:27 -0700 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1905597719248289689==" --===============1905597719248289689== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Tue, May 18, 2010 at 12:18 AM, Michael Snoyman wrote: > Sounds like Bulat already solved the problem... but here's a sample of using > web-encodings. I recommend using parsePost instead of parseMultipart. Well, at least I'm not completely crazy - same thing happens with that code too. Time to start digging around to find out how to fix the encoding issue. Thanks again for your help, Michael and Bulat! --===============1905597719248289689==-- From michael@snoyman.com Tue May 18 03:55:11 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Web.Encodings + Hack - Not sure what I'm doing wrong. Date: Tue, 18 May 2010 11:28:59 +0300 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7915635083402534602==" --===============7915635083402534602== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Tue, May 18, 2010 at 11:17 AM, Clint Moore wrote: > On Tue, May 18, 2010 at 12:18 AM, Michael Snoyman > wrote: > > Sounds like Bulat already solved the problem... but here's a sample of > using > > web-encodings. I recommend using parsePost instead of parseMultipart. > > Well, at least I'm not completely crazy - same thing happens with that > code too. Time to start digging around to find out how to fix the > encoding issue. > > Thanks again for your help, Michael and Bulat! > A few questions (this might still be my fault): * What operating system are you working on? * Which version of GHC? * What hack handler is your original code using? I'm worried that hack-handler-simpleserver might not be working properly on Windows due to encoding issues. I just booted up my Windows virtual machine and am downloading Haskell (I usually only use it for testing sites in IE). Michael --===============7915635083402534602== Content-Type: text/html Content-Trans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RvIGZpeCB0aGU8YnI+CmVuY29kaW5nIGlzc3VlLjxicj4KPGJy PgpUaGFua3MgYWdhaW4gZm9yIHlvdXIgaGVscCwgTWljaGFlbCBhbmQgQnVsYXQhPGJyPgo8L2Js b2NrcXVvdGU+PC9kaXY+PGJyPjxkaXY+QSBmZXcgcXVlc3Rpb25zICh0aGlzIG1pZ2h0IHN0aWxs IGJlIG15IGZhdWx0KTo8L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PiogV2hhdCBvcGVyYXRpbmcg c3lzdGVtIGFyZSB5b3Ugd29ya2luZyBvbj88L2Rpdj48ZGl2PiogV2hpY2ggdmVyc2lvbiBvZiBH SEM/PC9kaXY+PGRpdj4qIFdoYXQgaGFjayBoYW5kbGVyIGlzIHlvdXIgb3JpZ2luYWwgY29kZSB1 c2luZz88L2Rpdj4KPGRpdj48YnI+PC9kaXY+PGRpdj5JJiMzOTttIHdvcnJpZWQgdGhhdCBoYWNr LWhhbmRsZXItc2ltcGxlc2VydmVyIG1pZ2h0IG5vdCBiZSB3b3JraW5nIHByb3Blcmx5IG9uIFdp bmRvd3MgZHVlIHRvIGVuY29kaW5nIGlzc3Vlcy4gSSBqdXN0IGJvb3RlZCB1cCBteSBXaW5kb3dz IHZpcnR1YWwgbWFjaGluZSBhbmQgYW0gZG93bmxvYWRpbmcgSGFza2VsbCAoSSB1c3VhbGx5IG9u bHkgdXNlIGl0IGZvciB0ZXN0aW5nIHNpdGVzIGluIElFKS48L2Rpdj4KPGRpdj48YnI+PC9kaXY+ PGRpdj5NaWNoYWVsPC9kaXY+PC9kaXY+Cg== --===============7915635083402534602==-- From cmoore@wamboli.com Tue May 18 03:58:57 2010 From: Clint Moore To: web-devel@haskell.org Subject: Re: [web-devel] Web.Encodings + Hack - Not sure what I'm doing wrong. Date: Tue, 18 May 2010 01:32:46 -0700 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3117748411908835866==" --===============3117748411908835866== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Tue, May 18, 2010 at 1:28 AM, Michael Snoyman wrote: > A few questions (this might still be my fault): > * What operating system are you working on? ubuntu 10.4 > * Which version of GHC? 6.12.2 from the GHC site. > * What hack handler is your original code using? Epoll I had to switch to that for the example code as well - for some reason, simpleserver wasn't replying to requests. I went as far as to telnet to the port and make a request for / and didn't get anything back. telnet localhost 3000 -> GET / and a few more s for good measure :) Maybe I should try h-h-happstack and see if that changes anything. > I'm worried that hack-handler-simpleserver might not be working properly on > Windows due to encoding issues. I just booted up my Windows virtual machine > and am downloading Haskell (I usually only use it for testing sites in IE). > Michael --===============3117748411908835866==-- From cmoore@wamboli.com Tue May 18 04:15:57 2010 From: Clint Moore To: web-devel@haskell.org Subject: Re: [web-devel] Web.Encodings + Hack - Not sure what I'm doing wrong. Date: Tue, 18 May 2010 01:49:45 -0700 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3872151023898359011==" --===============3872151023898359011== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Tue, May 18, 2010 at 1:32 AM, Clint Moore wrote: > On Tue, May 18, 2010 at 1:28 AM, Michael Snoyman wrot= e: >> A few questions (this might still be my fault): > >> * What operating system are you working on? > ubuntu 10.4 > >> * Which version of GHC? > 6.12.2 from the GHC site. > >> * What hack handler is your original code using? > Epoll > > I had to switch to that for the example code as well - for some > reason, simpleserver wasn't replying to requests. =C2=A0I went as far as to > telnet to the port and make a request for / and didn't get anything > back. =C2=A0telnet localhost 3000 -> GET / and a few more > s for good measure :) > > Maybe I should try h-h-happstack and see if that changes anything. > >> I'm worried that hack-handler-simpleserver might not be working properly on >> Windows due to encoding issues. I just booted up my Windows virtual machine >> and am downloading Haskell (I usually only use it for testing sites in IE). >> Michael > That was it. It works using hack-handler-happstack! Yay, now I can make my deadline. Thanks once again for all of your help! -cm --===============3872151023898359011==-- From michael@snoyman.com Tue May 18 04:49:37 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Web.Encodings + Hack - Not sure what I'm doing wrong. Date: Tue, 18 May 2010 12:23:26 +0300 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2714121928483570557==" --===============2714121928483570557== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Tue, May 18, 2010 at 11:49 AM, Clint Moore wrote: > On Tue, May 18, 2010 at 1:32 AM, Clint Moore wrote: > > On Tue, May 18, 2010 at 1:28 AM, Michael Snoyman > wrote: > >> A few questions (this might still be my fault): > > > >> * What operating system are you working on? > > ubuntu 10.4 > > > >> * Which version of GHC? > > 6.12.2 from the GHC site. > > > >> * What hack handler is your original code using? > > Epoll > > > > I had to switch to that for the example code as well - for some > > reason, simpleserver wasn't replying to requests. I went as far as to > > telnet to the port and make a request for / and didn't get anything > > back. telnet localhost 3000 -> GET / and a few more > > s for good measure :) > > > > Maybe I should try h-h-happstack and see if that changes anything. > > > >> I'm worried that hack-handler-simpleserver might not be working properly > on > >> Windows due to encoding issues. I just booted up my Windows virtual > machine > >> and am downloading Haskell (I usually only use it for testing sites in > IE). > >> Michael > > > > That was it. It works using hack-handler-happstack! > > Yay, now I can make my deadline. Thanks once again for all of your help! > > -cm > Sure. I'd write a bug report to the epoll author. Funny thing about simpleserver not responding, I wonder why... Michael --===============2714121928483570557== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gVHVlLCBN YXkgMTgsIDIwMTAgYXQgMTE6NDkgQU0sIENsaW50IE1vb3JlIDxzcGFuIGRpcj0ibHRyIj4mbHQ7 PGEgaHJlZj0ibWFpbHRvOmNtb29yZUB3YW1ib2xpLmNvbSI+Y21vb3JlQHdhbWJvbGkuY29tPC9h PiZndDs8L3NwYW4+IHdyb3RlOjxicj48YmxvY2txdW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W4gbWFrZSBteSBkZWFkbGluZS4gwqBUaGFua3Mgb25jZSBhZ2FpbiBmb3IgYWxsIG9m IHlvdXIgaGVscCE8YnI+Cjxmb250IGNvbG9yPSIjODg4ODg4Ij48YnI+Ci1jbTxicj4KPC9mb250 PjwvYmxvY2txdW90ZT48L2Rpdj48YnI+PGRpdj5TdXJlLiBJJiMzOTtkIHdyaXRlIGEgYnVnIHJl cG9ydCB0byB0aGUgZXBvbGwgYXV0aG9yLiBGdW5ueSB0aGluZyBhYm91dCBzaW1wbGVzZXJ2ZXIg bm90IHJlc3BvbmRpbmcsIEkgd29uZGVyIHdoeS4uLjwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+ TWljaGFlbDwvZGl2PjwvZGl2Pgo= --===============2714121928483570557==-- From james@neurogami.com Fri May 21 23:58:44 2010 From: James Britt To: web-devel@haskell.org Subject: Re: [web-devel] Call for comments: Yesod 0.2 Date: Fri, 21 May 2010 21:32:42 -0700 Message-ID: <4BF75E6A.6040709@neurogami.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8792225113043442939==" --===============8792225113043442939== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Michael Snoyman wrote: > Hi all, > > I believe my 0.2 branch of Yesod[1] is feature-complete for this > release, and it seems to be fairly stable. The documentation on it[2] > give a good introduction, and hopefully the haddocks will fill in the gaps. james@james06:~/data/vendor/yesod$ runhaskell Setup.lhs configure --user Configuring yesod-0.2.0... Warning: This package indirectly depends on multiple versions of the same package. This is highly likely to cause a compile failure. package http-wget-0.6.2 requires transformers-0.1.4.0 package control-monad-attempt-0.3.0 requires transformers-0.1.4.0 package authenticate-0.6.2 requires transformers-0.1.4.0 package yesod-0.2.0 requires transformers-0.2.1.0 package MonadCatchIO-transformers-0.2.2.0 requires transformers-0.2.1.0 $ghc --version The Glorious Glasgow Haskell Compilation System, version 6.12.1 This on Ubuntu 8.04 Running $ runhaskell Setup.lhs build fails: [12 of 14] Compiling Yesod.Helpers.Auth ( Yesod/Helpers/Auth.hs, dist/build/Yesod/Helpers/Auth.o ) Yesod/Helpers/Auth.hs:187:25: Could not deduce (transformers-0.1.4.0:Control.Monad.Trans.MonadIO (GHandler Auth master)) from the context () arising from a use of `OpenId.getForwardUrl' at Yesod/Helpers/Auth.hs:187:25-57 Possible fix: add (transformers-0.1.4.0:Control.Monad.Trans.MonadIO (GHandler Auth master)) to the context of the type signature for `getOpenIdForward' or add an instance declaration for (transformers-0.1.4.0:Control.Monad.Trans.MonadIO (GHandler Auth master)) In the second argument of `($)', namely `OpenId.getForwardUrl oid complete' In a stmt of a 'do' expression: res <- runAttemptT $ OpenId.getForwardUrl oid complete In the expression: do { testOpenId; rr <- getRequest; oid <- case getParams rr "openid" of { [x] -> return x _ -> invalidArgs [...] }; render <- getUrlRender; .... } Yesod/Helpers/Auth.hs:200:25: Could not deduce (transformers-0.1.4.0:Control.Monad.Trans.MonadIO (GHandler Auth master)) from the context (YesodAuth master) arising from a use of `OpenId.authenticate' at Yesod/Helpers/Auth.hs:200:25-49 Possible fix: add (transformers-0.1.4.0:Control.Monad.Trans.MonadIO (GHandler Auth master)) to the context of the type signature for `getOpenIdComplete' or add an instance declaration for (transformers-0.1.4.0:Control.Monad.Trans.MonadIO (GHandler Auth master)) In the second argument of `($)', namely `OpenId.authenticate gets'' In a stmt of a 'do' expression: res <- runAttemptT $ OpenId.authenticate gets' In the expression: do { testOpenId; rr <- getRequest; let gets' = reqGetParams rr; res <- runAttemptT $ OpenId.authenticate gets'; .... } Suggestions? Thanks, James -- Neurogami - Smart application development http://www.neurogami.com james@neurogami.com --===============8792225113043442939==-- From michael@snoyman.com Sat May 22 13:08:50 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Call for comments: Yesod 0.2 Date: Sat, 22 May 2010 20:42:51 +0300 Message-ID: In-Reply-To: <4BF75E6A.6040709@neurogami.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6492622690794736363==" --===============6492622690794736363== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sorry, things are still in a little bit of flux as I change underlying libraries. The only suggestion I've got is to retry with a "git pull && cabal update && cabal install". When the final version is actually released, it will be well-tested first. Note: right now it depends on web-routes-quasi 0.3.0, which has not yet been released, so you'll have to pull that from the github repo. Michael On Sat, May 22, 2010 at 7:32 AM, James Britt wrote: > Michael Snoyman wrote: > >> Hi all, >> >> I believe my 0.2 branch of Yesod[1] is feature-complete for this release, >> and it seems to be fairly stable. The documentation on it[2] give a good >> introduction, and hopefully the haddocks will fill in the gaps. >> > > james@james06:~/data/vendor/yesod$ runhaskell Setup.lhs configure --user > Configuring yesod-0.2.0... > Warning: This package indirectly depends on multiple versions of the same > package. This is highly likely to cause a compile failure. > package http-wget-0.6.2 requires transformers-0.1.4.0 > package control-monad-attempt-0.3.0 requires transformers-0.1.4.0 > package authenticate-0.6.2 requires transformers-0.1.4.0 > package yesod-0.2.0 requires transformers-0.2.1.0 > package MonadCatchIO-transformers-0.2.2.0 requires transformers-0.2.1.0 > > > $ghc --version > The Glorious Glasgow Haskell Compilation System, version 6.12.1 > > This on Ubuntu 8.04 > > > > Running > > $ runhaskell Setup.lhs build > > fails: > > > [12 of 14] Compiling Yesod.Helpers.Auth ( Yesod/Helpers/Auth.hs, > dist/build/Yesod/Helpers/Auth.o ) > > Yesod/Helpers/Auth.hs:187:25: > Could not deduce (transformers-0.1.4.0:Control.Monad.Trans.MonadIO > (GHandler Auth master)) > from the context () > arising from a use of `OpenId.getForwardUrl' > at Yesod/Helpers/Auth.hs:187:25-57 > Possible fix: > add (transformers-0.1.4.0:Control.Monad.Trans.MonadIO > (GHandler Auth master)) to the context of > the type signature for `getOpenIdForward' > or add an instance declaration for > (transformers-0.1.4.0:Control.Monad.Trans.MonadIO > (GHandler Auth master)) > In the second argument of `($)', namely > `OpenId.getForwardUrl oid complete' > In a stmt of a 'do' expression: > res <- runAttemptT $ OpenId.getForwardUrl oid complete > In the expression: > do { testOpenId; > rr <- getRequest; > oid <- case getParams rr "openid" of { > [x] -> return x > _ -> invalidArgs [...] }; > render <- getUrlRender; > .... } > > Yesod/Helpers/Auth.hs:200:25: > Could not deduce (transformers-0.1.4.0:Control.Monad.Trans.MonadIO > (GHandler Auth master)) > from the context (YesodAuth master) > arising from a use of `OpenId.authenticate' > at Yesod/Helpers/Auth.hs:200:25-49 > Possible fix: > add (transformers-0.1.4.0:Control.Monad.Trans.MonadIO > (GHandler Auth master)) to the context of > the type signature for `getOpenIdComplete' > or add an instance declaration for > (transformers-0.1.4.0:Control.Monad.Trans.MonadIO > (GHandler Auth master)) > In the second argument of `($)', namely `OpenId.authenticate gets'' > In a stmt of a 'do' expression: > res <- runAttemptT $ OpenId.authenticate gets' > In the expression: > do { testOpenId; > rr <- getRequest; > let gets' = reqGetParams rr; > res <- runAttemptT $ OpenId.authenticate gets'; > .... } > > > > Suggestions? > > > Thanks, > > James > > -- > > Neurogami - Smart application development > > http://www.neurogami.com > > james@neurogami.com > > > > > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > --===============6492622690794736363== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+U29ycnksIHRoaW5ncyBhcmUgc3RpbGwgaW4gYSBsaXR0bGUgYml0IG9m IGZsdXggYXMgSSBjaGFuZ2UgdW5kZXJseWluZyBsaWJyYXJpZXMuIFRoZSBvbmx5IHN1Z2dlc3Rp b24gSSYjMzk7dmUgZ290IGlzIHRvIHJldHJ5IHdpdGggYSAmcXVvdDtnaXQgcHVsbCAmYW1wOyZh bXA7IGNhYmFsIHVwZGF0ZSAmYW1wOyZhbXA7IGNhYmFsIGluc3RhbGwmcXVvdDsuIFdoZW4gdGhl IGZpbmFsIHZlcnNpb24gaXMgYWN0dWFsbHkgcmVsZWFzZWQsIGl0IHdpbGwgYmUgd2VsbC10ZXN0 ZWQg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PGJyPgo8YnI+Cjxicj4KX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX188YnI+CndlYi1kZXZlbCBt YWlsaW5nIGxpc3Q8YnI+CjxhIGhyZWY9Im1haWx0bzp3ZWItZGV2ZWxAaGFza2VsbC5vcmciIHRh cmdldD0iX2JsYW5rIj53ZWItZGV2ZWxAaGFza2VsbC5vcmc8L2E+PGJyPgo8YSBocmVmPSJodHRw Oi8vd3d3Lmhhc2tlbGwub3JnL21haWxtYW4vbGlzdGluZm8vd2ViLWRldmVsIiB0YXJnZXQ9Il9i bGFuayI+aHR0cDovL3d3dy5oYXNrZWxsLm9yZy9tYWlsbWFuL2xpc3RpbmZvL3dlYi1kZXZlbDwv YT48YnI+CjwvZGl2PjwvZGl2PjwvYmxvY2txdW90ZT48L2Rpdj48YnI+PC9kaXY+PC9kaXY+Cg== --===============6492622690794736363==-- From ariep@xs4all.nl Sat May 22 17:10:46 2010 From: Arie Peterson To: web-devel@haskell.org Subject: Re: [web-devel] Call for comments: Yesod 0.2 Date: Sat, 22 May 2010 23:44:48 +0200 Message-ID: <78ff3cc4771a9c5ee4d798aa332295c2@xs4all.nl> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4849005189466909936==" --===============4849005189466909936== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Sat, 22 May 2010 20:42:51 +0300, Michael Snoyman wrote: > [...] > > Note: right now it depends on web-routes-quasi 0.3.0, which has not yet > been > released, so you'll have to pull that from the github repo. In order to test my proposed solution (see below), I tried building web-routes-quasi 0.3.0 from git, but I get another cabal version conflict failure: | Resolving dependencies... | cabal: cannot configure template-haskell-2.4.0.1. It requires base >=4.2 && <5 | For the dependency on base >=4.2 && <5 there are these packages: base-4.2.0.0 | and base-4.2.0.1. However none of them are available. | base-4.2.0.0 was excluded because of the top level dependency base -any | base-4.2.0.1 was excluded because of the top level dependency base -any I assume this means that it needs ghc 6.12 (which I haven't installed yet). Do you really need template-haskell-2.4.*, or would 2.3.* suffice as well? In that case you could relax the version constraint. > On Sat, May 22, 2010 at 7:32 AM, James Britt wrote: > >> james@james06:~/data/vendor/yesod$ runhaskell Setup.lhs configure --user >> Configuring yesod-0.2.0... >> Warning: This package indirectly depends on multiple versions of the same >> package. This is highly likely to cause a compile failure. >> package http-wget-0.6.2 requires transformers-0.1.4.0 >> package control-monad-attempt-0.3.0 requires transformers-0.1.4.0 >> package authenticate-0.6.2 requires transformers-0.1.4.0 >> package yesod-0.2.0 requires transformers-0.2.1.0 >> package MonadCatchIO-transformers-0.2.2.0 requires transformers-0.2.1.0 >> >> [...] >> >> Suggestions? >From a quick look at the source of yesod, it /seems/ that it may work with MonadCatchIO-transformers-0.1.* as well. Is there any reason yesod asks for >=0.2.2 ? If not, relaxing this version constraint might fix things. Regards, Arie --===============4849005189466909936==-- From michael@snoyman.com Sat May 22 17:19:15 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Call for comments: Yesod 0.2 Date: Sun, 23 May 2010 00:53:17 +0300 Message-ID: In-Reply-To: <78ff3cc4771a9c5ee4d798aa332295c2@xs4all.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0737704376740796897==" --===============0737704376740796897== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Unfortunately, it really does require 6.12. The issue is that we need to automatically generate a type instance for "Routes". While 6.10 supports type instances, it doesn't include that support in the template haskell. If people are interested, I think it would be possible to make the Routes type instance dependent upon the template-haskell version number, and then users would need to declare it themselves. By the way, I actually just released web-routes-quasi 0.3.0. Michael On Sun, May 23, 2010 at 12:44 AM, Arie Peterson wrote: > On Sat, 22 May 2010 20:42:51 +0300, Michael Snoyman > wrote: > > [...] > > > > Note: right now it depends on web-routes-quasi 0.3.0, which has not yet > > been > > released, so you'll have to pull that from the github repo. > > In order to test my proposed solution (see below), I tried building > web-routes-quasi 0.3.0 from git, but I get another cabal version conflict > failure: > > | Resolving dependencies... > | cabal: cannot configure template-haskell-2.4.0.1. It requires base >=4.2 > && <5 > | For the dependency on base >=4.2 && <5 there are these packages: > base-4.2.0.0 > | and base-4.2.0.1. However none of them are available. > | base-4.2.0.0 was excluded because of the top level dependency base -any > | base-4.2.0.1 was excluded because of the top level dependency base -any > > I assume this means that it needs ghc 6.12 (which I haven't installed > yet). Do you really need template-haskell-2.4.*, or would 2.3.* suffice as > well? In that case you could relax the version constraint. > > > On Sat, May 22, 2010 at 7:32 AM, James Britt > wrote: > > > >> james@james06:~/data/vendor/yesod$ runhaskell Setup.lhs configure > --user > >> Configuring yesod-0.2.0... > >> Warning: This package indirectly depends on multiple versions of the > same > >> package. This is highly likely to cause a compile failure. > >> package http-wget-0.6.2 requires transformers-0.1.4.0 > >> package control-monad-attempt-0.3.0 requires transformers-0.1.4.0 > >> package authenticate-0.6.2 requires transformers-0.1.4.0 > >> package yesod-0.2.0 requires transformers-0.2.1.0 > >> package MonadCatchIO-transformers-0.2.2.0 requires transformers-0.2.1.0 > >> > >> [...] > >> > >> Suggestions? > > >From a quick look at the source of yesod, it /seems/ that it may work with > MonadCatchIO-transformers-0.1.* as well. Is there any reason yesod asks for > >=0.2.2 ? If not, relaxing this version constraint might fix things. > > > Regards, > > Arie > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > --===============0737704376740796897== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+VW5mb3J0dW5hdGVseSwgaXQgcmVhbGx5IGRvZXMgcmVxdWlyZSA2LjEy LiBUaGUgaXNzdWUgaXMgdGhhdCB3ZSBuZWVkIHRvIGF1dG9tYXRpY2FsbHkgZ2VuZXJhdGUgYSB0 eXBlIGluc3RhbmNlIGZvciAmcXVvdDtSb3V0ZXMmcXVvdDsuIFdoaWxlIDYuMTAgc3VwcG9ydHMg dHlwZSBpbnN0YW5jZXMsIGl0IGRvZXNuJ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iaDUiPjxicj4KX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX188YnI+CndlYi1kZXZlbCBtYWlsaW5nIGxpc3Q8YnI+CjxhIGhyZWY9Im1haWx0 bzp3ZWItZGV2ZWxAaGFza2VsbC5vcmciPndlYi1kZXZlbEBoYXNrZWxsLm9yZzwvYT48YnI+Cjxh IGhyZWY9Imh0dHA6Ly93d3cuaGFza2VsbC5vcmcvbWFpbG1hbi9saXN0aW5mby93ZWItZGV2ZWwi IHRhcmdldD0iX2JsYW5rIj5odHRwOi8vd3d3Lmhhc2tlbGwub3JnL21haWxtYW4vbGlzdGluZm8v d2ViLWRldmVsPC9hPjxicj4KPC9kaXY+PC9kaXY+PC9ibG9ja3F1b3RlPjwvZGl2Pjxicj48L2Rp dj48L2Rpdj4K --===============0737704376740796897==-- From michael@snoyman.com Mon May 24 07:51:54 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: [web-devel] ANNOUNCE: yesod 0.2.0 Date: Mon, 24 May 2010 15:26:02 +0300 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4145376339260656801==" --===============4145376339260656801== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi all, I'm very happy to announce the release of yesod 0.2.0. Yesod is a Haskell web framework for type-safe, RESTful web applications. I won't bore you all with the full release announcement here, please see the blog[1]. Installing yesod should be as simple as: cabal update && cabal install yesod. Please note that due to usage of type families in Template Haskell code, this release requires GHC 6.12. To get started with Yesod, I recommend going through the tutorials on the documentation site[2]. Please let me know if anything is unclear, or if you find any bugs. The next feature I'm targeting for Yesod is persistence. If anyone has any thoughts to share on this topic, please send me an e-mail. Michael [1] http://www.snoyman.com/blog/entry/yesod-0-2-0-released/ [2] http://docs.yesodweb.com/yesod/ --===============4145376339260656801== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+SGkgYWxsLDx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9waWMsIHBsZWFzZSBzZW5kIG1lIGFuIGUtbWFpbC48L2Rpdj4KPGRpdj48YnI+PC9k aXY+PGRpdj5NaWNoYWVsPC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5bMV3CoDxhIGhyZWY9Imh0 dHA6Ly93d3cuc25veW1hbi5jb20vYmxvZy9lbnRyeS95ZXNvZC0wLTItMC1yZWxlYXNlZC8iPmh0 dHA6Ly93d3cuc25veW1hbi5jb20vYmxvZy9lbnRyeS95ZXNvZC0wLTItMC1yZWxlYXNlZC88L2E+ PC9kaXY+PGRpdj5bMl3CoDxhIGhyZWY9Imh0dHA6Ly9kb2NzLnllc29kd2ViLmNvbS95ZXNvZC8i Pmh0dHA6Ly9kb2NzLnllc29kd2ViLmNvbS95ZXNvZC88L2E+PC9kaXY+CjxtZXRhIGh0dHAtZXF1 aXY9ImNvbnRlbnQtdHlwZSIgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0PXV0Zi04Ij48bWV0 YSBodHRwLWVxdWl2PSJjb250ZW50LXR5cGUiIGNvbnRlbnQ9InRleHQvaHRtbDsgY2hhcnNldD11 dGYtOCI+PC9kaXY+Cg== --===============4145376339260656801==-- From gour@gour-nitai.com Mon May 24 10:02:09 2010 From: Gour To: web-devel@haskell.org Subject: [web-devel] Re: ANNOUNCE: yesod 0.2.0 Date: Mon, 24 May 2010 16:35:07 +0200 Message-ID: <20100524163507.2a523959@gaura-nitai.no-ip.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2168350956225109036==" --===============2168350956225109036== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, 24 May 2010 15:26:02 +0300 >>>>>> "Michael" == wrote: Hello Michael, Michael> I'm very happy to announce the release of yesod 0.2.0. Yesod Michael> is a Haskell web framework for type-safe, RESTful web Michael> applications. Congratulations for new release and enhanced web-site! Michael> The next feature I'm targeting for Yesod is persistence. If Michael> anyone has any thoughts to share on this topic, please send me Michael> an e-mail. Do you have any rough idea about deploying RDBMS in Yesod? Otoh, this release of Yesod is coming along the 1st public release of Snap framework...pretty exciting time for Haskell web development. However, for someone who is still using Hakyll for his web needs (and I must say: "I like it!"), but may ponder into some Haskell framework in the future, I'd be interested to hear about some comparison between Yesod & Snap as far as features, methodology, target users, ease of deploying etc. are concerned? Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- --===============2168350956225109036== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuNC4xMCAoR05V L0xpbnV4KQoKaUVZRUFSRUNBQVlGQWt2Nmpwc0FDZ2tRVThlRThmbHY5Zlp5VHdDZ3k5OFZOY0x5 ZDZoS0dFb1FCWDVPSm01egp5RnNBbjFLbnNLbDZVckppNWtrakRpOWpqTENpL20zQQo9OENHZwot LS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============2168350956225109036==-- From michael@snoyman.com Mon May 24 10:13:53 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANNOUNCE: yesod 0.2.0 Date: Mon, 24 May 2010 17:47:53 +0300 Message-ID: In-Reply-To: <20100524163507.2a523959@gaura-nitai.no-ip.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2085315892055266821==" --===============2085315892055266821== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, May 24, 2010 at 5:35 PM, Gour wrote: > On Mon, 24 May 2010 15:26:02 +0300 > >>>>>> "Michael" == wrote: > > Hello Michael, > > Michael> I'm very happy to announce the release of yesod 0.2.0. Yesod > Michael> is a Haskell web framework for type-safe, RESTful web > Michael> applications. > > Congratulations for new release and enhanced web-site! > > Michael> The next feature I'm targeting for Yesod is persistence. If > Michael> anyone has any thoughts to share on this topic, please send me > Michael> an e-mail. > > Do you have any rough idea about deploying RDBMS in Yesod? > > > Otoh, this release of Yesod is coming along the 1st public release of > Snap framework...pretty exciting time for Haskell web development. > > However, for someone who is still using Hakyll for his web needs (and > I must say: "I like it!"), but may ponder into some Haskell framework > in the future, I'd be interested to hear about some comparison between > Yesod & Snap as far as features, methodology, target users, ease of > deploying etc. are concerned? > > > I would say that Yesod and Snap are very orthogonal projects. Without offense to the Snap authors, I don't really think Snap is a framework; it's much more low-level than that. As they put it, it's at the level of a Java servlet container. In that sense, it's slightly higher-level than WAI, but far more low-level than Yesod (or turbinado, happstack, etc). I did some work after the Snap release to actually get Yesod running on top of Snap. Gregory has been very helpful, and will hopefully be releasing a newer version of snap-server that provides the functionality I'm missing. (Basically, Snap processes url-encoded form data, while WAI specifies that the POST body be passed to the application.) If you want a real comparison of where the two differ on things, I guess this will suffice: * Yesod uses the WAI definition of enumerator while Snap uses the iteratee package. The former is much simpler, the latter more powerful. I'd be very interested in a performance comparison of the two, my instinct tells me the former wins. * Snap has Heist, which is an XML based templating system, while Yesod uses Hamlet. However, neither framework is actually tied down to these templating systems. In fact, Snap doesn't even depend on Heist. * Yesod has type-safe URLs, I don't believe Snap has any similar feature. However, as I mentioned already, Snap is lower level than Yesod, so you could easily implement type-safe URLs on top of Snap. * Some design decisions, notably they use a mutable states for modifying request and response values while Yesod uses a Reader for the request, and writer for response headers and actually returns a value for the response body/content type. I'm sure there are many more differences, but the main point is this: these two projects are very different types of frameworks. And I hope and expect that the two projects will have some cross-polinization going forward (in fact, we already have). Michael --===============2085315892055266821== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gTW9uLCBN YXkgMjQsIDIwMTAgYXQgNTozNSBQTSwgR291ciA8c3BhbiBkaXI9Imx0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ZXMgd2hpbGUgWWVzb2QgdXNlcyBhIFJlYWRlciBmb3IgdGhlIHJlcXVlc3QsIGFuZCB3cml0ZXIg Zm9yIHJlc3BvbnNlIGhlYWRlcnMgYW5kIGFjdHVhbGx5IHJldHVybnMgYSB2YWx1ZSBmb3IgdGhl IHJlc3BvbnNlIGJvZHkvY29udGVudCB0eXBlLjwvZGl2Pgo8ZGl2Pjxicj48L2Rpdj48ZGl2Pkkm IzM5O20gc3VyZSB0aGVyZSBhcmUgbWFueSBtb3JlIGRpZmZlcmVuY2VzLCBidXQgdGhlIG1haW4g cG9pbnQgaXMgdGhpczogdGhlc2UgdHdvIHByb2plY3RzIGFyZSB2ZXJ5IGRpZmZlcmVudCB0eXBl cyBvZiBmcmFtZXdvcmtzLiBBbmQgSSBob3BlIGFuZCBleHBlY3QgdGhhdCB0aGUgdHdvIHByb2pl Y3RzIHdpbGwgaGF2ZSBzb21lIGNyb3NzLXBvbGluaXphdGlvbiBnb2luZyBmb3J3YXJkIChpbiBm YWN0LCB3ZSBhbHJlYWR5IGhhdmUpLjwvZGl2Pgo8ZGl2Pjxicj48L2Rpdj48ZGl2Pk1pY2hhZWw8 L2Rpdj48L2Rpdj48L2Rpdj4K --===============2085315892055266821==-- From gour@gour-nitai.com Mon May 24 11:21:53 2010 From: Gour To: web-devel@haskell.org Subject: [web-devel] Re: ANNOUNCE: yesod 0.2.0 Date: Mon, 24 May 2010 17:55:44 +0200 Message-ID: <20100524175544.460006ec@gaura-nitai.no-ip.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6829982452173074395==" --===============6829982452173074395== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, 24 May 2010 17:47:53 +0300 >>>>>> "Michael" == wrote: Michael> I would say that Yesod and Snap are very orthogonal Michael> projects. Without offense to the Snap authors, I don't really Michael> think Snap is a framework; it's much more low-level than Michael> that. As they put it, it's at the level of a Java servlet Michael> container. In that sense, it's slightly higher-level than Michael> WAI, but far more low-level than Yesod (or turbinado, Michael> happstack, etc). I'd agree with that, but they say: "Higher-level facilities for building web applications (like user/session management, component interfaces, data modeling, etc.) are planned but not yet implemented..." and, moreover, they aim at: "Snap aims to be the de facto web toolkit for Haskell... ", so it looks that present release is not the end of the story. Michael> I did some work after the Snap release to actually get Yesod Michael> running on top of Snap. Gregory has been very helpful, and Michael> will hopefully be releasing a newer version of snap-server Michael> that provides the functionality I'm missing. (Basically, Snap Michael> processes url-encoded form data, while WAI specifies that the Michael> POST body be passed to the application.) Would it be better option for shared-hosting scenario and FCGI serving? Michael> * Yesod uses the WAI definition of enumerator while Snap uses Michael> the iteratee package. The former is much simpler, the latter Michael> more powerful. I'd be very interested in a performance Michael> comparison of the two, my instinct tells me the former wins. I haven't been able to grok either of them...all I can say is that I understand this is hot topic in Haskell, and if one wants to dive into web development with Haskell, there is need to understand them more (hopefully not fully). Michael> * Snap has Heist, which is an XML based templating system, Michael> while Yesod uses Hamlet. However, neither framework is Michael> actually tied down to these templating systems. In fact, Snap Michael> doesn't even depend on Heist. Hamlet looks cool to me... /me does not like XML stuff... Michael> * Yesod has type-safe URLs, I don't believe Snap has any Michael> similar feature. Hmm, this is an important issue and one of the selling tickets to use Haskell instead of e.g. Python/Django (which we recently abandoned). Michael> * Some design decisions, notably they use a mutable states for Michael> modifying request and response values while Yesod uses a Michael> Reader for the request, and writer for response headers and Michael> actually returns a value for the response body/content type. What are some of the implications of the above design difference? Michael> I'm sure there are many more differences, but the main point Michael> is this: these two projects are very different types of Michael> frameworks. And I hope and expect that the two projects will Michael> have some cross-polinization going forward (in fact, we Michael> already have). Thank you for the input. It looks that it would be nice to make another comparison when (hopefully) Snap gets some more higher-level stuff and when Yesod will have some solution for persistence (hopefully with the ability to use RDBMS). Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- --===============6829982452173074395== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuNC4xMCAoR05V L0xpbnV4KQoKaUVZRUFSRUNBQVlGQWt2Nm9ZRUFDZ2tRVThlRThmbHY5ZlptRXdDZlpKeVZUVzU2 TjNYcjIvSEpGZjE3Tm1mRgpNTVlBb0tlTzhQbmNUWVI0UGNDV1FXbCtHWmoza1NCMgo9U1NyRAot LS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============6829982452173074395==-- From michael@snoyman.com Mon May 24 11:45:54 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANNOUNCE: yesod 0.2.0 Date: Mon, 24 May 2010 19:20:02 +0300 Message-ID: In-Reply-To: <20100524175544.460006ec@gaura-nitai.no-ip.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7682830555774921560==" --===============7682830555774921560== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, May 24, 2010 at 6:55 PM, Gour wrote: > On Mon, 24 May 2010 17:47:53 +0300 > >>>>>> "Michael" == wrote: > > [snip] > Michael> I did some work after the Snap release to actually get Yesod > Michael> running on top of Snap. Gregory has been very helpful, and > Michael> will hopefully be releasing a newer version of snap-server > Michael> that provides the functionality I'm missing. (Basically, Snap > Michael> processes url-encoded form data, while WAI specifies that the > Michael> POST body be passed to the application.) > > Would it be better option for shared-hosting scenario and FCGI > serving? > > Snap is definitely *not* geared at shared hosting. I discussed this with Gregory a while ago, and unless he's changed his mind since, they're not interested in anything but dedicated hosting. So I would definitely say stick with FastCGI (or CGI... I'm working on some benchmarks right now). > Michael> * Yesod uses the WAI definition of enumerator while Snap uses > Michael> the iteratee package. The former is much simpler, the latter > Michael> more powerful. I'd be very interested in a performance > Michael> comparison of the two, my instinct tells me the former wins. > > I haven't been able to grok either of them...all I can say is that I > understand this is hot topic in Haskell, and if one wants to dive into > web development with Haskell, there is need to understand them more > (hopefully not fully). > > Well, Yesod at least shields you from dealing with enumerators, and I believe most other high-level frameworks will do the same. > [snip] > > Michael> * Yesod has type-safe URLs, I don't believe Snap has any > Michael> similar feature. > > Hmm, this is an important issue and one of the selling tickets to use > Haskell instead of e.g. Python/Django (which we recently abandoned). > > I know that since implementing this feature in Yesod it's completely changed the way I write web apps. There's no more fear of changing my URL structure: I just do it, and the compiler tells me if I need to fix anything. If Yesod goes in the advertising direction, this will most likely be the top item on the list. > Michael> * Some design decisions, notably they use a mutable states for > Michael> modifying request and response values while Yesod uses a > Michael> Reader for the request, and writer for response headers and > Michael> actually returns a value for the response body/content type. > > What are some of the implications of the above design difference? > > I personally prefer the Yesod approach, but of course I'm a biased source. I found writing code against Snap to be a little... unnatural. For example, you have to call modifyResponse and give it a function that applies changes to a response already in existence. It feels very object-oriented to me in fact. In Yesod, you can get access to the request via getRequest, and then return a value that can be converted to a response. The monad plays a much less important role, and feels overall more functional. Michael> I'm sure there are many more differences, but the main point > Michael> is this: these two projects are very different types of > Michael> frameworks. And I hope and expect that the two projects will > Michael> have some cross-polinization going forward (in fact, we > Michael> already have). > > Thank you for the input. It looks that it would be nice to make > another comparison when (hopefully) Snap gets some more higher-level > stuff and when Yesod will have some solution for persistence > (hopefully with the ability to use RDBMS). > > > Given my current line of employment, RDBMS is my top priority for the persistence layer. My thought right now is to start with MySQL, since it has the weakest Haskell support at the moment. Ideas are percolating, but I haven't had a chance to actually write something concrete yet. Michael --===============7682830555774921560== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gTW9uLCBN YXkgMjQsIDIwMTAgYXQgNjo1NSBQTSwgR291ciA8c3BhbiBkaXI9Imx0ciI+Jmx0OzxhIGhyZWY9 Im1haWx0bzpnb3VyQGdvdXItbml0YWkuY29tIj5nb3VyQGdvdXItbml0YWkuY29tPC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biBZZXNvZCB3aWxsIGhhdmUgc29tZSBzb2x1dGlvbiBmb3IgcGVy c2lzdGVuY2U8YnI+Cihob3BlZnVsbHkgd2l0aCB0aGUgYWJpbGl0eSB0byB1c2UgUkRCTVMpLjxi cj4KPGRpdj48ZGl2PjwvZGl2PjxkaXYgY2xhc3M9Img1Ij48YnI+Cjxicj48L2Rpdj48L2Rpdj48 L2Jsb2NrcXVvdGU+PGRpdj5HaXZlbiBteSBjdXJyZW50IGxpbmUgb2YgZW1wbG95bWVudCwgUkRC TVMgaXMgbXkgdG9wIHByaW9yaXR5IGZvciB0aGUgcGVyc2lzdGVuY2UgbGF5ZXIuIE15IHRob3Vn aHQgcmlnaHQgbm93IGlzIHRvIHN0YXJ0IHdpdGggTXlTUUwsIHNpbmNlIGl0IGhhcyB0aGUgd2Vh a2VzdCBIYXNrZWxsIHN1cHBvcnQgYXQgdGhlIG1vbWVudC4gSWRlYXMgYXJlIHBlcmNvbGF0aW5n LCBidXQgSSBoYXZlbiYjMzk7dCBoYWQgYSBjaGFuY2UgdG8gYWN0dWFsbHkgd3JpdGUgc29tZXRo aW5nIGNvbmNyZXRlIHlldC48L2Rpdj4KPGRpdj48YnI+PC9kaXY+PGRpdj5NaWNoYWVsPC9kaXY+ PC9kaXY+PC9kaXY+Cg== --===============7682830555774921560==-- From cdsmith@gmail.com Mon May 24 12:13:30 2010 From: Chris Smith To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANNOUNCE: yesod 0.2.0 Date: Mon, 24 May 2010 10:47:27 -0600 Message-ID: <1274719647.3804.49.camel@dell-desktop.example.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0164043300643810445==" --===============0164043300643810445== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Just one comment (in a few parts). On Mon, 2010-05-24 at 17:47 +0300, Michael Snoyman wrote: > I would say that Yesod and Snap are very orthogonal projects. Without > offense to the Snap authors, I don't really think Snap is a framework; > it's much more low-level than that. That seems to be overstating the case a bit. Snap is designed to write applications directly on top of it, and in that sense acts as a framework. Some of the difference you're seeing likely comes down to preference about how heavy the "framework" ought to be. > * Yesod has type-safe URLs, I don't believe Snap has any similar > feature. However, as I mentioned already, Snap is lower level than > Yesod, so you could easily implement type-safe URLs on top of Snap. Snap does provide a form of routing requests, and even of parsing data from the contents of the URL. It looks to be based on combinators similar to what Happstack does, with the exception that capturing variables from URLs is done in a relatively braindead way by adding special syntax with colons inside strings. The point here is, Snap does something different; not necessarily something worse. We all have our preferences. Treating Snap as a new underlying server implementation on top of which to layer WAI and Yesod is possible, but rather missing the point. Much of what I get from Snap is that we can dispense with some of the unnecessary complexity and just solve problems. Then again, I've also built three or four significant internally used web applications with Happstack, and have yet to use happstack-state for anything but working through tutorials. Could be I'm just afraid of change... -- Chris Smith --===============0164043300643810445==-- From gour@gour-nitai.com Mon May 24 12:22:26 2010 From: Gour To: web-devel@haskell.org Subject: [web-devel] Re: ANNOUNCE: yesod 0.2.0 Date: Mon, 24 May 2010 18:56:16 +0200 Message-ID: <20100524185616.076ed96c@gaura-nitai.no-ip.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2784112107024055552==" --===============2784112107024055552== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, 24 May 2010 19:20:02 +0300 >>>>>> "Michael" == wrote: Michael> Snap is definitely *not* geared at shared hosting. I Michael> discussed this with Gregory a while ago, and unless he's Michael> changed his mind since, they're not interested in anything Michael> but dedicated hosting. So I would definitely say stick with Michael> FastCGI (or CGI... I'm working on some benchmarks right now). I've asked the other day on #snapframework, and the response was "that use case is not very relevant for any of us but we know people are interested in that", so it does not sound as definite 'no', but who knows... Michael> > I know that since implementing this feature in Yesod it's > Michael> completely changed the way I write web apps. There's no more Michael> fear of changing my URL structure: I just do it, and the Michael> compiler tells me if I need to fix anything. If Yesod goes in Michael> the advertising direction, this will most likely be the top Michael> item on the list. Why should Yesod not go into (more) advertising? ;) Michael> > I personally prefer the Yesod approach, but of course I'm a Michael> > biased source. Michael> I found writing code against Snap to be a little... unnatural. I did not try (hard) enough neither with Yesod, nor with Snap, but none did not look 'natural' to me either. Maybe it's because I did not do any web programming and being only exposed to Django-way of things. We hope it will change when we go deeper... Michael> > Given my current line of employment, RDBMS is my top Michael> priority for the persistence layer. My thought right now is Michael> to start with MySQL, since it has the weakest Haskell support Michael> at the moment. Heh, I vote for PostgreSQL although sqlite3 would be probably enough to serve blog(gy), but I assume those will be supported as well. Michael> Ideas are percolating, but I haven't had a chance to actually Michael> write something concrete yet. OK. Wish you some 'enlightenment'. ;) Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- --===============2784112107024055552== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuNC4xMCAoR05V L0xpbnV4KQoKaUVZRUFSRUNBQVlGQWt2NnI3QUFDZ2tRVThlRThmbHY5ZllPR1FDZlRNMWlvdjlJ V2lXZlpWT3BjUnpQKzgwOQpuendBb0xYSVFxSGo1VUJjb0xkRkRjSXpMZXdRZnVWdAo9R285ZQot LS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============2784112107024055552==-- From michael@snoyman.com Mon May 24 12:24:57 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANNOUNCE: yesod 0.2.0 Date: Mon, 24 May 2010 19:59:06 +0300 Message-ID: In-Reply-To: <1274719647.3804.49.camel@dell-desktop.example.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3291730540665863115==" --===============3291730540665863115== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, May 24, 2010 at 7:47 PM, Chris Smith wrote: > Just one comment (in a few parts). > > On Mon, 2010-05-24 at 17:47 +0300, Michael Snoyman wrote: > > > I would say that Yesod and Snap are very orthogonal projects. Without > > offense to the Snap authors, I don't really think Snap is a framework; > > it's much more low-level than that. > > That seems to be overstating the case a bit. Snap is designed to write > applications directly on top of it, and in that sense acts as a > framework. Some of the difference you're seeing likely comes down to > preference about how heavy the "framework" ought to be. > > > * Yesod has type-safe URLs, I don't believe Snap has any similar > > feature. However, as I mentioned already, Snap is lower level than > > Yesod, so you could easily implement type-safe URLs on top of Snap. > > Snap does provide a form of routing requests, and even of parsing data > from the contents of the URL. It looks to be based on combinators > similar to what Happstack does, with the exception that capturing > variables from URLs is done in a relatively braindead way by adding > special syntax with colons inside strings. > > The point here is, Snap does something different; not necessarily > something worse. We all have our preferences. Treating Snap as a new > underlying server implementation on top of which to layer WAI and Yesod > is possible, but rather missing the point. Much of what I get from Snap > is that we can dispense with some of the unnecessary complexity and just > solve problems. > > Then again, I've also built three or four significant internally used > web applications with Happstack, and have yet to use happstack-state for > anything but working through tutorials. Could be I'm just afraid of > change... > > I think you read my e-mail a little too harshly. Let me rephrase: * The feature set Snap has right now does not qualify it as a framework *in my mind*. If someone asks to compare the features of Snap and Yesod, there's not much to say. I'm well aware of the subjectivity of the term framework, I'm merely saying that by the criteria I know, and which I think most people are used to, Snap does not provide the features of a framework. * I'm well aware of Snap's routing abilities, but it still does not support type-safe URLs. You may not want type-safe URLs, that's fine. But I can't compare Yesod's implementation of them versus Snap's, simply because the latter is absent. If you see Snap as a great way to write applications without complications, go for it, I think that's great. For people that want features that Yesod provides, I think it will be nice to have a fast server to run on top of. Michael --===============3291730540665863115== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gTW9uLCBN YXkgMjQsIDIwMTAgYXQgNzo0NyBQTSwgQ2hyaXMgU21pdGggPHNwYW4gZGlyPSJsdHIiPiZsdDs8 YSBocmVmPSJtYWls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l2PjwvZGl2Pgo= --===============3291730540665863115==-- From gour@gour-nitai.com Mon May 24 12:36:26 2010 From: Gour To: web-devel@haskell.org Subject: [web-devel] Re: ANNOUNCE: yesod 0.2.0 Date: Mon, 24 May 2010 19:10:16 +0200 Message-ID: <20100524191016.6e1960e4@gaura-nitai.no-ip.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1058404504170400564==" --===============1058404504170400564== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, 24 May 2010 19:59:06 +0300 >>>>>> "Michael" == wrote: Michael> If you see Snap as a great way to write applications without Michael> complications, go for it, I think that's great. For people Michael> that want features that Yesod provides, I think it will be Michael> nice to have a fast server to run on top of. /me just wants rich Haskell framework being able to deploy on shared hosting usign RDBMS so that we can stop looking at the Python's courtyard. /me hopes he is not the only one desiring the above :-) Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- --===============1058404504170400564== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuNC4xMCAoR05V L0xpbnV4KQoKaUVZRUFSRUNBQVlGQWt2NnN2Z0FDZ2tRVThlRThmbHY5ZmJvbEFDZ3NFWTQxYlU4 Q3RjZUZuYkFzajZQRXd1dApwM01BbXdYWWowbGlpSzZRaFRJU2dISFNTb3kwQzF2dwo9YjNaTQot LS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============1058404504170400564==-- From mightybyte@gmail.com Mon May 24 12:56:31 2010 From: MightyByte To: web-devel@haskell.org Subject: [web-devel] Re: ANNOUNCE: yesod 0.2.0 Date: Mon, 24 May 2010 17:30:25 +0000 Message-ID: In-Reply-To: <20100524175544.460006ec@gaura-nitai.no-ip.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0293468178277221921==" --===============0293468178277221921== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Gour writes: >=20 > On Mon, 24 May 2010 17:47:53 +0300 > >>>>>> "Michael" =3D=3D wrote: >=20 > Michael> I would say that Yesod and Snap are very orthogonal > Michael> projects. Without offense to the Snap authors, I don't really > Michael> think Snap is a framework; it's much more low-level than > Michael> that. As they put it, it's at the level of a Java servlet > Michael> container. In that sense, it's slightly higher-level than > Michael> WAI, but far more low-level than Yesod (or turbinado, > Michael> happstack, etc). >=20 > I'd agree with that, but they say: "Higher-level facilities for > building web applications (like user/session management, component > interfaces, data modeling, etc.) are planned but not yet > implemented..." and, moreover, they aim at: "Snap aims to be the de > facto web toolkit for Haskell... ", so it looks that present release > is not the end of the story. Gour is correct here. We thought long and hard about how to balance the advantages of "release early and often" with the advantages of not releasing a half-baked product that turns people away for good. We decided to err by being more of the latter. In fact, Don Stewart expressed some concerns about our use of that approach. So we decided to get the low-level parts mature before release. Now we're getting these "snap is not a high level framework" opinions, which almost suggest we should have waited longer. I don't actually think that, but you have to wonder. > Michael> I did some work after the Snap release to actually get Yesod > Michael> running on top of Snap. Gregory has been very helpful, and > Michael> will hopefully be releasing a newer version of snap-server > Michael> that provides the functionality I'm missing. (Basically, Snap > Michael> processes url-encoded form data, while WAI specifies that the > Michael> POST body be passed to the application.) >=20 > Would it be better option for shared-hosting scenario and FCGI > serving? VPSs these days are cheap enough that we decided not to address the shared-hosting demographic. > Michael> * Yesod uses the WAI definition of enumerator while Snap uses > Michael> the iteratee package. The former is much simpler, the latter > Michael> more powerful. I'd be very interested in a performance > Michael> comparison of the two, my instinct tells me the former wins. We'll have to see... > Michael> * Snap has Heist, which is an XML based templating system, > Michael> while Yesod uses Hamlet. However, neither framework is > Michael> actually tied down to these templating systems. In fact, Snap > Michael> doesn't even depend on Heist. >=20 > Hamlet looks cool to me... >=20 > /me does not like XML stuff... I don't care for HAML. I'd rather my templates be in the same general form as my end-result markup. Heist makes it trivial to implement extensions to XHTML ala the pattern used by Facebook for their FBML. So the approach is not without precedent. That said, I believe this is the most common complaint about Snap that I've seen. As we've already shown, it's not a valid complaint about snap-core and snap-server. But if you don't like XML templates, then Heist is not for you. To each his own. > Michael> * Yesod has type-safe URLs, I don't believe Snap has any > Michael> similar feature.=20 >=20 > Hmm, this is an important issue and one of the selling tickets to use > Haskell instead of e.g. Python/Django (which we recently abandoned). Awhile back I wrote a blog post about this question. (http://softwaresimply.blogspot.com/2008/03/to-template-or-not-to-template.ht= ml) My conclusion then was in favor of haskell-generated markup. This led me to really want something for type-safe URLs. I never got around to implementing something, but I wished for them on many occasions. After building and running a website on happstack using this approach, I have changed my mind. I think that abstracting the generation of a site's markup = is very site-specific, and difficult to get right. Type-safe URLs are a nice bonus, but I don't think they're enough to tip the scales. That said, my only experience with a templated site snapframework.com, so I still have more to learn. But so far working with Heist templates has been quite nice. I'm planning to do a blog post on this sometime (hopefully near future). =20 So this whole issue is very debatable. But again, snap-core and snap-server can be used with either approach. > Michael> * Some design decisions, notably they use a mutable states for > Michael> modifying request and response values while Yesod uses a > Michael> Reader for the request, and writer for response headers and > Michael> actually returns a value for the response body/content type. >=20 > What are some of the implications of the above design difference? I don't think this is a significant difference. Using state instead of reader hasn't changed Haskell into an impure language. And you can make readers behave like a state monad using the local function. --===============0293468178277221921==-- From 8mayday@gmail.com Mon May 24 13:01:16 2010 From: Andrey Popp <8mayday@gmail.com> To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANNOUNCE: yesod 0.2.0 Date: Mon, 24 May 2010 21:35:04 +0400 Message-ID: In-Reply-To: <20100524191016.6e1960e4@gaura-nitai.no-ip.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2387247255814188710==" --===============2387247255814188710== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sorry for appearing in the middle of the discussion but, On Mon, May 24, 2010 at 9:10 PM, Gour wrote: > /me just wants rich Haskell framework being able to deploy on shared > hosting usign RDBMS so that we can stop looking at the Python's > courtyard. Don't you think, that ability to deploy on shared hosting is overvalued feature, I mean VPS are quite cheep and that's definitely not an issue to buy one and setup your web application with your favourite web-framework. Python people don't bother about shared hosting solutions, while Python implementation are much slower than GHC ;-). Related to URL routing solutions in Yesod and Snap — I've found the Snap way to be more comfortable, maybe this is because the same syntax is used by Python/Ruby web frameworks (I personally have experience with many Python web frameworks). Also I don't think that URL routing type safety is also very important here. Thanks! -- Andrey Popp phone: +7 911 740 24 91 e-mail: 8mayday@gmail.com --===============2387247255814188710==-- From greg@gregorycollins.net Mon May 24 13:04:47 2010 From: Gregory Collins To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANNOUNCE: yesod 0.2.0 Date: Mon, 24 May 2010 13:38:54 -0400 Message-ID: <87typxqjwx.fsf@gregorycollins.net> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0032107662030255799==" --===============0032107662030255799== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Michael Snoyman writes: > I think you read my e-mail a little too harshly. Let me rephrase: > > * The feature set Snap has right now does not qualify it as a > framework *in my mind*. If someone asks to compare the features of > Snap and Yesod, there's not much to say. I'm well aware of the > subjectivity of the term framework, I'm merely saying that by the > criteria I know, and which I think most people are used to, Snap does > not provide the features of a framework. > > * I'm well aware of Snap's routing abilities, but it still does not > support type-safe URLs. You may not want type-safe URLs, that's > fine. But I can't compare Yesod's implementation of them versus > Snap's, simply because the latter is absent. > > If you see Snap as a great way to write applications without > complications, go for it, I think that's great. For people that want > features that Yesod provides, I think it will be nice to have a fast > server to run on top of. Yes, exactly, I agree with all of the above. We have plans for providing more sophisticated "framework" capabilities in the future, but right now we are concentrating on having a stable, well-tested, and high-performance low-level HTTP server and application interface. Where we can find common ground (like Yesod using Snap as a low-level server, or us maybe adapting some code for multipart form data from Yesod), the code will cross-pollinate, and where things are too different (because of different design goals/concerns) we will provide users with alternatives. "A rising tide lifts all boats" etc. G -- Gregory Collins --===============0032107662030255799==-- From greg@gregorycollins.net Mon May 24 13:11:29 2010 From: Gregory Collins To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANNOUNCE: yesod 0.2.0 Date: Mon, 24 May 2010 13:45:38 -0400 Message-ID: <87pr0lqjlp.fsf@gregorycollins.net> In-Reply-To: <20100524185616.076ed96c@gaura-nitai.no-ip.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0294228879326714386==" --===============0294228879326714386== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Gour writes: > On Mon, 24 May 2010 19:20:02 +0300 >>>>>>> "Michael" == wrote: > > Michael> Snap is definitely *not* geared at shared hosting. I > Michael> discussed this with Gregory a while ago, and unless he's > Michael> changed his mind since, they're not interested in anything > Michael> but dedicated hosting. So I would definitely say stick with > Michael> FastCGI (or CGI... I'm working on some benchmarks right now). > > I've asked the other day on #snapframework, and the response was "that > use case is not very relevant for any of us but we know people are > interested in that", so it does not sound as definite 'no', but who > knows... It would be a weekend project for someone, but that someone isn't me -- I have too many other itches to scratch. If anyone is up for tackling this particular problem and needs help/advice on our code base, please get in touch with me. G -- Gregory Collins --===============0294228879326714386==-- From greg@gregorycollins.net Mon May 24 13:15:40 2010 From: Gregory Collins To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANNOUNCE: yesod 0.2.0 Date: Mon, 24 May 2010 13:49:48 -0400 Message-ID: <87ljb9qjer.fsf@gregorycollins.net> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5078279777842810641==" --===============5078279777842810641== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Andrey Popp <8mayday@gmail.com> writes: > Related to URL routing solutions in Yesod and Snap — I've found the > Snap way to be more comfortable, maybe this is because the same syntax > is used by Python/Ruby web frameworks (I personally have experience > with many Python web frameworks). Also I don't think that URL routing > type safety is also very important here. There is actually nothing stopping us from providing a typesafe URL routing engine; we just haven't done it yet because like you, it isn't very important to us. Some people really like it though, so I can see us providing something eventually. G -- Gregory Collins --===============5078279777842810641==-- From gour@gour-nitai.com Mon May 24 13:18:46 2010 From: Gour To: web-devel@haskell.org Subject: [web-devel] Re: ANNOUNCE: yesod 0.2.0 Date: Mon, 24 May 2010 19:52:29 +0200 Message-ID: <20100524195229.3e956ac1@gaura-nitai.no-ip.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1467619284569763646==" --===============1467619284569763646== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, 24 May 2010 21:35:04 +0400 >>>>>> "Andrey" =3D=3D Andrey Popp <8mayday-Re5JQEeQqe8AvxtiuMwx3w@public.gma= ne.org> wrote: Andrey> Don't you think, that ability to deploy on shared hosting is Andrey> overvalued feature, I mean VPS are quite cheep and that's Andrey> definitely not an issue to buy one and setup your web Andrey> application with your favourite web-framework. Python people Andrey> don't bother about shared hosting solutions, while Python Andrey> implementation are much slower than GHC ;-). No! It is not question about cheap or expensive hosting, but, in my case, my time that should be used for maintaining the whole VPS (mail server, database server etc.) plus security issues etc. is more precious than cost of the hosting. Otoh, with e.g. Webfaction I get all these for free, taking care only about web-stuff. Sincerely, Gour --=20 Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ---------------------------------------------------------------- --===============1467619284569763646== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuNC4xMCAoR05V L0xpbnV4KQoKaUVZRUFSRUNBQVlGQWt2NnZOMEFDZ2tRVThlRThmbHY5ZllMK1FDZUlhU1JaeUd1 VDZZSnlteGN2WjM3SUJndgpkaFlBblJtcDNPTDhMbEVROUFQUUdKMW9TK1lORWl5Vgo9akZoQgot LS0tLUVORCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============1467619284569763646==-- From michael@snoyman.com Mon May 24 14:36:15 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANNOUNCE: yesod 0.2.0 Date: Mon, 24 May 2010 22:10:21 +0300 Message-ID: In-Reply-To: <87ljb9qjer.fsf@gregorycollins.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3605534549606403601==" --===============3605534549606403601== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, May 24, 2010 at 8:49 PM, Gregory Collins wro= te: > Andrey Popp <8mayday@gmail.com> writes: > > > Related to URL routing solutions in Yesod and Snap =E2=80=94 I've found t= he > > Snap way to be more comfortable, maybe this is because the same syntax > > is used by Python/Ruby web frameworks (I personally have experience > > with many Python web frameworks). Also I don't think that URL routing > > type safety is also very important here. > > There is actually nothing stopping us from providing a typesafe URL > routing engine; we just haven't done it yet because like you, it isn't > very important to us. Some people really like it though, so I can see us > providing something eventually. > > I'm just curious if anyone's actually *used* type-safe URLs in production web apps. I'm not really aware of an implementation besides what Jeremy Shaw has done (first urlt and then web-routes). I'm afraid that the technique is not getting the credit it deserves. When I say type-safe URLs, I'm talking about having a datatype which represents all possible routes in an application, a function to convert from that datatype to a String, and a function to attempt converting a String to that datatype. As a simple example: data MyBlog =3D BlogHome | BlogEntry String | AtomFeed Then, instead of typing something like "/entries/" ++ entryName ++ "/", you just type BlogEntry entryName. In this simple case, it doesn't do much more than ensure you don't make typos. I can't go into details, but I had a project where I needed to change an entity relationship from many-to-many to many-to-one, and suddenly I had to remove an extraneous parameter from all of my routes. Due to type-safe URLs, I changed the datatype and the compiler caught each and every time I needed to modify the code. More simply, if I decide suddenly to rename "/entry/1/" to "/post/1/", I only need to change the URL rendering function and all of my code is updated automatically. This monologue isn't meant as a Yesod-is-better-than-Snap, it's meant to point out that type-safe URLs are a very powerful feature, and I think it fits very nicely with the Haskell nature. I'd really urge people to look hard at them and consider using them. Michael --===============3605534549606403601== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+PGJ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ZGUuPC9kaXY+CjxkaXY+PGJyPjwvZGl2Pjxk aXY+TW9yZSBzaW1wbHksIGlmIEkgZGVjaWRlIHN1ZGRlbmx5IHRvIHJlbmFtZSAmcXVvdDsvZW50 cnkvMS8mcXVvdDsgdG8gJnF1b3Q7L3Bvc3QvMS8mcXVvdDssIEkgb25seSBuZWVkIHRvIGNoYW5n ZSB0aGUgVVJMIHJlbmRlcmluZyBmdW5jdGlvbiBhbmQgYWxsIG9mIG15IGNvZGUgaXMgdXBkYXRl ZCBhdXRvbWF0aWNhbGx5LjwvZGl2PjxkaXY+PGJyPjwvZGl2Pgo8ZGl2PlRoaXMgbW9ub2xvZ3Vl IGlzbiYjMzk7dCBtZWFudCBhcyBhIFllc29kLWlzLWJldHRlci10aGFuLVNuYXAsIGl0JiMzOTtz IG1lYW50IHRvIHBvaW50IG91dCB0aGF0IHR5cGUtc2FmZSBVUkxzIGFyZSBhIHZlcnkgcG93ZXJm dWwgZmVhdHVyZSwgYW5kIEkgdGhpbmsgaXQgZml0cyB2ZXJ5IG5pY2VseSB3aXRoIHRoZSBIYXNr ZWxsIG5hdHVyZS4gSSYjMzk7ZCByZWFsbHkgdXJnZSBwZW9wbGUgdG8gbG9vayBoYXJkIGF0IHRo ZW0gYW5kIGNvbnNpZGVyIHVzaW5nIHRoZW0uPC9kaXY+CjxkaXY+PGJyPjwvZGl2PjxkaXY+TWlj aGFlbDwvZGl2PgoKPC9kaXY+PC9kaXY+Cg== --===============3605534549606403601==-- From moonmaster9000@gmail.com Mon May 24 15:07:01 2010 From: Matt Parker To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANNOUNCE: yesod 0.2.0 Date: Mon, 24 May 2010 15:41:09 -0400 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7139210092241993744==" --===============7139210092241993744== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable i use type-safe urls all the time! in rails :-) the rails router generates helper functions, allowing you to use route helpers throughout your code instead of the literal urls - making it possible, and simple, to change your routes throughout your entire codebase by simply changing the route definition (assuming you actually used the route helpers in your code instead of littering handcrafted url strings all over the place). if you've never seen it before, basically some code like this: resources :blogs generates url-generator methods like blogs_X blog_X where X=3Durl or path and also routes incoming requests to controller actions based on RESTful conventions: GET /blogs would go to the BlogsController:#index action, GET /blogs/1 would go to the BlogsController:#show action, POST /blogs/1 would go to the BlogsController:#update action, etc. etc. there's also a lot of other ways to specify routes (named routes, nested routes, default routes, regular routes, etc) On Mon, May 24, 2010 at 3:10 PM, Michael Snoyman wrote: > > > On Mon, May 24, 2010 at 8:49 PM, Gregory Collins w= rote: > >> Andrey Popp <8mayday@gmail.com> writes: >> >> > Related to URL routing solutions in Yesod and Snap =E2=80=94 I've found = the >> > Snap way to be more comfortable, maybe this is because the same syntax >> > is used by Python/Ruby web frameworks (I personally have experience >> > with many Python web frameworks). Also I don't think that URL routing >> > type safety is also very important here. >> >> There is actually nothing stopping us from providing a typesafe URL >> routing engine; we just haven't done it yet because like you, it isn't >> very important to us. Some people really like it though, so I can see us >> providing something eventually. >> >> I'm just curious if anyone's actually *used* type-safe URLs in production > web apps. I'm not really aware of an implementation besides what Jeremy Shaw > has done (first urlt and then web-routes). I'm afraid that the technique is > not getting the credit it deserves. > > When I say type-safe URLs, I'm talking about having a datatype which > represents all possible routes in an application, a function to convert from > that datatype to a String, and a function to attempt converting a String to > that datatype. As a simple example: > > data MyBlog =3D BlogHome | BlogEntry String | AtomFeed > > Then, instead of typing something like "/entries/" ++ entryName ++ "/", you > just type BlogEntry entryName. In this simple case, it doesn't do much more > than ensure you don't make typos. > > I can't go into details, but I had a project where I needed to change an > entity relationship from many-to-many to many-to-one, and suddenly I had to > remove an extraneous parameter from all of my routes. Due to type-safe URLs, > I changed the datatype and the compiler caught each and every time I needed > to modify the code. > > More simply, if I decide suddenly to rename "/entry/1/" to "/post/1/", I > only need to change the URL rendering function and all of my code is updated > automatically. > > This monologue isn't meant as a Yesod-is-better-than-Snap, it's meant to > point out that type-safe URLs are a very powerful feature, and I think it > fits very nicely with the Haskell nature. I'd really urge people to look > hard at them and consider using them. > > Michael > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > > --===============7139210092241993744== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 aSB1c2UgdHlwZS1zYWZlIHVybHMgYWxsIHRoZSB0aW1lISBpbiByYWlscyA6LSkgPGJyPjxicj50 aGUgcmFpbHMgcm91dGVyIGdlbmVyYXRlcyBoZWxwZXIgZnVuY3Rpb25zLCBhbGxvd2luZyB5b3Ug dG8gdXNlIHJvdXRlIGhlbHBlcnMgdGhyb3VnaG91dCB5b3VyIGNvZGUgaW5zdGVhZCBvZiB0aGUg bGl0ZXJhbCB1cmxzIC0gbWFraW5nIGl0IHBvc3NpYmxlLCBhbmQgc2ltcGxlLCB0byBjaGFuZ2Ug eW91ciByb3V0ZXMgdGhyb3VnaG91dCB5b3VyIGVudGlyZSBjb2RlYmFzZSBieSBzaW1wbHkgY2hh bmdpbmcgdGhlIHJvdXRlIGRlZmluaXRpb24gKGFzc3VtaW5nIHlvdSBhY3R1YWxseSB1c2VkIHRo ZSByb3V0ZSBoZWxwZXJzIGluIHlvdXIgY29kZSBpbnN0ZWFkIG9mIGxpdHRlcmluZyBoYW5kY3Jh ZnRlZCB1cmwgc3RyaW5ncyBhbGwgb3ZlciB0aGUgcGxhY2UpLjxicj4KPGJyPmlmIHlvdSYjMzk7 dmUgbmV2ZXIgc2VlbiBpdCBiZWZvcmUsIGJhc2ljYWxseSBzb21lIGNvZGUgbGlrZSB0aGlzOjxi cj48YnI+cmVzb3VyY2VzIDpibG9nczxicj48YnI+Z2VuZXJhdGVzIHVybC1nZW5lcmF0b3IgbWV0 aG9kcyBsaWtlPGJyPjxicj5ibG9nc19YPGJyPmJsb2dfWDxicj48YnI+d2hlcmUgWD11cmwgb3Ig cGF0aDxicj48YnI+YW5k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HRhcmdldD0iX2JsYW5rIj5odHRwOi8vd3d3Lmhhc2tlbGwub3JnL21h aWxtYW4vbGlzdGluZm8vd2ViLWRldmVsPC9hPjxicj4KPGJyPjwvYmxvY2txdW90ZT48L2Rpdj48 YnI+Cg== --===============7139210092241993744==-- From greg@gregorycollins.net Mon May 24 16:05:54 2010 From: Gregory Collins To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANNOUNCE: yesod 0.2.0 Date: Mon, 24 May 2010 16:39:48 -0400 Message-ID: <87hblxqbjf.fsf@gregorycollins.net> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0397214495063876297==" --===============0397214495063876297== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Michael Snoyman writes: > This monologue isn't meant as a Yesod-is-better-than-Snap, it's meant > to point out that type-safe URLs are a very powerful feature, and I > think it fits very nicely with the Haskell nature. I'd really urge > people to look hard at them and consider using them. Enough people want this that I've been talking with Jeremy about doing a web-routes backend for Snap -- sounds like less than an hour's work. On the todo list... G -- Gregory Collins --===============0397214495063876297==-- From agocorona@gmail.com Tue May 25 06:35:54 2010 From: "Alberto G. Corona" To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANNOUNCE: yesod 0.2.0 Date: Tue, 25 May 2010 13:10:00 +0200 Message-ID: In-Reply-To: <87hblxqbjf.fsf@gregorycollins.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8288172545163862871==" --===============8288172545163862871== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Could your web-routes be general enough to be integrated in other frameworks?. du to my special requirements I´m working on my own app-server (persistence, clustering, state, threading, but not web framework) and I would like to have web components available to put at the top, rather than web frameworks. Alberto 2010/5/24 Gregory Collins > Michael Snoyman writes: > > > This monologue isn't meant as a Yesod-is-better-than-Snap, it's meant > > to point out that type-safe URLs are a very powerful feature, and I > > think it fits very nicely with the Haskell nature. I'd really urge > > people to look hard at them and consider using them. > > Enough people want this that I've been talking with Jeremy about doing a > web-routes backend for Snap -- sounds like less than an hour's work. On > the todo list... > > G > -- > Gregory Collins > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > --===============8288172545163862871== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 Q291bGQgeW91ciB3ZWItcm91dGVzIKBiZSBnZW5lcmFsIGVub3VnaCB0byBiZSBpbnRlZ3JhdGVk IGluIG90aGVyIGZyYW1ld29ya3M/LiBkdSB0byBteSBzcGVjaWFsIHJlcXVpcmVtZW50cyCgSbRt IHdvcmtpbmcgb24gbXkgb3duIGFwcC1zZXJ2ZXIgKHBlcnNpc3RlbmNlLCBjbHVzdGVyaW5nLCBz dGF0ZSwgdGhyZWFkaW5nLCBidXQgbm90IHdlYiBmcmFtZXdvcmspIGFuZCBJIHdvdWxkIGxpa2Ug dG8gaGF2ZSB3ZWIgY29tcG9uZW50cyBhdmFpbGFibGUgdG8gcHV0IGF0IHRoZSB0b3AsIHJhdGhl ciB0aGFuIHdlYiBmcmFtZXdvcmtzLjxkaXY+Cjxicj48L2Rpdj48ZGl2PkFsYmVydG88YnI+Cjxi cj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+MjAxMC81LzI0IEdyZWdvcnkgQ29sbGlucyA8c3Bh biBkaXI9Imx0ciI+Jmx0OzxhIGhyZWY9Im1haWx0bzpncmVnQGdyZWdvcnljb2xsaW5zLm5ldCIg dGFyZ2V0PSJfYmxhbmsiPmdyZWdAZ3JlZ29yeWNvbGxpbnMubmV0PC9hPiZndDs8L3NwYW4+PGJy PjxibG9ja3F1b3RlIGNsYXNzPSJnbWFpbF9xdW90ZSIgc3R5bGU9Im1hcmdpbjowIDAgMCAuOGV4 O2JvcmRlci1sZWZ0OjFweCAjY2NjIHNvbGlkO3BhZGRpbmctbGVmdDoxZXgiPgoKPGRpdj5NaWNo YWVsIFNub3ltYW4gJmx0OzxhIGhyZWY9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9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fPGJy Pgp3ZWItZGV2ZWwgbWFpbGluZyBsaXN0PGJyPgo8YSBocmVmPSJtYWlsdG86d2ViLWRldmVsQGhh c2tlbGwub3JnIiB0YXJnZXQ9Il9ibGFuayI+d2ViLWRldmVsQGhhc2tlbGwub3JnPC9hPjxicj4K PGEgaHJlZj0iaHR0cDovL3d3dy5oYXNrZWxsLm9yZy9tYWlsbWFuL2xpc3RpbmZvL3dlYi1kZXZl bCIgdGFyZ2V0PSJfYmxhbmsiPmh0dHA6Ly93d3cuaGFza2VsbC5vcmcvbWFpbG1hbi9saXN0aW5m by93ZWItZGV2ZWw8L2E+PGJyPgo8L2Rpdj48L2Rpdj48L2Jsb2NrcXVvdGU+PC9kaXY+PGJyPgo8 L2Rpdj4K --===============8288172545163862871==-- From michael@snoyman.com Tue May 25 06:40:16 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANNOUNCE: yesod 0.2.0 Date: Tue, 25 May 2010 14:14:26 +0300 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8996710967445544127==" --===============8996710967445544127== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Absolutely, that was a primary design goal. There's really two packages at play here: * Jeremy Shaw's web-routes provides some basic infrastructure. * My web-routes-quasi provides the quasi-quoted syntax and template haskell code for generating the render, parse and dispatch functions. Currently web-routes-quasi is pretty tailor-made for Yesod, but I'd be happy to make changes to have it fit your needs. I originally wanted the package to be more general, but realized I really needed user feedback on the features desired in order to do that properly. Michael On Tue, May 25, 2010 at 2:10 PM, Alberto G. Corona wrote: > Could your web-routes be general enough to be integrated in other > frameworks?. du to my special requirements I=C2=B4m working on my own app-= server > (persistence, clustering, state, threading, but not web framework) and I > would like to have web components available to put at the top, rather than > web frameworks. > > Alberto > > 2010/5/24 Gregory Collins > >> Michael Snoyman writes: >> >> > This monologue isn't meant as a Yesod-is-better-than-Snap, it's meant >> > to point out that type-safe URLs are a very powerful feature, and I >> > think it fits very nicely with the Haskell nature. I'd really urge >> > people to look hard at them and consider using them. >> >> Enough people want this that I've been talking with Jeremy about doing a >> web-routes backend for Snap -- sounds like less than an hour's work. On >> the todo list... >> >> G >> -- >> Gregory Collins >> _______________________________________________ >> web-devel mailing list >> web-devel@haskell.org >> http://www.haskell.org/mailman/listinfo/web-devel >> > > --===============8996710967445544127== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+QWJzb2x1dGVseSwgdGhhdCB3YXMgYSBwcmltYXJ5IGRlc2lnbiBnb2Fs LiBUaGVyZSYjMzk7cyByZWFsbHkgdHdvIHBhY2thZ2VzIGF0IHBsYXkgaGVyZTo8ZGl2Pjxicj48 L2Rpdj48ZGl2PiogSmVyZW15IFNoYXcmIzM5O3Mgd2ViLXJvdXRlcyBwcm92aWRlcyBzb21lIGJh c2ljIGluZnJhc3RydWN0dXJlLjwvZGl2PjxkaXY+KiBNeSB3ZWItcm91dGVzLXF1YXNpIHByb3Zp ZGVzIHRoZSBxdWFzaS1xdW90ZWQgc3ludGF4IGFuZCB0ZW1wbGF0ZSBoYXNrZWxsIGNvZGUgZm9y IGdlbmVyYXRpbmcgdGhlIHJlbmRlciwgcGFyc2UgYW5kIGRpc3BhdGNoIGZ1bmN0aW9ucy48L2Rp dj4KPGRpdj48YnI+PC9kaXY+PGRpdj5DdXJyZW50bHkgd2ViLXJvdXRlcy1xdWFzaSBpcyBwcmV0 dHkgdGFpbG9yLW1hZGUgZm9yIFllc29kLCBidXQgSSYjMzk7ZCBiZSBoYXBweSB0byBtYWtlIGNo YW5nZXMgdG8gaGF2ZSBpdCBmaXQgeW91ciBuZWVkcy4gSSBvcmlnaW5hbGx5IHdhbnRlZCB0aGUg cGFja2FnZSB0byBiZSBtb3JlIGdlbmVyYWwsIGJ1dCByZWFsaXplZCBJI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W15IGFib3V0IGRvaW5nIGE8YnI+CndlYi1yb3V0ZXMgYmFja2VuZCBmb3IgU25hcCAt LSBzb3VuZHMgbGlrZSBsZXNzIHRoYW4gYW4gaG91ciYjMzk7cyB3b3JrLiBPbjxicj4KdGhlIHRv ZG8gbGlzdC4uLjxicj4KPGJyPgpHPGJyPgo8Zm9udCBjb2xvcj0iIzg4ODg4OCI+LS08YnI+Cjwv Zm9udD48ZGl2PkdyZWdvcnkgQ29sbGlucyAmbHQ7PGEgaHJlZj0ibWFpbHRvOmdyZWdAZ3JlZ29y eWNvbGxpbnMubmV0IiB0YXJnZXQ9Il9ibGFuayI+Z3JlZ0BncmVnb3J5Y29sbGlucy5uZXQ8L2E+ Jmd0Ozxicj4KPC9kaXY+PC9kaXY+PC9kaXY+PGRpdiBjbGFzcz0iaW0iPjxkaXY+PGRpdj48L2Rp dj48ZGl2Pl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fPGJy Pgp3ZWItZGV2ZWwgbWFpbGluZyBsaXN0PGJyPgo8YSBocmVmPSJtYWlsdG86d2ViLWRldmVsQGhh c2tlbGwub3JnIiB0YXJnZXQ9Il9ibGFuayI+d2ViLWRldmVsQGhhc2tlbGwub3JnPC9hPjxicj4K PGEgaHJlZj0iaHR0cDovL3d3dy5oYXNrZWxsLm9yZy9tYWlsbWFuL2xpc3RpbmZvL3dlYi1kZXZl bCIgdGFyZ2V0PSJfYmxhbmsiPmh0dHA6Ly93d3cuaGFza2VsbC5vcmcvbWFpbG1hbi9saXN0aW5m by93ZWItZGV2ZWw8L2E+PGJyPgo8L2Rpdj48L2Rpdj48L2Rpdj48L2Jsb2NrcXVvdGU+PC9kaXY+ PGJyPgo8L2Rpdj4KPC9ibG9ja3F1b3RlPjwvZGl2Pjxicj48L2Rpdj48L2Rpdj4K --===============8996710967445544127==-- From greg@gregorycollins.net Tue May 25 09:12:39 2010 From: Gregory Collins To: web-devel@haskell.org Subject: Re: [web-devel] Re: ANNOUNCE: yesod 0.2.0 Date: Tue, 25 May 2010 09:46:48 -0400 Message-ID: <87hblwozzr.fsf@gregorycollins.net> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4462919535655131660==" --===============4462919535655131660== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit "Alberto G. Corona " writes: > Could your web-routes  be general enough to be integrated in other > frameworks?. du to my special requirements  I´m working on my own > app-server (persistence, clustering, state, threading, but not web > framework) and I would like to have web components available to put at > the top, rather than web frameworks. Yes web-routes is a generic package -- I would just be providing some helper code on top of it. Jeremy and I also discussed briefly whether we could port our simple O(log n) routing table stuff to web-routes so that other frameworks could use it. G -- Gregory Collins --===============4462919535655131660==-- From jaspervdj@gmail.com Thu May 27 02:42:31 2010 From: Jasper Van der Jeugt To: web-devel@haskell.org Subject: [web-devel] Google Summer of Code: BlazeHTML RFC Date: Thu, 27 May 2010 09:16:12 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0873749425979780457==" --===============0873749425979780457== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Dear all, BlazeHtml started out on ZuriHac 2010. Now, Jasper Van der Jeugt is working on it as a student to Google Summer of Code for haskell.org. His mentors are Simon Meier and Johan Tibell. The goal is to create a high-performance HTML generation library. In the past few weeks, we have been exploring the performance and design of different drafts of this library. Now, the time has come to ask some questions to the Haskell community — more specifically the future users of BlazeHtml as well as current users of other HTML generation libraries. We have written an RFC to gather feedback from the community: HTML version: http://jaspervdj.be/posts/2010-05-27-blazehtml-rfc.html Plain version: http://github.com/jaspervdj/BlazeHtml/raw/develop/doc/RFC.lhs The easiest way of sending us feedback, comments or criticism is replying to the haskell-cafe thread here. Alternatively, drop a comment at the bottom of the HTML version or at reddit. Looking forward to your feedback, Kind regards, Simon Meier Jasper Van der Jeugt --===============0873749425979780457==-- From michael@snoyman.com Thu May 27 03:21:22 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: [web-devel] Re: [Haskell-cafe] Google Summer of Code: BlazeHTML RFC Date: Thu, 27 May 2010 10:55:19 +0300 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5694276821946478159==" --===============5694276821946478159== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Two comments: * The exclamation point seems good enough for attributes. I copied that for Hamlet as well. * If you're standardizing on UTF-8, why not support bytestrings? I'm aware that a user could shoot him/herself in the foot by passing in non-UTF8 data, but I would imagine the performance gains would outweigh this. My recent benchmarks on the BigTable benchmark[1] imply a huge performance gap between ByteStrings and other contenders. As we've discussed before, I think combining BlazeHtml and Hamlet would be very nice, though I'm dubious that a BlazeHtml backend for Hamlet would be faster than a raw backend. Looking forward to hearing more progress, good luck! Michael [1] http://www.snoyman.com/blog/entry/bigtable-benchmarks/ On Thu, May 27, 2010 at 10:16 AM, Jasper Van der Jeugt wrote: > Dear all, > > BlazeHtml started out on ZuriHac 2010. Now, Jasper Van der Jeugt is > working on it as a student to Google Summer of Code for haskell.org. > His mentors are Simon Meier and Johan Tibell. The goal is to create a > high-performance HTML generation library. > > In the past few weeks, we have been exploring the performance and > design of different drafts of this library. Now, the time has come to > ask some questions to the Haskell community — more specifically the > future users of BlazeHtml as well as current users of other HTML > generation libraries. > > We have written an RFC to gather feedback from the community: > > HTML version: http://jaspervdj.be/posts/2010-05-27-blazehtml-rfc.html > Plain version: > http://github.com/jaspervdj/BlazeHtml/raw/develop/doc/RFC.lhs > > The easiest way of sending us feedback, comments or criticism is > replying to the haskell-cafe thread here. Alternatively, drop a > comment at the bottom of the HTML version or at reddit. > > Looking forward to your feedback, > Kind regards, > Simon Meier > Jasper Van der Jeugt > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > --===============5694276821946478159== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+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FjaywgY29tbWVudHMgb3IgY3JpdGljaXNtIGlz PGJyPgpyZXBseWluZyB0byB0aGUgaGFza2VsbC1jYWZlIHRocmVhZCBoZXJlLiBBbHRlcm5hdGl2 ZWx5LCBkcm9wIGE8YnI+CmNvbW1lbnQgYXQgdGhlIGJvdHRvbSBvZiB0aGUgSFRNTCB2ZXJzaW9u IG9yIGF0IHJlZGRpdC48YnI+Cjxicj4KTG9va2luZyBmb3J3YXJkIHRvIHlvdXIgZmVlZGJhY2ss PGJyPgpLaW5kIHJlZ2FyZHMsPGJyPgpTaW1vbiBNZWllcjxicj4KPGZvbnQgY29sb3I9IiM4ODg4 ODgiPkphc3BlciBWYW4gZGVyIEpldWd0PGJyPgpfX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fXzxicj4KSGFza2VsbC1DYWZlIG1haWxpbmcgbGlzdDxicj4KPGEg aHJlZj0ibWFpbHRvOkhhc2tlbGwtQ2FmZUBoYXNrZWxsLm9yZyI+SGFza2VsbC1DYWZlQGhhc2tl bGwub3JnPC9hPjxicj4KPGEgaHJlZj0iaHR0cDovL3d3dy5oYXNrZWxsLm9yZy9tYWlsbWFuL2xp c3RpbmZvL2hhc2tlbGwtY2FmZSIgdGFyZ2V0PSJfYmxhbmsiPmh0dHA6Ly93d3cuaGFza2VsbC5v cmcvbWFpbG1hbi9saXN0aW5mby9oYXNrZWxsLWNhZmU8L2E+PGJyPgo8L2ZvbnQ+PC9ibG9ja3F1 b3RlPjwvZGl2Pjxicj48L2Rpdj48L2Rpdj4K --===============5694276821946478159==-- From michael@snoyman.com Thu May 27 03:49:27 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: [web-devel] Re: [Haskell-cafe] Google Summer of Code: BlazeHTML RFC Date: Thu, 27 May 2010 11:23:33 +0300 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0737103669934642744==" --===============0737103669934642744== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Thu, May 27, 2010 at 11:16 AM, Ivan Miljenovic wrote: > On 27 May 2010 17:55, Michael Snoyman wrote: > > Two comments: > > * The exclamation point seems good enough for attributes. I copied that > for > > Hamlet as well. > > * If you're standardizing on UTF-8, why not support bytestrings? I'm > aware > > that a user could shoot him/herself in the foot by passing in non-UTF8 > data, > > but I would imagine the performance gains would outweigh this. My recent > > benchmarks on the BigTable benchmark[1] imply a huge performance gap > between > > ByteStrings and other contenders. > > Wow, I find it rather surprising that String out-performs Text; any > idea why that is? I wonder if you're just using it wrong... > > Could be, I'd be very happy if that were the case. All of the benchmarks are available on Github, and the bytestring[1], text[2] and string[3] versions are all rather short. Michael [1] http://github.com/snoyberg/benchmarks/blob/master/bigtable/cgi/bytestring.hs [2] http://github.com/snoyberg/benchmarks/blob/master/bigtable/cgi/text.hs [3] http://github.com/snoyberg/benchmarks/blob/master/bigtable/cgi/string.hs --===============0737103669934642744== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gVGh1LCBN YXkgMjcsIDIwMTAgYXQgMTE6MTYgQU0sIEl2YW4gTWlsamVub3ZpYyA8c3BhbiBkaXI9Imx0ciI+ Jmx0OzxhIGhyZWY9Im1haWx0bzppdmFuLm1pbGplbm92aWNAZ21haWwuY29tIj5pdmFuLm1pbGpl bm92aWNAZ21haWwuY29tPC9hPiZndDs8L3NwYW4+IHdyb3RlOjxicj48YmxvY2txdW90ZSBjbGFz cz0iZ21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46MCAwIDAgLjhleDtib3JkZXItbGVmdDoxcHgg I2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4OyI+CjxkaXYgY2xhc3M9ImltIj5PbiAyNyBNYXkg MjAxMCAxNzo1NSwgTWljaGFlbCBTbm95bWFuICZsdDs8YSBocmVmPS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2kvc3RyaW5nLmhzIj5odHRwOi8vZ2l0aHViLmNvbS9zbm95YmVyZy9iZW5j aG1hcmtzL2Jsb2IvbWFzdGVyL2JpZ3RhYmxlL2NnaS9zdHJpbmcuaHM8L2E+PC9kaXY+CjwvZGl2 PjwvZGl2Pgo= --===============0737103669934642744==-- From michael@snoyman.com Thu May 27 03:59:10 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: [web-devel] Re: [Haskell-cafe] Google Summer of Code: BlazeHTML RFC Date: Thu, 27 May 2010 11:33:21 +0300 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8436817962375408823==" --===============8436817962375408823== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Thu, May 27, 2010 at 11:28 AM, Ivan Miljenovic wrote: > On 27 May 2010 18:23, Michael Snoyman wrote: > > > > > > On Thu, May 27, 2010 at 11:16 AM, Ivan Miljenovic > > wrote: > >> > >> On 27 May 2010 17:55, Michael Snoyman wrote: > >> > Two comments: > >> > * The exclamation point seems good enough for attributes. I copied > that > >> > for > >> > Hamlet as well. > >> > * If you're standardizing on UTF-8, why not support bytestrings? I'm > >> > aware > >> > that a user could shoot him/herself in the foot by passing in non-UTF8 > >> > data, > >> > but I would imagine the performance gains would outweigh this. My > recent > >> > benchmarks on the BigTable benchmark[1] imply a huge performance gap > >> > between > >> > ByteStrings and other contenders. > >> > >> Wow, I find it rather surprising that String out-performs Text; any > >> idea why that is? I wonder if you're just using it wrong... > >> > > Could be, I'd be very happy if that were the case. All of the benchmarks > are > > available on Github, and the bytestring[1], text[2] and string[3] > versions > > are all rather short. > > Does using lazy Text values improve this? I find it a little strange > that you concatenate so many individual Strings that much. Also, how > about explicitly using Text values rather than OverloadedStrings? > > I don't do any string concatenation (look closely), I was very careful to avoid it. I tried with lazy text as well: it was slower. This isn't surprising, since lazy text- under the surface- is just a list of strict text. And the benchmark itself already has a lazy list of strict text. Using lazy text would just be adding a layer of wrapping. I don't know what you mean by "explicitly using Text values"; you mean calling pack manually? That's really all that OverloadedStrings does. You can try out lots of different variants on that benchmark. I did that already, and found this to be the fastest version. Michael --===============8436817962375408823== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gVGh1LCBN YXkgMjcsIDIwMTAgYXQgMTE6MjggQU0sIEl2YW4gTWlsamVub3ZpYyA8c3BhbiBkaXI9Imx0ciI+ Jmx0OzxhIGhyZWY9Im1haWx0bzppdmFuLm1pbGplbm92aWNAZ21haWwuY29tIj5pdmFuLm1pbGpl bm92aWNAZ21haWwuY29tPC9hPiZndDs8L3NwYW4+IHdyb3RlOjxicj48YmxvY2txdW90ZSBjbGFz cz0iZ21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46MCAwIDAgLjhleDtib3JkZXItbGVmdDoxcHgg I2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4OyI+CjxkaXYgY2xhc3M9ImltIj5PbiAyNyBNYXkg MjAxMCAxODoyMywgTWljaGFlbCBTbm95bWFuICZsdDs8YSBocmVmPSJtYWlsdG86bWljaGFlbEBz bm95bWFuLmNvbSI+bWljaGFlbEBzbm95bWFuLmNvbTwvYT4mZ3Q7IHdyb3RlOjxicj4KJmd0Ozxi cj4KJmd0Ozxicj4KJmd0OyBPbiBUaHUsIE1heSAyNywgMjAxMCBhdCAxMToxNiBBTSwgSXZhbiBN aWxqZW5vdmljPGJyPgomZ3Q7ICZsdDs8YSBocmVmPSJtYWlsdG86aXZhbi5taWxqZW5vdmljQGdt YWlsLmNvbSI+aXZhbi5taWxqZW5vdmljQGdtYWlsLmNvbTwvYT4mZ3Q7IHdyb3RlOjxicj4KJmd0 OyZndDs8YnI+CiZndDsmZ3Q7IE9uIDI3IE1heSAyMDEwIDE3OjU1LCBNaWNoYWVsIFNub3ltYW4g Jmx0Ozxh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sbDogaXQgd2FzIHNsb3dlci4gVGhpcyBpc24mIzM5O3Qgc3VycHJpc2luZywg c2luY2UgbGF6eSB0ZXh0LSB1bmRlciB0aGUgc3VyZmFjZS0gaXMganVzdCBhIGxpc3Qgb2Ygc3Ry aWN0IHRleHQuIEFuZCB0aGUgYmVuY2htYXJrIGl0c2VsZiBhbHJlYWR5IGhhcyBhIGxhenkgbGlz dCBvZiBzdHJpY3QgdGV4dC4gVXNpbmcgbGF6eSB0ZXh0IHdvdWxkIGp1c3QgYmUgYWRkaW5nIGEg bGF5ZXIgb2Ygd3JhcHBpbmcuPC9kaXY+CjxkaXY+PGJyPjwvZGl2PjxkaXY+SSBkb24mIzM5O3Qg a25vdyB3aGF0IHlvdSBtZWFuIGJ5ICZxdW90O2V4cGxpY2l0bHkgdXNpbmcgVGV4dCB2YWx1ZXMm cXVvdDs7IHlvdSBtZWFuIGNhbGxpbmcgcGFjayBtYW51YWxseT8gVGhhdCYjMzk7cyByZWFsbHkg YWxsIHRoYXQgT3ZlcmxvYWRlZFN0cmluZ3MgZG9lcy48L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2 PllvdSBjYW4gdHJ5IG91dCBsb3RzIG9mIGRpZmZlcmVudCB2YXJpYW50cyBvbiB0aGF0IGJlbmNo bWFyay4gSSBkaWQgdGhhdCBhbHJlYWR5LCBhbmQgZm91bmQgdGhpcyB0byBiZSB0aGUgZmFzdGVz dCB2ZXJzaW9uLsKgPC9kaXY+CjxkaXY+PGJyPjwvZGl2PjxkaXY+TWljaGFlbDwvZGl2PjwvZGl2 PjwvZGl2Pgo= --===============8436817962375408823==-- From v.dijk.bas@gmail.com Thu May 27 04:04:27 2010 From: Bas van Dijk To: web-devel@haskell.org Subject: [web-devel] Re: [Haskell-cafe] Google Summer of Code: BlazeHTML RFC Date: Thu, 27 May 2010 10:38:17 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1117301109286249429==" --===============1117301109286249429== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Q14: Do you see any problems with respect to integrating BlazeHtml in your favourite web-framework/server? How about also providing an enumerator back-end? http://hackage.haskell.org/packages/archive/iteratee/0.3.5/doc/html/Data-Iter= atee-Base.html#t%3AEnumeratorGM Then your library can integrate more easily with the snap framework: http://snapframework.com Regards, Bas --===============1117301109286249429==-- From michael@snoyman.com Thu May 27 04:24:12 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: [web-devel] Re: [Haskell-cafe] Google Summer of Code: BlazeHTML RFC Date: Thu, 27 May 2010 11:53:10 +0300 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7441962648479322897==" --===============7441962648479322897== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Thu, May 27, 2010 at 11:40 AM, Ivan Miljenovic wrote: > On 27 May 2010 18:33, Michael Snoyman wrote: > > I don't do any string concatenation (look closely), I was very careful to > > avoid it. I tried with lazy text as well: it was slower. This isn't > > surprising, since lazy text- under the surface- is just a list of strict > > text. And the benchmark itself already has a lazy list of strict text. > Using > > lazy text would just be adding a layer of wrapping. > > I don't know what you mean by "explicitly using Text values"; you mean > > calling pack manually? That's really all that OverloadedStrings does. > > You can try out lots of different variants on that benchmark. I did that > > already, and found this to be the fastest version. > > Fair enough. Now that I think about it, I recall once trying to have > pretty generate Text values rather than String for graphviz (by using > fullRender, so it was still using String under the hood until it came > time to render) and it too was much slower than String (unfortunately, > I didn't record a patch with these changes so I can't just go back and > play with it anymore as I reverted them all :s). > > Maybe Bryan can chime in with some best-practices for using Text? > > Here's my guess at an explanation for what's happening in my benchmark: text will clearly beat String in memory usage, that's what it's designed for. However, the compiler is still generating String values which are being encoded to Text as runtime. Now, this is the same process for bytestrings. However, bytestrings never have to be decoded: the IO routines simply read the character buffer. In the case of text, however, the encoded data must be decoded again to a bytestring. In other words, here's what I think the three different benchmarks are really doing: * String: generates a list of Strings, passes each String to a relatively inefficient IO routine. * ByteString: encodes Strings one by one into ByteStrings, generates a list of these ByteStrings, and passes each ByteString to a very efficient IO routine. : Text: encodes Strings one by one into Texts, generates a list of these Texts, calls a UTF-8 decoding function to decode each Text into a ByteString, and passes each resulting ByteString to a very efficient IO routine. In the case of ASCII data to be output as UTF-8, uses the Data.ByteString.Char8.pack function will most likely always be the most efficient choice, and thus it seems like something BlazeHtml should support. I'm considering releasing a Hamlet 0.3 based entirely on UTF-8 encoded ByteStrings, but I'd also like to hear from Bryan about this. Michael --===============7441962648479322897== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gVGh1LCBN YXkgMjcsIDIwMTAgYXQgMTE6NDAgQU0sIEl2YW4gTWlsamVub3ZpYyA8c3BhbiBkaXI9Imx0ciI+ Jmx0OzxhIGhyZWY9Im1haWx0bzppdmFuLm1pbGplbm92aWNAZ21haWwuY29tIj5pdmFuLm1pbGpl bm92aWNAZ21haWwuY29tPC9hPiZndDs8L3NwYW4+IHdyb3RlOjxicj48YmxvY2txdW90ZSBjbGFz cz0iZ21haWxfcXVvdGUiIHN0eWxlPSJtYXJnaW46MCAwIDAgLjhleDtib3JkZXItbGVmdDoxcHgg I2NjYyBzb2xpZDtwYWRkaW5nLWxlZnQ6MWV4OyI+CjxkaXYgY2xhc3M9ImltIj5PbiAyNyBNYXkg MjAxMCAxODozMywgTWljaGFlbCBTbm95bWFuICZsdDs8YSBocmVmPSJtYWlsdG86bWljaGFlbEBz bm95bWFuLmNvbSI+bWljaGFlbEBzbm95bWFuLmNvbTwvYT4mZ3Q7IHdyb3RlOjxicj4KJmd0OyBJ IGRvbiYjMzk7dCBkbyBhbnkgc3RyaW5nIGNvbmNhdGVuYXRpb24gKGxvb2sgY2xvc2VseSksIEkg d2FzIHZlcnkgY2FyZWZ1bCB0bzxicj4KJmd0OyBhdm9p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5nIEJ5dGVTdHJpbmcgdG8g YSB2ZXJ5IGVmZmljaWVudCBJTyByb3V0aW5lLjwvZGl2Pgo8ZGl2Pjxicj48L2Rpdj48ZGl2Pklu IHRoZSBjYXNlIG9mIEFTQ0lJIGRhdGEgdG8gYmUgb3V0cHV0IGFzIFVURi04LCB1c2VzIHRoZSBE YXRhLkJ5dGVTdHJpbmcuQ2hhcjgucGFjayBmdW5jdGlvbiB3aWxsIG1vc3QgbGlrZWx5IGFsd2F5 cyBiZSB0aGUgbW9zdCBlZmZpY2llbnQgY2hvaWNlLCBhbmQgdGh1cyBpdCBzZWVtcyBsaWtlIHNv bWV0aGluZyBCbGF6ZUh0bWwgc2hvdWxkIHN1cHBvcnQuIEkmIzM5O20gY29uc2lkZXJpbmcgcmVs ZWFzaW5nIGEgSGFtbGV0IDAuMyBiYXNlZCBlbnRpcmVseSBvbiBVVEYtOCBlbmNvZGVkIEJ5dGVT dHJpbmdzLCBidXQgSSYjMzk7ZCBhbHNvIGxpa2UgdG8gaGVhciBmcm9tIEJyeWFuIGFib3V0IHRo aXMuPC9kaXY+CjxkaXY+PGJyPjwvZGl2PjxkaXY+TWljaGFlbDwvZGl2PjwvZGl2PjwvZGl2Pgo= --===============7441962648479322897==-- From jaspervdj@gmail.com Thu May 27 04:24:20 2010 From: Jasper Van der Jeugt To: web-devel@haskell.org Subject: [web-devel] Re: [Haskell-cafe] Google Summer of Code: BlazeHTML RFC Date: Thu, 27 May 2010 10:48:54 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7540988754614669180==" --===============7540988754614669180== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hey Bas, > How about also providing an enumerator back-end? > http://hackage.haskell.org/packages/archive/iteratee/0.3.5/doc/html/Data-It= eratee-Base.html#t%3AEnumeratorGM > > Then your library can integrate more easily with the snap framework: > http://snapframework.com Sure, I can do that. But I already tested integration with the snap framework, the best path here seems to call the `writeLBS` function from the snap framework on the `L.ByteString` that BlazeHtml produces (`writeLBS` internally uses an enumerator). Kind regards, Jasper Van der Jeugt On Thu, May 27, 2010 at 10:38 AM, Bas van Dijk wrote: > Q14: Do you see any problems with respect to integrating BlazeHtml in > your favourite web-framework/server? > > How about also providing an enumerator back-end? > http://hackage.haskell.org/packages/archive/iteratee/0.3.5/doc/html/Data-It= eratee-Base.html#t%3AEnumeratorGM > > Then your library can integrate more easily with the snap framework: > http://snapframework.com > > Regards, > > Bas > --===============7540988754614669180==-- From v.dijk.bas@gmail.com Thu May 27 05:02:36 2010 From: Bas van Dijk To: web-devel@haskell.org Subject: [web-devel] Re: [Haskell-cafe] Google Summer of Code: BlazeHTML RFC Date: Thu, 27 May 2010 11:36:30 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4406224062681963332==" --===============4406224062681963332== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Thu, May 27, 2010 at 10:48 AM, Jasper Van der Jeugt wrote: >> How about also providing an enumerator back-end? >> http://hackage.haskell.org/packages/archive/iteratee/0.3.5/doc/html/Data-I= teratee-Base.html#t%3AEnumeratorGM >> >> Then your library can integrate more easily with the snap framework: >> http://snapframework.com > > Sure, I can do that. But I already tested integration with the snap > framework, the best path here seems to call the `writeLBS` function > from the snap framework on the `L.ByteString` that BlazeHtml produces > (`writeLBS` internally uses an enumerator). I think it's worth analyzing if using enumerators directly gives a significant performance improvement over converting from lazy ByteStrings. Looking a the conversion functions in the snap framework it looks like we can avoid some intermediate lists for one: writeLBS :: L.ByteString -> Snap () writeLBS s =3D addToOutput $ enumLBS s addToOutput :: (forall a . Enumerator a) -> Snap () addToOutput enum =3D modifyResponse $ modifyResponseBody (>. enum) enumLBS :: (Monad m) =3D> L.ByteString -> Enumerator m a enumLBS lbs iter =3D foldM k iter enums where enums =3D map (enumPure1Chunk . WrapBS) $ L.toChunks lbs k i e =3D e i -- from iteratee: enumPure1Chunk :: (SC.StreamChunk s el, Monad m) =3D> s el -> EnumeratorGM s el m a enumPure1Chunk str iter =3D runIter iter (Chunk str) >>=3D checkIfDone return Regards, Bas --===============4406224062681963332==-- From johan.tibell@gmail.com Thu May 27 05:26:45 2010 From: Johan Tibell To: web-devel@haskell.org Subject: [web-devel] Re: [Haskell-cafe] Google Summer of Code: BlazeHTML RFC Date: Thu, 27 May 2010 11:57:42 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4886547977811252718==" --===============4886547977811252718== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Thu, May 27, 2010 at 10:23 AM, Michael Snoyman wrote: > On Thu, May 27, 2010 at 11:16 AM, Ivan Miljenovic < > ivan.miljenovic@gmail.com> wrote: > >> Wow, I find it rather surprising that String out-performs Text; any >> idea why that is? I wonder if you're just using it wrong... >> >> Could be, I'd be very happy if that were the case. All of the benchmarks > are available on Github, and the bytestring[1], text[2] and string[3] > versions are all rather short. > Do you include the cost of encoding the result as e.g. UTF-8? The hope would be that the more compact Text would be faster to traverse, and thus encode, than the list based String. --===============4886547977811252718== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBjbGFzcz0iZ21haWxfcXVvdGUiPk9uIFRodSwgTWF5IDI3LCAyMDEwIGF0IDEwOjIzIEFN LCBNaWNoYWVsIFNub3ltYW4gPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBocmVmPSJtYWlsdG86bWlj aGFlbEBzbm95bWFuLmNvbSI+bWljaGFlbEBzbm95bWFuLmNvbTwvYT4mZ3Q7PC9zcGFuPiB3cm90 ZTo8YnI+PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0iYm9yZGVyLWxlZnQ6 IDFweCBzb2xpZCByZ2IoMjA0LCAyMDQsIDIwNCk7IG1hcmdpbjogMHB0IDBwdCAwcHQgMC44ZXg7 IHBhZGRpbmctbGVmdDog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aW9ucyBhcmUgYWxsIHJhdGhlciBzaG9ydC48L2Rpdj4KCjwvZGl2PjwvZGl2PjwvYmxvY2txdW90 ZT48L2Rpdj48YnI+RG8geW91IGluY2x1ZGUgdGhlIGNvc3Qgb2YgZW5jb2RpbmcgdGhlIHJlc3Vs dCBhcyBlLmcuIFVURi04PyBUaGUgaG9wZSB3b3VsZCBiZSB0aGF0IHRoZSBtb3JlIGNvbXBhY3Qg VGV4dCB3b3VsZCBiZSBmYXN0ZXIgdG8gdHJhdmVyc2UsIGFuZCB0aHVzIGVuY29kZSwgdGhhbiB0 aGUgbGlzdCBiYXNlZCBTdHJpbmcuPGJyPjxicj4KCg== --===============4886547977811252718==-- From michael@snoyman.com Thu May 27 05:34:58 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: [web-devel] Re: [Haskell-cafe] Google Summer of Code: BlazeHTML RFC Date: Thu, 27 May 2010 13:01:34 +0300 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5766492836505588596==" --===============5766492836505588596== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Thu, May 27, 2010 at 12:57 PM, Johan Tibell wrote: > On Thu, May 27, 2010 at 10:23 AM, Michael Snoyman wrot= e: > >> On Thu, May 27, 2010 at 11:16 AM, Ivan Miljenovic < >> ivan.miljenovic@gmail.com> wrote: >> >>> Wow, I find it rather surprising that String out-performs Text; any >>> idea why that is? I wonder if you're just using it wrong... >>> >>> Could be, I'd be very happy if that were the case. All of the benchmarks >> are available on Github, and the bytestring[1], text[2] and string[3] >> versions are all rather short. >> > > Do you include the cost of encoding the result as e.g. UTF-8? The hope > would be that the more compact Text would be faster to traverse, and thus > encode, than the list based String. > > No, but this is done on purpose. One of my goals in this benchmark was to determine whether I should consider switching Hamlet to ByteStrings. If I were to do so, then the UTF-8 encoding would be done at compile-time instead of run-time. You're correct that a fair comparison would be to UTF-8 encode the Strings as well. However, that's not what most users are going to do most of the time: when dealing with ASCII data, a straight Char8.pack encoding will do the same as UTF-8. I'm simply pointing out that I think Blaze should support this style. Michael --===============5766492836505588596== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+PGJyPjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+T24gVGh1LCBN YXkgMjcsIDIwMTAgYXQgMTI6NTcgUE0sIEpvaGFuIFRpYmVsbCA8c3BhbiBkaXI9Imx0ciI+Jmx0 OzxhIGhyZWY9Im1haWx0bzpqb2hhbi50aWJlbGxAZ21haWwuY29tIj5qb2hhbi50aWJlbGxAZ21h aWwuY29tPC9hPiZndDs8L3NwYW4+IHdyb3RlOjxicj48YmxvY2txdW90ZSBjbGFzcz0iZ21haWxf cXVvdGUiIHN0eWxlPSJtYXJnaW46MCAwIDAgLjhleDtib3JkZXItbGVmdDoxcHggI2NjYyBzb2xp ZDtwYWRkaW5nLWxlZnQ6MWV4OyI+CjxkaXYgY2xhc3M9ImdtYWlsX3F1b3RlIj48ZGl2IGNsYXNz PSJpbSI+T24gVGh1LCBNYXkgMjcsIDIwMTAgYXQgMTA6MjMgQU0sIE1pY2hhZWwgU25veW1hbiA8 c3BhbiBkaXI9Imx0ciI+Jmx0OzxhIGhyZWY9Im1haWx0bzptaWNoYWVsQHNub3ltYW4uY29tIiB0 YXJnZXQ9Il9ibGFuayI+bWljaGFlbEBzbm95bWFuLmNvbTwvYT4mZ3Q7PC9zcGFuPiB3cm90ZTo8 YnI+PC9kaXY+PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWlsX3F1b3RlIiBzdHlsZT0iYm9yZGVyLWxl ZnQ6MXB4IHNvbGlkIHJnYigyMDQsIDIwNCwgMjA0KTttYXJnaW46MHB0IDBwdCAwcHQgMC44ZXg7 cGFkZGluZy1sZWZ0OjFleCI+CgoKPGRpdiBkaXI9Imx0ciI+PGRpdiBjbGFzcz0iZ21haWxfcXVv dGUiPjxkaXY+PGRp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k7bSBzaW1wbHkgcG9p bnRpbmcgb3V0IHRoYXQgSSB0aGluayBCbGF6ZSBzaG91bGQgc3VwcG9ydCB0aGlzIHN0eWxlLjwv ZGl2Pgo8ZGl2Pjxicj48L2Rpdj48ZGl2Pk1pY2hhZWw8L2Rpdj48L2Rpdj4K --===============5766492836505588596==-- From johan.tibell@gmail.com Thu May 27 05:58:18 2010 From: Johan Tibell To: web-devel@haskell.org Subject: [web-devel] Re: [Haskell-cafe] Google Summer of Code: BlazeHTML RFC Date: Thu, 27 May 2010 12:30:06 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6069043315293607904==" --===============6069043315293607904== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Thu, May 27, 2010 at 10:53 AM, Michael Snoyman wrote: > In other words, here's what I think the three different benchmarks are > really doing: > > * String: generates a list of Strings, passes each String to a relatively > inefficient IO routine. > * ByteString: encodes Strings one by one into ByteStrings, generates a list > of these ByteStrings, and passes each ByteString to a very efficient IO > routine. > : Text: encodes Strings one by one into Texts, generates a list of these > Texts, calls a UTF-8 decoding function to decode each Text into a > ByteString, and passes each resulting ByteString to a very efficient IO > routine. > If Text used UTF-8 internally rather than UTF-16 we could create Texts from string literals much more efficiently, in the same manner as done in Char8.pack for bytestrings: {-# RULES "FPS pack/packAddress" forall s . pack (unpackCString# s) = inlinePerformIO (B.unsafePackAddress s) #-} This rule skips the creation of an intermediate String when packing a string literal by having the created ByteString point directly to the memory GHC allocates (outside the heap) for the string literal. This rule could be added directly to a builder monoid for lazy Texts so that no copying is done at all. In addition, if Text was internally represented using UTF-8 encodeUtf8 would be free. Johan --===============6069043315293607904== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBjbGFzcz0iZ21haWxfcXVvdGUiPk9uIFRodSwgTWF5IDI3LCAyMDEwIGF0IDEwOjUzIEFN LCBNaWNoYWVsIFNub3ltYW4g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weWluZyBpcyBkb25l IGF0IGFsbC4gSW4gYWRkaXRpb24sIGlmIFRleHQgd2FzIGludGVybmFsbHkgcmVwcmVzZW50ZWQg dXNpbmcgVVRGLTggZW5jb2RlVXRmOCB3b3VsZCBiZSBmcmVlLjxicj4KCjxicj5Kb2hhbjxicj48 YnI+PC9kaXY+PC9kaXY+Cg== --===============6069043315293607904==-- From agocorona@gmail.com Thu May 27 06:44:54 2010 From: "Alberto G. Corona" To: web-devel@haskell.org Subject: [web-devel] Re: [Haskell-cafe] Google Summer of Code: BlazeHTML RFC Date: Thu, 27 May 2010 13:08:04 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6257824558617339737==" --===============6257824558617339737== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable As a user, I have too many HTML generators, a few of them with Ajax and none with server-side event handling (like ASPX or JSPX). Ajax is complicated but server side event handling is what I really miss because it is simple from the user point of view, my ervents could be handled in haskell code rather than in javaScript and I implicitly could use the advantages of dinamic HTML and Ajax without the need to know them at all. Imagine a dynamic Web application with 100% haskell code made with dynamic widgets created by third party developers. So, anyone want to create a HTML templating system with server side event handling? It is not terribly hard to do. (I refer to ASP.NET documentation or the JavaServer Faces framework). By the way, I vote for XML templating or else, combinator templating that produce XHML templating because it can be handled by a future graphical IDE. 2010/5/27 Jasper Van der Jeugt > Hey Bas, > > > How about also providing an enumerator back-end? > > > http://hackage.haskell.org/packages/archive/iteratee/0.3.5/doc/html/Data-It= eratee-Base.html#t%3AEnumeratorGM > > > > Then your library can integrate more easily with the snap framework: > > http://snapframework.com > > Sure, I can do that. But I already tested integration with the snap > framework, the best path here seems to call the `writeLBS` function > from the snap framework on the `L.ByteString` that BlazeHtml produces > (`writeLBS` internally uses an enumerator). > > Kind regards, > Jasper Van der Jeugt > > On Thu, May 27, 2010 at 10:38 AM, Bas van Dijk > wrote: > > Q14: Do you see any problems with respect to integrating BlazeHtml in > > your favourite web-framework/server? > > > > How about also providing an enumerator back-end? > > > http://hackage.haskell.org/packages/archive/iteratee/0.3.5/doc/html/Data-It= eratee-Base.html#t%3AEnumeratorGM > > > > Then your library can integrate more easily with the snap framework: > > http://snapframework.com > > > > Regards, > > > > Bas > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > --===============6257824558617339737== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 QXMgYSB1c2VyLCBJIGhhdmUgdG9vIG1hbnkgSFRNTCBnZW5lcmF0b3JzLCBhIGZldyBvZiB0aGVt IHdpdGggQWpheCBhbmQgbm9uZSB3aXRoIHNlcnZlci1zaWRlIGV2ZW50IGhhbmRsaW5nIChsaWtl IEFTUFggb3IgSlNQWCkuIKBBamF4IGlzIGNvbXBsaWNhdGVkIGJ1dCBzZXJ2ZXIgc2lkZSBldmVu dCBoYW5kbGluZyBpcyCgd2hhdCBJIHJlYWxseSBtaXNzIGJlY2F1c2UgaXQgaXMgc2ltcGxlIKBm cm9tIHRoZSB1c2VyIHBvaW50IG9mIHZpZXcsIG15IGVydmVudHMgY291bGQgYmUgaGFuZGxlZCBp biBoYXNrZWxsIGNvZGUgcmF0aGVyIHRoYW4gaW4gamF2YVNjcmlwdCBhbmQgSSCgaW1wbGljaXRs eSBjb3VsZCCgdXNlIHRoZSBhZHZhbnRhZ2VzIG9mIKBkaW5hbWljIEhUTUwgYW5kIEFqYXggd2l0 aG91dCB0aGUgbmVlZCB0byBrbm93IHRoZW0gYXQgYWxsLqA8ZGl2Pgo8YnI+PC9kaXY+PGRpdj5J bWFnaW5lIGEgZHluYW1pYyBXZWIgYXBwbGljYXRpb24goHdpdGggMTAwJSBoYXNrZWxsIGNvZGUg bWFkZSB3aXRoIGR5bmFtaWMgd2lkZ2V0cyBjcmVhdGVkIGJ5IHRoaXJkIHBhcnR5IGRldmVsb3Bl cnMuPGRpdj48YnI+PC9kaXY+PG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iZndDs8YnI+ Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fPGJyPgpIYXNr ZWxsLUNhZmUgbWFpbGluZyBsaXN0PGJyPgo8YSBocmVmPSJtYWlsdG86SGFza2VsbC1DYWZlQGhh c2tlbGwub3JnIj5IYXNrZWxsLUNhZmVAaGFza2VsbC5vcmc8L2E+PGJyPgo8YSBocmVmPSJodHRw Oi8vd3d3Lmhhc2tlbGwub3JnL21haWxtYW4vbGlzdGluZm8vaGFza2VsbC1jYWZlIiB0YXJnZXQ9 Il9ibGFuayI+aHR0cDovL3d3dy5oYXNrZWxsLm9yZy9tYWlsbWFuL2xpc3RpbmZvL2hhc2tlbGwt Y2FmZTwvYT48YnI+CjwvZGl2PjwvZGl2PjwvYmxvY2txdW90ZT48L2Rpdj48YnI+PC9kaXY+PC9k aXY+Cg== --===============6257824558617339737==-- From moonmaster9000@gmail.com Thu May 27 11:46:04 2010 From: Matt Parker To: web-devel@haskell.org Subject: Re: [web-devel] Re: [Haskell-cafe] Google Summer of Code: BlazeHTML RFC Date: Thu, 27 May 2010 12:19:59 -0400 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0660303850700195761==" --===============0660303850700195761== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Blaze HTML looks wonderful to me (especially with the do notation), and better then Hamlet for one reason: writing idiomatic haskell for stuff like this: ul $ forM_ [1, 2, 3] (li . string . show) instead of the Hamlet style: %ul $forall children.person child %li $child$ which, i don't know, for some reason, made me feel like i was back in PHP land. -matt The problem i have with Hamlet is the "forAll x xs" stuff On Thu, May 27, 2010 at 7:08 AM, Alberto G. Corona wrote: > As a user, I have too many HTML generators, a few of them with Ajax and > none with server-side event handling (like ASPX or JSPX). Ajax is > complicated but server side event handling is what I really miss because it > is simple from the user point of view, my ervents could be handled in > haskell code rather than in javaScript and I implicitly could use the > advantages of dinamic HTML and Ajax without the need to know them at all. > > Imagine a dynamic Web application with 100% haskell code made with dynamic > widgets created by third party developers. > > So, anyone want to create a HTML templating system with server side event > handling? It is not terribly hard to do. (I refer to ASP.NET documentation > or the JavaServer Faces framework). > > By the way, I vote for XML templating or else, combinator templating that > produce XHML templating because it can be handled by a future graphical IDE. > > 2010/5/27 Jasper Van der Jeugt > >> Hey Bas, >> >> > How about also providing an enumerator back-end? >> > >> http://hackage.haskell.org/packages/archive/iteratee/0.3.5/doc/html/Data-I= teratee-Base.html#t%3AEnumeratorGM >> > >> > Then your library can integrate more easily with the snap framework: >> > http://snapframework.com >> >> Sure, I can do that. But I already tested integration with the snap >> framework, the best path here seems to call the `writeLBS` function >> from the snap framework on the `L.ByteString` that BlazeHtml produces >> (`writeLBS` internally uses an enumerator). >> >> Kind regards, >> Jasper Van der Jeugt >> >> On Thu, May 27, 2010 at 10:38 AM, Bas van Dijk >> wrote: >> > Q14: Do you see any problems with respect to integrating BlazeHtml in >> > your favourite web-framework/server? >> > >> > How about also providing an enumerator back-end? >> > >> http://hackage.haskell.org/packages/archive/iteratee/0.3.5/doc/html/Data-I= teratee-Base.html#t%3AEnumeratorGM >> > >> > Then your library can integrate more easily with the snap framework: >> > http://snapframework.com >> > >> > Regards, >> > >> > Bas >> > >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe@haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > > --===============0660303850700195761== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 QmxhemUgSFRNTCBsb29rcyB3b25kZXJmdWwgdG8gbWUgKGVzcGVjaWFsbHkgd2l0aCB0aGUgZG8g bm90YXRpb24pLCBhbmQgYmV0dGVyIHRoZW4gSGFtbGV0IGZvciBvbmUgcmVhc29uOiB3cml0aW5n IGlkaW9tYXRpYyBoYXNrZWxsIGZvciBzdHVmZiBsaWtlIHR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GV2ZWwiIHRhcmdldD0iX2JsYW5rIj5odHRwOi8vd3d3Lmhhc2tlbGwub3Jn L21haWxtYW4vbGlzdGluZm8vd2ViLWRldmVsPC9hPjxicj4KPGJyPjwvYmxvY2txdW90ZT48L2Rp dj48YnI+Cg== --===============0660303850700195761==-- From moonmaster9000@gmail.com Thu May 27 14:11:27 2010 From: Matt Parker To: web-devel@haskell.org Subject: Re: [web-devel] Re: [Haskell-cafe] Google Summer of Code: BlazeHTML RFC Date: Thu, 27 May 2010 14:31:24 -0400 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3828853763413887729==" --===============3828853763413887729== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable will it be possible to easily interleave IO values into the HTML? like instead of the [1,2,3] ul $ forM_ [1, 2, 3] (li . string . show) what if it was a function that returned IO [1,2,3] (maybe 1,2,3 came out of a database). will the forM_ handle that OK? On Thu, May 27, 2010 at 12:19 PM, Matt Parker wrote: > Blaze HTML looks wonderful to me (especially with the do notation), and > better then Hamlet for one reason: writing idiomatic haskell for stuff like > this: > > ul $ forM_ [1, 2, 3] (li . string . show) > > instead of the Hamlet style: > > %ul > $forall children.person child > %li $child$ > > which, i don't know, for some reason, made me feel like i was back in PHP > land. > > -matt > > > On Thu, May 27, 2010 at 7:08 AM, Alberto G. Corona wro= te: > >> As a user, I have too many HTML generators, a few of them with Ajax and >> none with server-side event handling (like ASPX or JSPX). Ajax is >> complicated but server side event handling is what I really miss because = it >> is simple from the user point of view, my ervents could be handled in >> haskell code rather than in javaScript and I implicitly could use the >> advantages of dinamic HTML and Ajax without the need to know them at all. >> >> Imagine a dynamic Web application with 100% haskell code made with >> dynamic widgets created by third party developers. >> >> So, anyone want to create a HTML templating system with server side event >> handling? It is not terribly hard to do. (I refer to ASP.NETdocumentation = or the JavaServer Faces framework). >> >> By the way, I vote for XML templating or else, combinator templating that >> produce XHML templating because it can be handled by a future graphical ID= E. >> >> 2010/5/27 Jasper Van der Jeugt >> >>> Hey Bas, >>> >>> > How about also providing an enumerator back-end? >>> > >>> http://hackage.haskell.org/packages/archive/iteratee/0.3.5/doc/html/Data-= Iteratee-Base.html#t%3AEnumeratorGM >>> > >>> > Then your library can integrate more easily with the snap framework: >>> > http://snapframework.com >>> >>> Sure, I can do that. But I already tested integration with the snap >>> framework, the best path here seems to call the `writeLBS` function >>> from the snap framework on the `L.ByteString` that BlazeHtml produces >>> (`writeLBS` internally uses an enumerator). >>> >>> Kind regards, >>> Jasper Van der Jeugt >>> >>> On Thu, May 27, 2010 at 10:38 AM, Bas van Dijk >>> wrote: >>> > Q14: Do you see any problems with respect to integrating BlazeHtml in >>> > your favourite web-framework/server? >>> > >>> > How about also providing an enumerator back-end? >>> > >>> http://hackage.haskell.org/packages/archive/iteratee/0.3.5/doc/html/Data-= Iteratee-Base.html#t%3AEnumeratorGM >>> > >>> > Then your library can integrate more easily with the snap framework: >>> > http://snapframework.com >>> > >>> > Regards, >>> > >>> > Bas >>> > >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe@haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >> >> >> _______________________________________________ >> web-devel mailing list >> web-devel@haskell.org >> http://www.haskell.org/mailman/listinfo/web-devel >> >> > --===============3828853763413887729== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 d2lsbCBpdCBiZSBwb3NzaWJsZSB0byBlYXNpbHkgaW50ZXJsZWF2ZSBJTyB2YWx1ZXMgaW50byB0 aGUgSFRNTD8gbGlrZSBpbnN0ZWFkIG9mIHRoZSBbMSwyLDNdPGJyPjxwcmU+PGNvZGU+PHNwYW4+ dWwgJCBmb3JNXyBbPC9zcGFuPjxzcGFuPjE8L3NwYW4+PHNwYW4+LCA8L3NwYW4+PHNwYW4+Mjwv c3Bhbj48c3Bhbj4sIDwvc3Bhbj48c3Bhbj4zPC9zcGFuPjxzcGFuPl0gKGxpIC4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GJyPgo8YSBocmVmPSJodHRw Oi8vd3d3Lmhhc2tlbGwub3JnL21haWxtYW4vbGlzdGluZm8vaGFza2VsbC1jYWZlIiB0YXJnZXQ9 Il9ibGFuayI+aHR0cDovL3d3dy5oYXNrZWxsLm9yZy9tYWlsbWFuL2xpc3RpbmZvL2hhc2tlbGwt Y2FmZTwvYT48YnI+CjwvZGl2PjwvZGl2PjwvYmxvY2txdW90ZT48L2Rpdj48YnI+PC9kaXY+PC9k aXY+Cjxicj48L2Rpdj48L2Rpdj5fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fXzxicj4Kd2ViLWRldmVsIG1haWxpbmcgbGlzdDxicj4KPGEgaHJlZj0ibWFpbHRv OndlYi1kZXZlbEBoYXNrZWxsLm9yZyIgdGFyZ2V0PSJfYmxhbmsiPndlYi1kZXZlbEBoYXNrZWxs Lm9yZzwvYT48YnI+CjxhIGhyZWY9Imh0dHA6Ly93d3cuaGFza2VsbC5vcmcvbWFpbG1hbi9saXN0 aW5mby93ZWItZGV2ZWwiIHRhcmdldD0iX2JsYW5rIj5odHRwOi8vd3d3Lmhhc2tlbGwub3JnL21h aWxtYW4vbGlzdGluZm8vd2ViLWRldmVsPC9hPjxicj4KPGJyPjwvYmxvY2txdW90ZT48L2Rpdj48 YnI+CjwvYmxvY2txdW90ZT48L2Rpdj48YnI+Cg== --===============3828853763413887729==-- From simon@joyful.com Thu May 27 22:30:19 2010 From: Simon Michael To: web-devel@haskell.org Subject: [web-devel] Re: Call for comments: Yesod 0.2 Date: Fri, 28 May 2010 03:04:24 +0000 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0078857866575362224==" --===============0078857866575362224== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Michael Snoyman writes: > Unfortunately, it really does require 6.12. The issue is that we need to > automatically generate a type instance for "Routes". While 6.10 supports > type instances, it doesn't include that support in the template haskell. > If people are interested, I think it would be possible to make the > Routes type instance dependent upon the template-haskell version number, > and then users would need to declare it themselves. Hi Michael, congrats on Yesod 0.2 and the good website updates. Count me as interested in 6.10 compatibility - I can't require 6.12 for while yet. FWIW I'm yet not sold on Hamlet's look and feel or in- haskell html generation, I'd like to give yesod + hstringtemplates another whirl. I am interested in the extras like your authentication and form support, and also your relatively light dependencies and the flexibility of wai. --===============0078857866575362224==-- From deniz.a.m.dogan@gmail.com Sat May 29 08:50:49 2010 From: Deniz Dogan To: web-devel@haskell.org Subject: Re: [web-devel] Google Summer of Code: BlazeHTML RFC Date: Sat, 29 May 2010 15:24:51 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2320972872989910449==" --===============2320972872989910449== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 2010/5/27 Jasper Van der Jeugt : > Dear all, > > BlazeHtml started out on ZuriHac 2010. Now, Jasper Van der Jeugt is > working on it as a student to Google Summer of Code for haskell.org. > His mentors are Simon Meier and Johan Tibell. The goal is to create a > high-performance HTML generation library. > > In the past few weeks, we have been exploring the performance and > design of different drafts of this library. Now, the time has come to > ask some questions to the Haskell community — more specifically the > future users of BlazeHtml as well as current users of other HTML > generation libraries. > > We have written an RFC to gather feedback from the community: > > HTML version: http://jaspervdj.be/posts/2010-05-27-blazehtml-rfc.html > Plain version: http://github.com/jaspervdj/BlazeHtml/raw/develop/doc/RFC.lhs > > The easiest way of sending us feedback, comments or criticism is > replying to the haskell-cafe thread here. Alternatively, drop a > comment at the bottom of the HTML version or at reddit. > > Looking forward to your feedback, > Kind regards, > Simon Meier > Jasper Van der Jeugt > _______________________________________________ > web-devel mailing list > web-devel@haskell.org > http://www.haskell.org/mailman/listinfo/web-devel > Q2: What HTML standards should the library at least support? HTML 4 Transitional XHTML 1.0 Transitional XHTML 1.0 Strict I don't care if frameset doctypes are supported. Q3: Which HTML version would you preferably use? HTML 4 Transitional. Please, don't make HTML 4 Strict the default. I personally haven't used it in years and don't really know any professional web developer that uses it today. -- Deniz Dogan --===============2320972872989910449==-- From moonmaster9000@gmail.com Sat May 29 12:59:54 2010 From: Matt Parker To: web-devel@haskell.org Subject: Re: [web-devel] Google Summer of Code: BlazeHTML RFC Date: Sat, 29 May 2010 13:34:14 -0400 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9084664883342814686==" --===============9084664883342814686== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > Q3: Which HTML version would you preferably use? > HTML 5. google summer of code should be about pushing the new and exciting. --===============9084664883342814686== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGJyPjxkaXYgY2xhc3M9ImdtYWlsX3F1b3RlIj48YmxvY2txdW90ZSBjbGFzcz0iZ21haWxfcXVv dGUiIHN0eWxlPSJib3JkZXItbGVmdDogMXB4IHNvbGlkIHJnYigyMDQsIDIwNCwgMjA0KTsgbWFy Z2luOiAwcHQgMHB0IDBwdCAwLjhleDsgcGFkZGluZy1sZWZ0OiAxZXg7Ij4KUTM6IFdoaWNoIEhU TUwgdmVyc2lvbiB3b3VsZCB5b3UgcHJlZmVyYWJseSB1c2U/PGJyPjwvYmxvY2txdW90ZT48ZGl2 Pjxicj5IVE1MIDUuIGdvb2dsZSBzdW1tZXIgb2YgY29kZSBzaG91bGQgYmUgYWJvdXQgcHVzaGlu ZyB0aGUgbmV3IGFuZCBleGNpdGluZy6gIDxicj48L2Rpdj48L2Rpdj4K --===============9084664883342814686==-- From greg@gregorycollins.net Sat May 29 13:31:27 2010 From: Gregory Collins To: web-devel@haskell.org Subject: Re: [Haskell-cafe] Re: [web-devel] Google Summer of Code: BlazeHTML RFC Date: Sat, 29 May 2010 14:05:24 -0400 Message-ID: <87bpby7fdn.fsf@gregorycollins.net> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0230377067056622024==" --===============0230377067056622024== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Matt Parker writes: > Q3: Which HTML version would you preferably use? > > HTML 5. google summer of code should be about pushing the new and exciting.= =C2=A0 Yes, definitely, this should be the default IMO. G --=20 Gregory Collins --===============0230377067056622024==-- From jochem@functor.nl Sun May 30 09:52:55 2010 From: Jochem Berndsen To: web-devel@haskell.org Subject: Re: [Haskell-cafe] Re: [web-devel] Google Summer of Code: BlazeHTML RFC Date: Sun, 30 May 2010 16:27:20 +0200 Message-ID: <4C0275C8.4030001@functor.nl> In-Reply-To: <87bpby7fdn.fsf@gregorycollins.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0166312221006212057==" --===============0166312221006212057== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 05/29/2010 08:05 PM, Gregory Collins wrote: > Matt Parker writes: > >> Q3: Which HTML version would you preferably use? >> >> HTML 5. google summer of code should be about pushing the new and exciting. > > Yes, definitely, this should be the default IMO. +1 -- Jochem Berndsen | jochem@functor.nl --===============0166312221006212057==-- From tom@lokhorst.eu Sun May 30 10:01:20 2010 From: Tom Lokhorst To: web-devel@haskell.org Subject: Re: [Haskell-cafe] Re: [web-devel] Google Summer of Code: BlazeHTML RFC Date: Sun, 30 May 2010 16:35:20 +0200 Message-ID: In-Reply-To: <4C0275C8.4030001@functor.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3401169394947054302==" --===============3401169394947054302== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit +1 for HTML5. Also, I suggest focussing on the html serialization of HTML5. The xml serialization (XHTML5) is only useful in an XML environment. For such environments pure xml libraries are more appropriate. Besides, I like html syntax better. On 30 May 2010 16:27, Jochem Berndsen wrote: > On 05/29/2010 08:05 PM, Gregory Collins wrote: >> >> Matt Parker  writes: >> >>>     Q3: Which HTML version would you preferably use? >>> >>> HTML 5. google summer of code should be about pushing the new and >>> exciting. >> >> Yes, definitely, this should be the default IMO. > > +1 > > > -- > Jochem Berndsen | jochem@functor.nl > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > --===============3401169394947054302==-- From jaspervdj@gmail.com Sun May 30 12:02:35 2010 From: Jasper Van der Jeugt To: web-devel@haskell.org Subject: Re: [Haskell-cafe] Re: [web-devel] Google Summer of Code: BlazeHTML RFC Date: Sun, 30 May 2010 18:36:41 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6149054769828387253==" --===============6149054769828387253== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hey Thomas, Yes, hsx/hsp could get a performance gain by using BlazeHtml as a backend. However, I'm not sure if it is possible to change the backend without changing the user API (but I do hope so). Kind regards, Jasper Van der Jeugt On Sun, May 30, 2010 at 5:58 PM, Thomas Hartman wrote: > I'm a heavy hsp user. Could hsp benefit from this project by using > blaze as a back end instead of whatever it's using now? > > IIUC, Hsp uses hsx (via the preprocessor program trhsx) to convert > xml-containing hybrid hsp/xml/html files into compilable haskell. > > I expected hsx uses XHTML (which iiuc is what blaze would replace) on > the backend but I don't see it listed in the dependencies at > > http://hackage.haskell.org/package/hsx-0.7.0 > > so I guess it doesn't and uses something internal rather than xhtml. (Right= ?) > > My question as regards BlazeHTML is if there could be any performance > win/tie in for the hsp/hsx toolchain. > > FWIW, wrt to blaze sclv commented on reddit "The idea is rather that > this would be a replacement for the html combinator library, as > distinct from templating (hamlet, hstringtemplate, bravo, chunks, > press, & co) and as distinct from the *sp model of inlined code (hsp). > > Edit: Ideally, and generally for Haskell libs, the choices of > persistence layer, html generation library, dispatch model, and server > layer are largely orthogonal. Strong typing makes any ad-hoc plumbing > a breeze." > > http://www.reddit.com/r/haskell/comments/bxa0a/blazehtml_a_blazingly_fast_h= tml_combinator/ > > thomas. > > 2010/5/30 Tom Lokhorst : >> +1 for HTML5. >> >> Also, I suggest focussing on the html serialization of HTML5. >> >> The xml serialization (XHTML5) is only useful in an XML environment. >> For such environments pure xml libraries are more appropriate. >> >> Besides, I like html syntax better. >> >> On 30 May 2010 16:27, Jochem Berndsen wrote: >>> On 05/29/2010 08:05 PM, Gregory Collins wrote: >>>> >>>> Matt Parker =C2=A0writes: >>>> >>>>> =C2=A0 =C2=A0 Q3: Which HTML version would you preferably use? >>>>> >>>>> HTML 5. google summer of code should be about pushing the new and >>>>> exciting. >>>> >>>> Yes, definitely, this should be the default IMO. >>> >>> +1 >>> >>> >>> -- >>> Jochem Berndsen | jochem@functor.nl >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe@haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe@haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > --===============6149054769828387253==-- From jeremy@n-heptane.com Tue Jun 1 10:48:34 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [Haskell-cafe] Re: [web-devel] Google Summer of Code: BlazeHTML RFC Date: Mon, 31 May 2010 13:45:26 -0500 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2763554836295960965==" --===============2763554836295960965== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit A (hopefully) non-cropped version of the chart, http://tinyurl.com/2cl42js --===============2763554836295960965== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 QSAoaG9wZWZ1bGx5KSBub24tY3JvcHBlZCB2ZXJzaW9uIG9mIHRoZSBjaGFydCwgPGEgaHJlZj0i aHR0cDovL3Rpbnl1cmwuY29tLzJjbDQyanMiPmh0dHA6Ly90aW55dXJsLmNvbS8yY2w0MmpzPC9h Pgo= --===============2763554836295960965==-- From jeremy@n-heptane.com Tue Jun 1 11:16:13 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: Re: [Haskell-cafe] Re: [web-devel] Google Summer of Code: BlazeHTML RFC Date: Mon, 31 May 2010 13:33:16 -0500 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5425600545793010090==" --===============5425600545793010090== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello, HSP does not use xhtml or any other library internally. The trhsx pre-processor turns this: bigTable :: [[Int]] -> String bigTable t =3D renderAsHTML $ evalIdentity $ <% mapM (\r -> <% mapM (\d -> ) r %>) t %>
    <% show d %>
    into: bigTable :: [[Int]] -> String {-# LINE 38 "hsp-blaze.hs" #-} bigTable t =3D L.unpack $ B.renderHtml $ evalBlaze $ (genElement (Nothing, "table") [] [asChild ((asChild (mapM (\ r -> (genElement (Nothing, "tr") [] [asChild ((asChild (mapM (\ d -> (genElement (Nothing, "td") [] [asChild ((asChild (show d)))])) r)))])) t)))]) Basically, it just calls genElement to create the elements, and asChild is a class to turn things into things that can be children on an element. The question remains, though, what is the type that genElement is producing? The type is monad specific. genElement comes from this class, -- | Generate XML values in some XMLGenerator monad. class Monad m =3D> XMLGen m where type XML m data Child m data Attribute m genElement :: Name -> [XMLGenT m [Attribute m]] -> [XMLGenT m [Child m]] -> XMLGenT m (XML m) genEElement :: Name -> [XMLGenT m [Attribute m]] -> XMLGenT m (XML m) genEElement n ats =3D genElement n ats [] xmlToChild :: XML m -> Child m pcdataToChild :: String -> Child m Most of the stuff in the HSX/HSP family now produces values of the type: data XML =3D Element Name Attributes Children | CDATA Bool String and you can use renderXML or renderAsHTML to convert that to a String depending on what rendering rules you want in effect. Anyway, on to the exciting stuff! The benchmarks: As I test I have implemented the big-table benchmark for four cases: 1. the existing html test in benchmarkes/bigtable 2. plain-old blaze 3. hsp using the identity monad, the XML type, and String 4. hsp using blaze html: mean: 15.86650 ms, lb 15.68054 ms, ub 16.22545 ms, ci 0.950 blaze: mean: 28.86730 ms, lb 28.45495 ms, ub 29.63139 ms, ci 0.950 hsp+identity: mean: 50.05748 ms, lb 49.45395 ms, ub 50.97315 ms, ci 0.950 hsp+blaze: mean: 166.4717 ms, lb 161.7957 ms, ub 174.1437 ms, ci 0.950 As a chart: http://chart.apis.google.com/chart?cht=3Dbvg&chs=3D200x250&chd=3Dt:29,50,166.= 5&chds=3D0,180&chdl=3Dblaze|hsp+identity|hsp+blaze&chco=3Dff0000|00ff00|0000f= f&chxt=3Dy&chxr=3D0,0,180,25 I am not entirely sure I did these tests correctly. So, we should not really trust these numbers at all for the moment. Also, the 'nf' thing did not have a lazy ByteString instance, so for the blaze stuff, I used L.unpack to turn the output back into a String -- which is not really 'fair'. (And would also be bad if the tests actually contained utf-8, and not just an ascii subset of it). That said, my first attempts at using blaze to speed up HSP do not seem to have worked :p I think that 'speeding up' HSX is going to be somewhat dependent on what you are trying to do with it. If you are just writing templates by hand, and the data you are adding in is String data, then I think the current HSX stuff is probably doing a descent job. Everything starts as String, and ends as a String. Then if you want you can convert that String to a ByteString, etc. The default instances for HSX would probably not perform as well if you had a lot of data you wanted to splice in that was already pre-encoded utf-8 bytestrings. If that is your case, though, you could just implement an alternative XML data type and matching monad, and use those with hsx instead. Though, you still have to be careful. It is not enough to have just utf-8 encoded bytestrings, they would also need to already have any special html characters escaped (such as &). You can't just read utf-8 values out of database and stick them straight into the html output. Another option might be to implement a instance of XMLGen that does not have an intermediate type -- it just goes directly to String, Text, ByteString, or whatever you want. I am not sure how much overhead the intermediate type is really causing though. One thing that slows the hsx html rendering down is that it has to check each tag and see if it is one of the special tags that has no close tag. (Such as meta, input, img, etc). Or if it is one of the tags where the content is rendered as as CDATA instead of PCDATA, such as script and style. And the only way to do that is to pattern match on the tag name. I have attached all three files I used to benchmark to this message. Certainly making hsx/hsp faster would be nice (though it doesn't seem especially slow to start with). And it would also be nice if you could use use a mixture of hsx+blaze combinators. - jeremy ps. I also added, ghc-options: -O2 to my BlazeHtml.cabal file, but that didn't seem to change anything On Sun, May 30, 2010 at 10:58 AM, Thomas Hartman wrote: > I'm a heavy hsp user. Could hsp benefit from this project by using > blaze as a back end instead of whatever it's using now? > > IIUC, Hsp uses hsx (via the preprocessor program trhsx) to convert > xml-containing hybrid hsp/xml/html files into compilable haskell. > > I expected hsx uses XHTML (which iiuc is what blaze would replace) on > the backend but I don't see it listed in the dependencies at > > http://hackage.haskell.org/package/hsx-0.7.0 > > so I guess it doesn't and uses something internal rather than xhtml. > (Right?) > > My question as regards BlazeHTML is if there could be any performance > win/tie in for the hsp/hsx toolchain. > > FWIW, wrt to blaze sclv commented on reddit "The idea is rather that > this would be a replacement for the html combinator library, as > distinct from templating (hamlet, hstringtemplate, bravo, chunks, > press, & co) and as distinct from the *sp model of inlined code (hsp). > > Edit: Ideally, and generally for Haskell libs, the choices of > persistence layer, html generation library, dispatch model, and server > layer are largely orthogonal. Strong typing makes any ad-hoc plumbing > a breeze." > > > http://www.reddit.com/r/haskell/comments/bxa0a/blazehtml_a_blazingly_fast_h= tml_combinator/ > > thomas. > > 2010/5/30 Tom Lokhorst : > > +1 for HTML5. > > > > Also, I suggest focussing on the html serialization of HTML5. > > > > The xml serialization (XHTML5) is only useful in an XML environment. > > For such environments pure xml libraries are more appropriate. > > > > Besides, I like html syntax better. > > > > On 30 May 2010 16:27, Jochem Berndsen wrote: > >> On 05/29/2010 08:05 PM, Gregory Collins wrote: > >>> > >>> Matt Parker writes: > >>> > >>>> Q3: Which HTML version would you preferably use? > >>>> > >>>> HTML 5. google summer of code should be about pushing the new and > >>>> exciting. > >>> > >>> Yes, definitely, this should be the default IMO. > >> > >> +1 > >> > >> > >> -- > >> Jochem Berndsen | jochem@functor.nl > >> _______________________________________________ > >> Haskell-Cafe mailing list > >> Haskell-Cafe@haskell.org > >> http://www.haskell.org/mailman/listinfo/haskell-cafe > >> > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe@haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > --===============5425600545793010090== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SGVsbG8sPGRpdj48YnI+PC9kaXY+PGRpdj5IU1AgZG9lcyBub3QgdXNlIHhodG1sIG9yIGFueSBv dGhlciBsaWJyYXJ5IGludGVybmFsbHkuoDwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+VGhlIHRy aHN4IHByZS1wcm9jZXNzb3IgdHVybnMgdGhpczo8L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2Pjxk aXY+YmlnVGFibGUgOjogW1tJbnRdXSAtJmd0OyBTdHJpbmc8L2Rpdj48ZGl2PmJpZ1RhYmxlIHQg PSByZW5kZXJBc0hUTUwgJCBldmFsSWRlbnRpdHkgJKA8L2Rpdj4KPGRpdj6goCAmbHQ7dGFibGUm Z3Q7PC9kaXY+PGRpdj6goCCgJmx0OyUgbWFwTSAoXHIgLSZndDsgJmx0O3RyJmd0OyZsdDslIG1h cE0gKFxkIC0mZ3Q7ICZsdDt0ZCZndDsmbHQ7JSBzaG93IGQgJSZndDsmbHQ7L3RkJmd0OykgciAl Jmd0OyZsdDsvdHImZ3Q7KSB0ICUmZ3Q7PC9kaXY+PGRpdj6goCAmbHQ7L3RhYmxlJmd0OzwvZGl2 PjxkaXY+PGJyPjwvZGl2PjxkaXY+aW50bzo8L2Rpdj4KPGRpdj48YnI+PC9kaXY+PGRpdj48ZGl2 PmJpZ1RhYmxlIDo6IFtbSW50XV0gLSZndDsgU3RyaW5nPC9kaXY+PGRpdj57LSMgTElORSAzOCAm cXVvdDtoc3AtYmxhemUuaHMmcXVvdDsgIy19PC9kaXY+PGRpdj5iaWdUYWJsZSB0PC9kaXY+PGRp dj6goD0gTC51bnBhY2sgJDwvZGl2PjxkaXY+oKAgoCCgQi5yZW5kZXJIdG1sICQ8L2Rpdj48ZGl2 PqCgIKAgoCCgZXZhbEJsYXplICQ8L2Rpdj4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aW5mby9oYXNrZWxsLWNhZmU8L2E+PGJyPgomZ3Q7 Jmd0Ozxicj4KJmd0OyBfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fXzxicj4KJmd0OyBIYXNrZWxsLUNhZmUgbWFpbGluZyBsaXN0PGJyPgomZ3Q7IDxhIGhyZWY9 Im1haWx0bzpIYXNrZWxsLUNhZmVAaGFza2VsbC5vcmciPkhhc2tlbGwtQ2FmZUBoYXNrZWxsLm9y ZzwvYT48YnI+CiZndDsgPGEgaHJlZj0iaHR0cDovL3d3dy5oYXNrZWxsLm9yZy9tYWlsbWFuL2xp c3RpbmZvL2hhc2tlbGwtY2FmZSIgdGFyZ2V0PSJfYmxhbmsiPmh0dHA6Ly93d3cuaGFza2VsbC5v cmcvbWFpbG1hbi9saXN0aW5mby9oYXNrZWxsLWNhZmU8L2E+PGJyPgomZ3Q7PGJyPgpfX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXzxicj4KSGFza2VsbC1DYWZl IG1haWxpbmcgbGlzdDxicj4KPGEgaHJlZj0ibWFpbHRvOkhhc2tlbGwtQ2FmZUBoYXNrZWxsLm9y ZyI+SGFza2VsbC1DYWZlQGhhc2tlbGwub3JnPC9hPjxicj4KPGEgaHJlZj0iaHR0cDovL3d3dy5o YXNrZWxsLm9yZy9tYWlsbWFuL2xpc3RpbmZvL2hhc2tlbGwtY2FmZSIgdGFyZ2V0PSJfYmxhbmsi Pmh0dHA6Ly93d3cuaGFza2VsbC5vcmcvbWFpbG1hbi9saXN0aW5mby9oYXNrZWxsLWNhZmU8L2E+ PGJyPgo8L2Rpdj48L2Rpdj48L2Jsb2NrcXVvdGU+PC9kaXY+PGJyPjwvZGl2Pgo= --===============5425600545793010090== Content-Type: text/x-haskell Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="blaze.hs" MIME-Version: 1.0 LS0gfCBCaWdUYWJsZSBiZW5jaG1hcmsgdXNpbmcgdGhlIEhUTUwgcGFja2FnZSBmcm9tIGhhY2th Z2UuCi0tCmltcG9ydCBDcml0ZXJpb24uTWFpbgppbXBvcnQgcXVhbGlmaWVkIERhdGEuQnl0ZVN0 cmluZy5MYXp5LkNoYXI4IGFzIEwKaW1wb3J0IERhdGEuTW9ub2lkIChtY29uY2F0KQppbXBvcnQg VGV4dC5CbGF6ZSAKaW1wb3J0IFRleHQuQmxhemUuSHRtbDQuU3RyaWN0IGhpZGluZyAobWFwKQoK YmlnVGFibGUgOjogW1tJbnRdXSAtPiBTdHJpbmcKYmlnVGFibGUgdCA9IEwudW5wYWNrICQgcmVu ZGVySHRtbCAkIHRhYmxlICQgbWNvbmNhdCAkIG1hcCByb3cgdAogIHdoZXJlCiAgICByb3cgciA9 IHRyICQgbWNvbmNhdCAkIG1hcCAodGQgLiBzdHJpbmcgLiBzaG93KSByCgptYWluID0gZGVmYXVs dE1haW4KICAgIFsgYmVuY2ggImJpZ1RhYmxlIiAkIG5mIGJpZ1RhYmxlIG15VGFibGUgXQogIHdo ZXJlCiAgICByb3dzIDo6IEludAogICAgcm93cyA9IDEwMDAKCiAgICBteVRhYmxlIDo6IFtbSW50 XV0KICAgIG15VGFibGUgPSByZXBsaWNhdGUgcm93cyBbMS4uMTBdCiAgICB7LSMgTk9JTkxJTkUg bXlUYWJsZSAjLX0K --===============5425600545793010090== Content-Type: text/x-haskell Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="hsp-identity.hs" MIME-Version: 1.0 ey0jIExBTkdVQUdFIE11bHRpUGFyYW1UeXBlQ2xhc3NlcywgVHlwZVN5bm9ueW1JbnN0YW5jZXMs IEZsZXhpYmxlSW5zdGFuY2VzLCBUeXBlRmFtaWxpZXMgIy19CnstIyBPUFRJT05TIC1Xd2FybiAt RiAtcGdtRnRyaHN4ICMtfQp7LSMgT1BUSU9OU19HSEMgLWZuby13YXJuLW9ycGhhbnMgIy19Cm1v ZHVsZSBNYWluIHdoZXJlCgppbXBvcnQgQ3JpdGVyaW9uLk1haW4KaW1wb3J0IHF1YWxpZmllZCBE YXRhLlRleHQgYXMgVAppbXBvcnQgcXVhbGlmaWVkIERhdGEuVGV4dC5MYXp5IGFzIFRMCmltcG9y dCBIU1AKaW1wb3J0IENvbnRyb2wuTW9uYWQuSWRlbnRpdHkgKElkZW50aXR5KElkZW50aXR5LCBy dW5JZGVudGl0eSkpCmltcG9ydCBxdWFsaWZpZWQgSFNYLlhNTEdlbmVyYXRvciBhcyBIU1gKCmlu c3RhbmNlIEhTWC5YTUxHZW4gSWRlbnRpdHkgd2hlcmUKICAgIHR5cGUgSFNYLlhNTCBJZGVudGl0 eSA9IFhNTAogICAgbmV3dHlwZSBIU1guQ2hpbGQgSWRlbnRpdHkgPSBJQ2hpbGQgeyB1bklDaGls ZCA6OiBYTUwgfQogICAgbmV3dHlwZSBIU1guQXR0cmlidXRlIElkZW50aXR5ID0gSUF0dHIgeyB1 bklBdHRyIDo6IEF0dHJpYnV0ZSB9CiAgICBnZW5FbGVtZW50IG4gYXR0cnMgY2hpbGRyZW4gPSBI U1guWE1MR2VuVCAkIElkZW50aXR5IChFbGVtZW50CiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodG9OYW1lIG4pCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWFwIHVuSUF0dHIg JCBjb25jYXRNYXAgcnVuSWRlbnRpdHkgJCBtYXAgSFNYLnVuWE1MR2VuVCBhdHRycykKICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtYXAg dW5JQ2hpbGQgJCBjb25jYXRNYXAgcnVuSWRlbnRpdHkgJCBtYXAgSFNYLnVuWE1MR2VuVCBjaGls ZHJlbikKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgKQogICAgeG1sVG9DaGlsZCA9IElDaGlsZAogICAgcGNkYXRhVG9DaGlsZCA9IEhTWC54 bWxUb0NoaWxkIC4gcGNkYXRhCgpldmFsSWRlbnRpdHkgOjogWE1MR2VuVCBJZGVudGl0eSBYTUwg LT4gWE1MCmV2YWxJZGVudGl0eSA9IHJ1bklkZW50aXR5IC4gSFNYLnVuWE1MR2VuVAoKCmJpZ1Rh YmxlIDo6IFtbSW50XV0gLT4gU3RyaW5nCmJpZ1RhYmxlIHQgPSByZW5kZXJBc0hUTUwgJCBldmFs SWRlbnRpdHkgJCAKICAgPHRhYmxlPgogICAgPCUgbWFwTSAoXHIgLT4gPHRyPjwlIG1hcE0gKFxk IC0+IDx0ZD48JSBzaG93IGQgJT48L3RkPikgciAlPjwvdHI+KSB0ICU+CiAgIDwvdGFibGU+Cgpt YWluID0gZGVmYXVsdE1haW4KICAgIFsgYmVuY2ggImJpZ1RhYmxlIiAkIG5mIGJpZ1RhYmxlIG15 VGFibGUgXQogIHdoZXJlCiAgICByb3dzIDo6IEludAogICAgcm93cyA9IDEwMDAKCiAgICBteVRh YmxlIDo6IFtbSW50XV0KICAgIG15VGFibGUgPSByZXBsaWNhdGUgcm93cyBbMS4uMTBdCiAgICB7 LSMgTk9JTkxJTkUgbXlUYWJsZSAjLX0K --===============5425600545793010090== Content-Type: text/x-haskell Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="hsp-blaze.hs" MIME-Version: 1.0 ey0jIExBTkdVQUdFIFR5cGVGYW1pbGllcyAjLX0Key0jIE9QVElPTlMgLVd3YXJuIC1GIC1wZ21G dHJoc3ggIy19Ci0tIHwgQmlnVGFibGUgYmVuY2htYXJrIHVzaW5nIHRoZSBIVE1MIHBhY2thZ2Ug ZnJvbSBoYWNrYWdlLgoKCmltcG9ydCBDcml0ZXJpb24uTWFpbgppbXBvcnQgRGF0YS5Nb25vaWQg KG1lbXB0eSwgbWNvbmNhdCkKaW1wb3J0IHF1YWxpZmllZCBEYXRhLkJ5dGVTdHJpbmcuTGF6eS5D aGFyOC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iBCLnN0cmluZwoKYXR0cmlidXRlcyBoIGF0dHJzID0gZm9sZHIgKFxh IGggLT4gaCBCLiEgYSkgaCBhdHRycwoKZXZhbEJsYXplIDo6IFhNTEdlblQgSHRtbE0gQi5IdG1s IC0+IEIuSHRtbApldmFsQmxhemUgPSB1bkh0bWxNIC4gSFNYLnVuWE1MR2VuVAoKYmlnVGFibGUg OjogW1tJbnRdXSAtPiBTdHJpbmcKYmlnVGFibGUgdCA9IEwudW5wYWNrICQgQi5yZW5kZXJIdG1s ICQgZXZhbEJsYXplICQgCiAgIDx0YWJsZT4KICAgIDwlIG1hcE0gKFxyIC0+IDx0cj48JSBtYXBN IChcZCAtPiA8dGQ+PCUgc2hvdyBkICU+PC90ZD4pIHIgJT48L3RyPikgdCAlPgogICA8L3RhYmxl PgoKbWFpbiA9IGRlZmF1bHRNYWluCiAgICBbIGJlbmNoICJiaWdUYWJsZSIgJCBuZiBiaWdUYWJs ZSBteVRhYmxlIF0KICB3aGVyZQogICAgcm93cyA6OiBJbnQKICAgIHJvd3MgPSAxMDAwCgogICAg bXlUYWJsZSA6OiBbW0ludF1dCiAgICBteVRhYmxlID0gcmVwbGljYXRlIHJvd3MgWzEuLjEwXQog ICAgey0jIE5PSU5MSU5FIG15VGFibGUgIy19Cg== --===============5425600545793010090==-- From jeremy@n-heptane.com Tue Jun 1 16:26:54 2010 From: Jeremy Shaw To: web-devel@haskell.org Subject: [web-devel] Re: Can someone post/point to some simple examples of using hjscript, ideally with happstack? Date: Tue, 01 Jun 2010 16:31:22 -0500 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1274378349267952291==" --===============1274378349267952291== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello, HJScript is a royal pain to use, IMO. Though I still use it because I haven't found anything better. There is a little bit of HJScript in this demo starting at line 549: http://src.seereason.com/examples/happstack-imageboard/Web.hs not sure that is going to clear much up though. To pop up an alert box do; window # alert (string "an freaking alert box.") - jeremy On Tue, Jun 1, 2010 at 2:14 PM, Thomas Hartman < thomashartman1@googlemail.com> wrote: > Hey, I am starting to integrate some javascript, specifically I am > generating google finance type charts using > > > http://code.google.com/apis/visualization/documentation/gallery/annotatedti= meline.html > > from the google charts api. > > This seems like a perfect place to wrap javascript in some typesafe > goodness, but I find the documentation somewhat impenetrable. > > > http://hackage.haskell.org/packages/archive/HJScript/0.5.0/doc/html/HJScrip= t.html > > Could someone that's familiar with hjscript post a synopsis with a > simple use case like popping up a hello world message box or > something? > > Suggestions on other javascript dsls are also welcome. > > Thanks in advance! > > thomas. > > -- > Need somewhere to put your code? http://patch-tag.com > Want to build a webapp? http://happstack.com > > -- > You received this message because you are subscribed to the Google Groups > "Haskell Server Pages" group. > To post to this group, send email to haskell-server-pages@googlegroups.com > . > To unsubscribe from this group, send email to > haskell-server-pages+unsubscribe@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/haskell-server-pages?hl=3Den. > > --===============1274378349267952291== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 SGVsbG8sPGRpdj48YnI+PC9kaXY+PGRpdj5ISlNjcmlwdCBpcyBhIHJveWFsIHBhaW4gdG8gdXNl LCBJTU8uIFRob3VnaCBJIHN0aWxsIHVzZSBpdCBiZWNhdXNlIEkgaGF2ZW4mIzM5O3QgZm91bmQg YW55dGhpbmcgYmV0dGVyLjwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+VGhlcmUgaXMgYSBsaXR0 bGUgYml0IG9mIEhKU2NyaXB0IGluIHRoaXMgZGVtbyBzdGFydGluZyBhdCBsaW5lIDU0OTo8L2Rp dj4KPGRpdj48YnI+PC9kaXY+PGRpdj48YSBocmVmPSJodHRwOi8vc3JjLnNlZXJlYXNvbi5jb20v ZXhhbXBsZXMvaGFwcHN0YWNrLWltYWdlYm9hcmQvV2ViLmhzIj5odHRwOi8vc3JjLnNlZXJlYXNv bi5jb20vZXhhbXBsZXM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Z2V0PSJfYmxhbmsiPmh0dHA6Ly9ncm91cHMuZ29vZ2xl LmNvbS9ncm91cC9oYXNrZWxsLXNlcnZlci1wYWdlcz9obD1lbjwvYT4uPGJyPgo8YnI+CjwvZm9u dD48L2Jsb2NrcXVvdGU+PC9kaXY+PGJyPjwvZGl2Pgo= --===============1274378349267952291==-- From jaspervdj@gmail.com Wed Jun 2 10:22:11 2010 From: Jasper Van der Jeugt To: web-devel@haskell.org Subject: Re: [web-devel] Google Summer of Code: BlazeHTML RFC Date: Wed, 02 Jun 2010 17:26:23 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0466215046304878702==" --===============0466215046304878702== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Sat, May 29, 2010 at 7:34 PM, Matt Parker wrote: > >> Q3: Which HTML version would you preferably use? > > HTML 5. google summer of code should be about pushing the new and exciting. I can say that HTML 5 will definitely be supported. We use some sort of metacode to generate Haskell combinators from a simple, formal HTML specification. Thus, it should be possible to support HTML 5, HTML 4 Strict and HTML 4 Transitional easily. Kind regards, Jasper Van der Jeugt --===============0466215046304878702==-- From jaspervdj@gmail.com Thu Jun 3 02:33:07 2010 From: Jasper Van der Jeugt To: web-devel@haskell.org Subject: Re: [web-devel] Re: [Haskell-cafe] Google Summer of Code: BlazeHTML RFC Date: Thu, 03 Jun 2010 09:37:21 +0200 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5641219776813844790==" --===============5641219776813844790== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Thu, May 27, 2010 at 8:31 PM, Matt Parker wrote: > will it be possible to easily interleave IO values into the HTML? like > instead of the [1,2,3] > > ul $ forM_ [1, 2, 3] (li . string . show) > > what if it was a function that returned IO [1,2,3] (maybe 1,2,3 came out of > a database). will the forM_ handle that OK? Depends on how you write the code. More precisely, it depends on in which monad the forM_ takes place. Also, I would not recommend interleaving IO values into the HTML, because the HTML is pure -- you usually don't want to mix that with IO. I'd rather write something like: numbers <- getFromDataBase return $ ul $ forM_ numbers (li . string . show) Or it could be possible to store your templates in a separate modules, and they would all have a pure type signature: templateX :: Arg1 -> Arg2 -> Html a I think this would be the preferred way, because it allows a separation between the pure View code and the IO-interleaved Controller code in a web application. Kind regards, Jasper Van der Jeugt On Thu, May 27, 2010 at 8:31 PM, Matt Parker wrote: > will it be possible to easily interleave IO values into the HTML? like > instead of the [1,2,3] > > ul $ forM_ [1, 2, 3] (li . string . show) > > what if it was a function that returned IO [1,2,3] (maybe 1,2,3 came out of > a database). will the forM_ handle that OK? > > > On Thu, May 27, 2010 at 12:19 PM, Matt Parker > wrote: >> >> Blaze HTML looks wonderful to me (especially with the do notation), and >> better then Hamlet for one reason: writing idiomatic haskell for stuff like >> this: >> >> ul $ forM_ [1, 2, 3] (li . string . show) >> >> instead of the Hamlet style: >> >> %ul >> $forall children.person child >> %li $child$ >> >> which, i don't know, for some reason, made me feel like i was back in PHP >> land. >> >> -matt >> >> >> On Thu, May 27, 2010 at 7:08 AM, Alberto G. Corona >> wrote: >>> >>> As a user, I have too many HTML generators, a few of them with Ajax and >>> none with server-side event handling (like ASPX or JSPX). =C2=A0Ajax is >>> complicated but server side event handling is =C2=A0what I really miss be= cause it >>> is simple =C2=A0from the user point of view, my ervents could be handled = in >>> haskell code rather than in javaScript and I =C2=A0implicitly could =C2= =A0use the >>> advantages of =C2=A0dinamic HTML and Ajax without the need to know them a= t all. >>> Imagine a dynamic Web application =C2=A0with 100% haskell code made with >>> dynamic widgets created by third party developers. >>> So, anyone want to create a HTML templating system with server side event >>> handling? It is not terribly hard to do. (I refer to ASP.NET documentation >>> or the JavaServer Faces framework). >>> By the way, I vote for XML templating or else, combinator templating that >>> produce XHML templating because it can be handled by a future graphical I= DE. >>> >>> 2010/5/27 Jasper Van der Jeugt >>>> >>>> Hey Bas, >>>> >>>> > How about also providing an enumerator back-end? >>>> > >>>> > http://hackage.haskell.org/packages/archive/iteratee/0.3.5/doc/html/Da= ta-Iteratee-Base.html#t%3AEnumeratorGM >>>> > >>>> > Then your library can integrate more easily with the snap framework: >>>> > http://snapframework.com >>>> >>>> Sure, I can do that. But I already tested integration with the snap >>>> framework, the best path here seems to call the `writeLBS` function >>>> from the snap framework on the `L.ByteString` that BlazeHtml produces >>>> (`writeLBS` internally uses an enumerator). >>>> >>>> Kind regards, >>>> Jasper Van der Jeugt >>>> >>>> On Thu, May 27, 2010 at 10:38 AM, Bas van Dijk >>>> wrote: >>>> > Q14: Do you see any problems with respect to integrating BlazeHtml in >>>> > your favourite web-framework/server? >>>> > >>>> > How about also providing an enumerator back-end? >>>> > >>>> > http://hackage.haskell.org/packages/archive/iteratee/0.3.5/doc/html/Da= ta-Iteratee-Base.html#t%3AEnumeratorGM >>>> > >>>> > Then your library can integrate more easily with the snap framework: >>>> > http://snapframework.com >>>> > >>>> > Regards, >>>> > >>>> > Bas >>>> > >>>> _______________________________________________ >>>> Haskell-Cafe mailing list >>>> Haskell-Cafe@haskell.org >>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> >>> _______________________________________________ >>> web-devel mailing list >>> web-devel@haskell.org >>> http://www.haskell.org/mailman/listinfo/web-devel >>> >> > > --===============5641219776813844790==-- From michael@snoyman.com Mon Jun 21 09:16:28 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: [web-devel] Wiki web programming page(s) Date: Mon, 21 Jun 2010 17:15:30 +0300 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2424548722878324663==" --===============2424548722878324663== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Inspiration for this e-mail comes from a post on reddit[1]. I think it's time as a web development community we work together on the overall Haskell web brand. We need a well thought out approach to organizing the information we have on the Wiki, and some people to be responsible for keeping it up to date. At the moment, the main web programming page[2] is (in my opinion) horribly disorganized, and presents the wrong information first. We also have a number of smaller pages floating around [3][4][5] that in theory could be subsumed into a more general framework. The first step I believe is to create a single page that categorizes all of the web projects, gives a brief description, and links to more information. One thing this main page should *not* do is give information like how to create a static binary[6]. So here's a start at the categories I think we should put in: Servers, eg happstack, snap Interfaces, eg Hack, WAI. Perhaps it should be included in servers? Templating: HStringTemplate, Hamlet, HSP HTML combinators: blaze, html, xhtml. Perhaps included in templating? Storage: HDBC, macid Controllers: web-routes, UrlDisp Frameworks: yesod, kibro, turbinado, happstack, snap Misc: authenticate, openid, clientsession Let's try to get a single page that contains as much of a high-level overview as possible. Just imagine if people new to Haskell could go to one page, get up-to-date information and make informed decisions about their choice in tools. Michael [1] http://www.reddit.com/r/haskell/comments/ch4me/first_impressions_serving_stat= ically_with_snap/c0skia7 [2] http://www.haskell.org/haskellwiki/Practical_web_programming_in_Haskell [3] http://www.haskell.org/haskellwiki/Web [4] http://www.haskell.org/haskellwiki/Applications_and_libraries/Web_programming [5] http://www.haskell.org/haskellwiki/Blog_articles/Web [6] --===============2424548722878324663== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+SW5zcGlyYXRpb24gZm9yIHRoaXMgZS1tYWlsIGNvbWVzIGZyb20gYSBw b3N0IG9uIHJlZGRpdFsxXS7CoDxkaXY+PGJyPjwvZGl2PjxkaXY+SSB0aGluayBpdCYjMzk7cyB0 aW1lIGFzIGEgd2ViIGRldmVsb3BtZW50IGNvbW11bml0eSB3ZSB3b3JrIHRvZ2V0aGVyIG9uIHRo ZSBvdmVyYWxsIEhhc2tlbGwgd2ViIGJyYW5kLiBXZSBuZWVkIGEgd2VsbCB0aG91Z2h0IG91dCBh cHByb2FjaCB0byBvcmdhbml6aW5nIHRoZSBpbmZvcm1hdGlvbiB3ZSBoYXZlIG9uIHRoZSBXaWtp LCBhbmQgc29tZSBwZW9wbGUgdG8gYmUgcmVzcG9uc2libGUgZm9yIGtlZXBpbmcgaXQgdXAgdG8g ZGF0ZS4gQXQgdGhlIG1vbWVudCwgdGhlIG1haW4gd2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dmluZ19zdGF0aWNhbGx5X3dpdGhfc25hcC9jMHNraWE3PC9hPjxkaXY+ClsyXcKgPGEgaHJlZj0i aHR0cDovL3d3dy5oYXNrZWxsLm9yZy9oYXNrZWxsd2lraS9QcmFjdGljYWxfd2ViX3Byb2dyYW1t aW5nX2luX0hhc2tlbGwiPmh0dHA6Ly93d3cuaGFza2VsbC5vcmcvaGFza2VsbHdpa2kvUHJhY3Rp Y2FsX3dlYl9wcm9ncmFtbWluZ19pbl9IYXNrZWxsPC9hPjwvZGl2PjxkaXY+WzNdwqA8YSBocmVm PSJodHRwOi8vd3d3Lmhhc2tlbGwub3JnL2hhc2tlbGx3aWtpL1dlYiI+aHR0cDovL3d3dy5oYXNr ZWxsLm9yZy9oYXNrZWxsd2lraS9XZWI8L2E+PC9kaXY+CjxkaXY+WzRdwqA8YSBocmVmPSJodHRw Oi8vd3d3Lmhhc2tlbGwub3JnL2hhc2tlbGx3aWtpL0FwcGxpY2F0aW9uc19hbmRfbGlicmFyaWVz L1dlYl9wcm9ncmFtbWluZyI+aHR0cDovL3d3dy5oYXNrZWxsLm9yZy9oYXNrZWxsd2lraS9BcHBs aWNhdGlvbnNfYW5kX2xpYnJhcmllcy9XZWJfcHJvZ3JhbW1pbmc8L2E+PC9kaXY+PGRpdj5bNV3C oDxhIGhyZWY9Imh0dHA6Ly93d3cuaGFza2VsbC5vcmcvaGFza2VsbHdpa2kvQmxvZ19hcnRpY2xl cy9XZWIiPmh0dHA6Ly93d3cuaGFza2VsbC5vcmcvaGFza2VsbHdpa2kvQmxvZ19hcnRpY2xlcy9X ZWI8L2E+PC9kaXY+CjxkaXY+WzZdPC9kaXY+PC9kaXY+PC9kaXY+PC9kaXY+Cg== --===============2424548722878324663==-- From michael@snoyman.com Mon Jun 21 09:48:12 2010 From: Michael Snoyman To: web-devel@haskell.org Subject: Re: [web-devel] Wiki web programming page(s) Date: Mon, 21 Jun 2010 17:53:43 +0300 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9046746637216243477==" --===============9046746637216243477== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Do you mean sample code, or sample full-fledged apps? Either way, I don't think it make sense to have it on the main page, but trying to have a link to sample code for each library seems like a very good idea. On Mon, Jun 21, 2010 at 5:49 PM, Thomas Hartman < thomashartman1@googlemail.com> wrote: > Personally the first thing I look for is a sample app(s), so I would > include this prominently in the thinking somehow. > > On Mon, Jun 21, 2010 at 7:15 AM, Michael Snoyman > wrote: > > Inspiration for this e-mail comes from a post on reddit[1]. > > I think it's time as a web development community we work together on the > > overall Haskell web brand. We need a well thought out approach to > organizing > > the information we have on the Wiki, and some people to be responsible > for > > keeping it up to date. At the moment, the main web programming page[2] is > > (in my opinion) horribly disorganized, and presents the wrong information > > first. We also have a number of smaller pages floating around [3][4][5] > that > > in theory could be subsumed into a more general framework. > > > > The first step I believe is to create a single page that categorizes all > of > > the web projects, gives a brief description, and links to more > information. > > One thing this main page should *not* do is give information like how to > > create a static binary[6]. > > So here's a start at the categories I think we should put in: > > Servers, eg happstack, snap > > Interfaces, eg Hack, WAI. Perhaps it should be included in servers? > > Templating: HStringTemplate, Hamlet, HSP > > HTML combinators: blaze, html, xhtml. Perhaps included in templating? > > Storage: HDBC, macid > > Controllers: web-routes, UrlDisp > > Frameworks: yesod, kibro, turbinado, happstack, snap > > Misc: authenticate, openid, clientsession > > Let's try to get a single page that contains as much of a high-level > > overview as possible. Just imagine if people new to Haskell could go to > one > > page, get up-to-date information and make informed decisions about their > > choice in tools. > > Michael > > [1] > http://www.reddit.com/r/haskell/comments/ch4me/first_impressions_serving_st= atically_with_snap/c0skia7 > > [2] > http://www.haskell.org/haskellwiki/Practical_web_programming_in_Haskell > > [3] http://www.haskell.org/haskellwiki/Web > > [4] > http://www.haskell.org/haskellwiki/Applications_and_libraries/Web_programmi= ng > > [5] http://www.haskell.org/haskellwiki/Blog_articles/Web > > [6] > > _______________________________________________ > > web-devel mailing list > > web-devel@haskell.org > > http://www.haskell.org/mailman/listinfo/web-devel > > > > > > > > -- > Need somewhere to put your code? http://patch-tag.com > Want to build a webapp? http://happstack.com > --===============9046746637216243477== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+RG8geW91IG1lYW4gc2FtcGxlIGNvZGUsIG9yIHNhbXBsZSBmdWxsLWZs ZWRnZWQgYXBwcz8gRWl0aGVyIHdheSwgSSBkb24mIzM5O3QgdGhpbmsgaXQgbWFrZSBzZW5zZSB0 byBoYXZlIGl0IG9uIHRoZSBtYWluIHBhZ2UsIGJ1dCB0cnlpbmcgdG8gaGF2ZSBhIGxpbmsgdG8g c2FtcGxlIGNvZGUgZm9yIGVhY2ggbGlicmFyeSBzZWVtcyBsaWtlIGEgdmVyeSBnb29kIGlkZWEu PGJyPgo8YnI+PGRpdiBjbGFzcz0iZ21haWxfcXVvdGUiPk9uIE1vbiwgSnVuIDIxLCAyMDEwIGF0 IDU6NDkgUE0sIFRob21hcyBIYXJ0bWFuIDxzcGFuIGRpcj0ibHRyIj4mbHQ7PGEgaHJlZj0ibWFp bHRvOnRob21hc2hhcnRtYW4xQGdvb2dsZW1haWwuY29tIj50aG9tYXNoYXJ0bWFuMUBnb29nbGVt YWlsLmNvbTwvYT4mZ3Q7PC9zcGFuPiB3cm90ZTo8YnI+PGJsb2NrcXVvdGUgY2xhc3M9ImdtYWls X3F1b3RlIiBzdHlsZT0ibWFyZ2luOjAgMCAwIC44ZXg7Ym9yZGVyLWxlZnQ6MXB4ICNjY2Mgc29s aWQ7cGFkZGluZy1sZWZ0OjFleDsiPgpQZXJzb25hbGx5IHRoZSBmaXJzdCB0aGluZyBJIGxvb2sg Zm9yIGlzIGEgc2FtcGxlIGFwcChzKSwgc28gSSB3b3VsZDxicj4KaW5jbHVkZSB0aGlzIHByb21p bmVudGx5IGluIHRoZSB0aGlua2luZyBzb21laG93Ljxicj4KPGRpdj48ZGl2Pj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g4Ij48YnI+Cjxicj4KPGJyPgotLTxicj4KTmVlZCBzb21ld2hl cmUgdG8gcHV0IHlvdXIgY29kZT8gPGEgaHJlZj0iaHR0cDovL3BhdGNoLXRhZy5jb20iIHRhcmdl dD0iX2JsYW5rIj5odHRwOi8vcGF0Y2gtdGFnLmNvbTwvYT48YnI+CldhbnQgdG8gYnVpbGQgYSB3 ZWJhcHA/IDxhIGhyZWY9Imh0dHA6Ly9oYXBwc3RhY2suY29tIiB0YXJnZXQ9Il9ibGFuayI+aHR0 cDovL2hhcHBzdGFjay5jb208L2E+PGJyPgo8L2ZvbnQ+PC9ibG9ja3F1b3RlPjwvZGl2Pjxicj48 L2Rpdj4K --===============9046746637216243477==-- From agocorona@gmail.com Tue Jun 22 06:17:53 2010 From: "Alberto G. Corona" To: web-devel@haskell.org Subject: [web-devel] missing web component needed: server-side page control Date: Tue, 22 Jun 2010 13:23:26 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5997136537971473290==" --===============5997136537971473290== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi web haskellers. A few days ago I mention the need to have =C2=A0server-side page control available in Haskell. ASP.NET and JavaServer Faces have it. I would like to collaborate with anyone of you interested. I have not much time now but this can change in the coming weeks so I want to know the interest on the subject in advance. I also want to receive comments to the development plan. The main advantages are: =C2=A0=C2=A0-No Javascript, no Ajax needed when developing dynamic HTML pages (All code becomes pure haskell in the server!!) -No errors in advanced dynamic HTML code: all is statically typed haskell (someone bets more?) =C2=A0=C2=A0-Clear separation of HTML presentation from page control code =C2=A0=C2=A0-Extensibility: makes possible to create custom controls, like HT= ML tables automatically generated from haskell containers etc All this will unleash the full power of haskell in the Web!!! It is compatible and orthogonal with page templating and all other web stuff. I think that it is a two month work. basically what we have to do is the following: =C2=A0=C2=A00 develop a Haskell HTML DOM library. Just 31 objects to manage H= TML trees =C2=A0=C2=A0 =C2=A0 See the=C2=A0HTML DOM Objects Reference at http://www.w3schools.com/jsref/default.asp =C2=A0=C2=A0 =C2=A0 =C2=A0I suppose that this is not yet done Can make use of the XML structure defined in HXT http://hackage.haskell.org/package/hxt-8.5.2. HXT has namespace support. This is needed for defining custom attributes and tags (4 and = 5). each HTML DOM method will do two basic things: =C2=A0=C2=A0 a) update a copy of the HTML page tree in the SERVER =C2=A0=C2=A0 b) send trough an Ajax channel the equivalent javascript method, that will be executed in the web browser =C2=A0=C2=A0 3 create a minimum javascript module that: =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0read Ajax responses and execute them in the = web browser, for the above functionality =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0listen for events and forward them to the se= rver trough Ajax. =C2=A0=C2=A0 4 define additional XML attributes to be interspersed in the HTM= L tree for =C2=A0=C2=A0 =C2=A0 =C2=A0 specifying url' s in the server where the server e= vents will be forwarded =C2=A0(for 3)