[Fencommits] fenserve: make (+++) have precedence zero, so that it can be mixed with ($) (both are right-associative)

Benja Fallenstein benja.fallenstein at gmail.com
Thu May 31 00:50:13 EEST 2007


Thu May 31 00:49:59 EEST 2007  Benja Fallenstein <benja.fallenstein at gmail.com>
  * make (+++) have precedence zero, so that it can be mixed with ($) (both are right-associative)
diff -rN -u old-fenserve/fendata/HTML.hs new-fenserve/fendata/HTML.hs
--- old-fenserve/fendata/HTML.hs	2007-05-31 00:50:12.000000000 +0300
+++ new-fenserve/fendata/HTML.hs	2007-05-31 00:50:12.000000000 +0300
@@ -14,7 +14,7 @@
 html :: ToHTML a => a -> String
 html = fromHTML . toHTML
     
-infixr 4 +++
+infixr 0 +++
     
 (+++) :: (ToHTML a, ToHTML b) => a -> b -> HTML
 x +++ y = HTML (html x ++ html y)
diff -rN -u old-fenserve/fendata/Main.hs new-fenserve/fendata/Main.hs
--- old-fenserve/fendata/Main.hs	2007-05-31 00:50:12.000000000 +0300
+++ new-fenserve/fendata/Main.hs	2007-05-31 00:50:12.000000000 +0300
@@ -224,7 +224,7 @@
       if cat `Set.member` cats then tag "tr" [] $
         catFor cols $ \col -> tag "td" [] $ 
             qlink ("item/"++show id) [P "returnTo" "table"] $ fields Map.! col
-      else toHTML ""),
+      else HTML ""),
     s) where new = formP (?root++"newItem") $ foldl1 (+++)
                        [ hidden "returnTo" "table"
                        , hidden "cat" cat
@@ -252,7 +252,7 @@
                  else textfield field) (fields Map.! field)
             +++ br,
     s) where uri = fromMaybe "" (lookM req "returnTo")
-             returnTo = flip (maybe $ toHTML "") (lookM req "returnTo") $ \uri -> HTML $
+             returnTo = flip (maybe $ HTML "") (lookM req "returnTo") $ \uri -> HTML $
                  "<input type=hidden name=returnTo value='"++html(escape uri)++"'>"
              buttons = HTML $ "<p><button>[Save]</button> "++html mdot++" "++
                  "<a href='"++ ?root++html uri++"'>[Cancel]</a></form>"




More information about the Fencommits mailing list