Remove ShowType button
[darcs-mirror-sem_syn.git] / b18n-combined-cgi.hs
index 04b66bc..1116f8e 100644 (file)
@@ -65,7 +65,7 @@ page (PageInfo {..}) =
                       "Zhenjiang Hu, " +++
                       "Keisuke Nakano, " +++
                       "Makoto Hamana and " +++
-                      "Gunma University"
+                      "Masato Takeichi."
                     ) +++
                     li << (
                       "“" +++
@@ -123,9 +123,6 @@ page (PageInfo {..}) =
                                        ! (guard (mode == b18nMode config) >> return checked)
                                        +++ show mode +++ " "
                                 ) [SyntacticB18n, SemanticB18n, CombinedB18n, NoB18n]) +++ br +++
-                              "Show types " +++ checkbox "showTypes" "showTypes"
-                                        ! (guard (isShowType config) >> return checked)
-                                        +++ 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,20 +296,18 @@ 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 (
             map (\what -> fmap (const what) <$> getInput (submitId what))
             [ BiDi, Get, Check, Load, EvalPut, EvalGet])
         
-       code <- fromMaybe defaultCode <$> getInput "code"
-       
+       code <- filter (/= '\r') <$> fromMaybe defaultCode <$> getInput "code"
+
         code <- case todo of
             Just Load -> do loadWhat <- getInput "loadCode"
                             return $ fromMaybe code $ loadWhat >>= flip lookup examples