ANN: moe html combinator

hand written html is fine, except for the closing tags: what if html' - do head' - do meta [http_equiv "Content-Type", content "text/html; charset-utf-8"] (/) title' - str "my title" link [rel "icon", _type "image/png", href "panda_icon.png"] (/) body' - do div [_class "container"] - do str "hello world" produces <html> <head> <meta http-equiv="Content-Type" content="text/html; charset-utf-8"> </meta> <title> my title </title> <link rel="icon" type="image/png" href="panda_icon.png"> </link> </head> <body> <div class="container"> hello world </div> </body> </html> That's moe. There's also extra dsl sugar / flavors for your convienence, including (currently available) markdown and kawaii. It's a new library, tries to bring some haskell fun back to web programming, so .. enjoy. - moe: http://hackage.haskell.org/package/moe -- jinjing

Hello Jinjing, Friday, August 28, 2009, 9:08:58 AM, you wrote:
hand written html is fine, except for the closing tags:
may be it's possible to omit them using type machinery?
link [rel "icon", _type "image/png", href "panda_icon.png"] (/)
it contains unpredictable mix of xxx', _xxx and xxx identifiers. how about using the same style, say _xxx, for everything? and stop reusing Prelude operators, in particular, replace "-" with "$"? -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

2009/08/27 Bulat Ziganshin
...stop reusing Prelude operators, in particular, replace "-" with "$"?
I have to say, the `$ do` construct is an eyesore and `- do` is a lot easier on the eyes. Would it introduce ambiguity in the Haskell grammar if foo do... foo case... foo if... were always parsed as: foo (do...) foo (case...) foo (if...) This is what is usually meant. -- Jason Dusek

On 28 aug 2009, at 08:11, Jason Dusek wrote:
2009/08/27 Bulat Ziganshin
: ...stop reusing Prelude operators, in particular, replace "-" with "$"?
I have to say, the `$ do` construct is an eyesore and `- do` is a lot easier on the eyes.
Would it introduce ambiguity in the Haskell grammar if
foo do...
foo case...
foo if...
were always parsed as:
foo (do...)
foo (case...)
foo (if...)
For the first two it would not make a difference, since they are essentially closed constructs, following the offside rule which inserts a } at the place where they end, so this cannot give rise to an ambiguous interpretetation. One might even argue that their current precedence level in the Haskell definition is "suboptimal". The "if" is a different thing, due to the absence of offside rules for if. Doaitse
This is what is usually meant.
-- Jason Dusek _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Aug 30, 2009, at 14:56 , S.Doaitse Swierstra wrote:
On 28 aug 2009, at 08:11, Jason Dusek wrote: 2009/08/27 Bulat Ziganshin
: ...stop reusing Prelude operators, in particular, replace "-" with "$"?
I have to say, the `$ do` construct is an eyesore and `- do` is a lot easier on the eyes.
Would it introduce ambiguity in the Haskell grammar if
foo do...
foo case...
foo if...
were always parsed as:
foo (do...)
foo (case...)
foo (if...)
For the first two it would not make a difference, since they are essentially closed constructs, following the offside rule which inserts a } at the place where they end, so this cannot give rise to an ambiguous interpretetation. One might even argue that their current precedence level in the Haskell definition is "suboptimal". The "if" is a different thing, due to the absence of offside rules for if.
mapM. And yes, I know about forM; are there any other examples of this? -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

Say we have a nice thread on this and we all realize that the precedence of `do` and `case` could be changed (and changing `if` would be nice but we can't have everything). How many months/years would it take for any change in that direction to occur? -- Jason Dusek

Jason Dusek wrote:
Say we have a nice thread on this and we all realize that the precedence of `do` and `case` could be changed (and changing `if` would be nice but we can't have everything). How many months/years would it take for any change in that direction to occur?
Seven! (Sorry, working on theses on Sunday evenings makes for silly moods.)
participants (6)
-
Brandon S. Allbery KF8NH
-
Bulat Ziganshin
-
Jason Dusek
-
Jinjing Wang
-
Martijn van Steenbergen
-
S.Doaitse Swierstra