Implement check of bidirectionalizability.
[darcs-mirror-sem_syn.git] / b18n-combined-cgi.hs
index c0c826a..1911a62 100644 (file)
@@ -65,7 +65,7 @@ page (PageInfo {..}) =
                       "Zhenjiang Hu, " +++
                       "Keisuke Nakano, " +++
                       "Makoto Hamana and " +++
-                      "Gunma University"
+                      "Masato Takeichi."
                     ) +++
                     li << (
                       "“" +++
@@ -122,10 +122,7 @@ page (PageInfo {..}) =
                                  radio "b18nMode" (show mode) 
                                        ! (guard (mode == b18nMode config) >> return checked)
                                        +++ show mode +++ " "
-                                ) [SyntacticB18n, SemanticB18n, CombinedB18n, NoB18n]) +++ br +++
-                              "Show types " +++ checkbox "showTypes" "showTypes"
-                                        ! (guard (isShowType config) >> return checked)
-                                        +++ br +++
+                                ) [SyntacticB18n, SemanticB18n, CombinedB18n]) +++ br +++
                               mkSubmit True BiDi
                        ) +++
                         ( htmlMB generatedModuleMB $ \ generatedModule -> 
@@ -183,30 +180,30 @@ maindiv = thediv ! [theclass "main"]
         
 examples =
        [ ("init", unlines
-               [ "init (Nil)         = Nil"
-               , "init (Cons(a,Nil)) = Nil"
-               , "init (Cons(a,Cons(b,x))) = Cons(a,initWork(b,x))"
-               , "initWork(a,Nil)       = Nil"
-               , "initWork(a,Cons(b,x)) = Cons(a,initWork(b,x))"
+               [ "init []      = []"
+               , "init [a]     = []"
+               , "init (a:b:x) = a:initWork b x"
+               , "initWork a []    = []"
+               , "initWork a (b:x) = a:initWork b x"
                ])
        , ("initHalf", unlines
-               [ "initHalf(Nil)       = Nil"
-               , "initHalf(Cons(a,x)) = Cons(a,initHalfWork(x,x))"
+               [ "initHalf []    = []"
+               , "initHalf (a:x) = a:initHalfWork x x"
                , ""
-               , "initHalfWork(xs, Nil)         = Nil"
-               , "initHalfWork(xs, Cons(x,Nil)) = Nil"
-               , "initHalfWork(Cons(a,x), Cons(b,Cons(c,y)))"
-               , "                    = Cons(a,initHalfWork(x,y))"
+               , "initHalfWork xs  []  = []"
+               , "initHalfWork xs  [x] = []"
+               , "initHalfWork (a:x) (b:c:y)"
+               , "                    = a:initHalfWork x y"
                ])
        , ("sieve", unlines
-               [ "sieve (Nil)               = Nil"
-               , "sieve (Cons(a,Nil))       = Nil"
-               , "sieve (Cons(a,Cons(b,x))) = Cons(b,sieve(x))"
+               [ "sieve []      = []"
+               , "sieve [a]     = []"
+               , "sieve (a:b:x) = b:sieve x"
                ])
        , ("rev", unlines
-               [ "reverse(xs) = rev(xs,Nil)"
-               , "rev(Nil,y)       = y"
-               , "rev(Cons(a,x),y) = rev(x,Cons(a,y))"
+               [ "reverse xs = rev xs []"
+               , "rev []    y = y"
+               , "rev (a:x) y = rev x (a:y)"
                ])
        ]
 
@@ -299,12 +296,10 @@ formMain = do
 
         conf <- do
             b18nMode' <- maybe CombinedB18n read <$> getInput "b18nMode"
-            isShowType' <- isJust <$> getInput "showTypes"
             return $ defaultConfig
                 { isHaskellify = True
                 , b18nMode = b18nMode'
                 , execMode = ShapifyPlus
-                , isShowType = isShowType'
                 }
        
        todo <- msum <$> sequence (