This comparison shows the changes necessary to convert path / (Rev 10) TO / (Rev 11)
@@ -47,9 +47,9 @@
| --main = run (io (serialize (toPTable ([],([],([],[]))))) >> standardQuery "bla" empty) |
| errorPage _ s F0 = standardQuery "Error page" |
| errorPage _ s F0 = standardQuery "Error page" |
| <body> |
| <h1>Error ++ s</h1> |
| <h1><%= "Error: " ++ s %></h1> |
| </body> |
| indexCGI ex = do |
@@ -141,7 +141,7 @@
| currFun = succ n |
| totFun = length functions |
| (funName,(functor,(a,c))) = functions !! n |
| funMatch = undefined -- [ f | f <- fmap funct (Map.elems (functors ex)), isJust (match (normalize f) (normalize functor)) ] |
| funMatch = [ f | f <- fmap funct (Map.elems (functors ex)), isJust (match (normalize f) (normalize functor)) ] |
| functName = |
| case funMatch of |
| [] -> functNameFU |
@@ -165,8 +165,8 @@
| </#> |
| pressToAddCGI ex functions n F0 |
| | n < length functions = undefined -- io (serialize ex) >> (standardQuery "Adding function" (addTable ex functions n)) |
| | otherwise = undefined -- io (serialize ex) >> (standardQuery "Finished adding!" (index ex)) |
| | n < length functions = io (serialize ex) >> (standardQuery "Adding function" (addTable ex functions n)) |
| | otherwise = io (serialize ex) >> (standardQuery "Finished adding!" (index ex)) |
| -} |
| selectFunctCGI ex = standardQuery "Select functor..." (selectFunct ex) |
@@ -207,7 +207,7 @@
| rowH c = <span onmouseover=<% f2comment getCoAlg c %> ><%= c %></span> |
| rows rg = foldr (>>) empty [ <tr><th scope="row"><% rowH c %></th><% contents c rg %></tr> | c <- keys coalgs] |
| functComment idF = if (aux == "") then "no user comment for this functor" else aux |
| where aux = undefined -- maybe (error "2") functcomment (getFunctor idF ex) |
| where aux = either error fccomment (getFunctor idF ex) |
| in |
| <#> |
| <div> |
@@ -240,22 +240,24 @@
| synth iFunct ex iGenes = |
| let (a, c) = value iGenes |
| idF = lookupByGenes a c ex |
| wrapCode s = <pre class="pf"><%= prettyPrint $ pf2hs s %></pre> |
| idF = combine a c "newF" "" ex |
| wrapCode s = <pre class="pf"><%= prettyPrint s %></pre> |
| wrapCode2 idF s = |
| let f = either error id (getFunction idF ex) |
| in |
| <#> |
| <p>User comment: <%= if (fcomment f == "") then "No user comment for this function" else (fcomment f) %></p> |
| <p>Code:</p> |
| <pre class="pf"><%= prettyPrint $ pf2hs s %></pre> |
| <pre class="pf"><%= prettyPrint s %></pre> |
| </#> |
| in |
| case idF of |
| -- No function at this place, generate new |
| Left e -> undefined -- maybe (<p>Incompatible genes!</p>) wrapCode (mkhylo a c ex) |
| -- There is already a function, show it |
| Right idF -> undefined -- either error (wrapCode2 idF) (expandPFById idF ex) |
| -- There was already a function, show it |
| Left idF -> either error (wrapCode2 idF) (expandPWById idF ex) |
| -- Incompatible genes |
| Right (Left e) -> <p>Incompatible genes!</p> |
| -- New function generated |
| Right (Right newFunct) -> either error wrapCode (expandPW newFunct ex) |
| >> |
| <#> |
| <% submit F0 (generateCGI idF ex a c iFunct) <[ value="Get this function in a module"]> %> |
@@ -270,8 +272,8 @@
| addOn = "module Output where\n\nimport Pointless.Functors\nimport Pointless.Combinators\nimport Pointless.Combinators.Uncurried\nimport Pointless.RecursionPatterns\n\nf = " |
| code = |
| case idF of |
| Left e -> undefined -- maybe (error "5") (prettyPrint . pf2hs) (mkhylo a c ex) |
| Right idF -> undefined -- either error (prettyPrint . pf2hs) (expandPFById idF ex) |
| Left e -> "a" -- maybe (error "5") (prettyPrint . pf2hs) (mkhylo a c ex) |
| Right idF -> "b" -- either error (prettyPrint . pf2hs) (expandPFById idF ex) |
| <#> |
| <pre class="pf"><%= addOn ++ code %></pre> |
| <% tableFunct ex Nothing iFunct %> |
@@ -47,9 +47,9 @@
| --main = run (io (serialize (toPTable ([],([],([],[]))))) >> standardQuery "bla" empty) |
| errorPage _ s F0 = standardQuery "Error page" |
| errorPage _ s F0 = standardQuery "Error page" |
| <body> |
| <h1>Error ++ s</h1> |
| <h1><%= "Error: " ++ s %></h1> |
| </body> |
| indexCGI ex = do |
@@ -141,7 +141,7 @@
| currFun = succ n |
| totFun = length functions |
| (funName,(functor,(a,c))) = functions !! n |
| funMatch = undefined -- [ f | f <- fmap funct (Map.elems (functors ex)), isJust (match (normalize f) (normalize functor)) ] |
| funMatch = [ f | f <- fmap funct (Map.elems (functors ex)), isJust (match (normalize f) (normalize functor)) ] |
| functName = |
| case funMatch of |
| [] -> functNameFU |
@@ -165,8 +165,8 @@
| </#> |
| pressToAddCGI ex functions n F0 |
| | n < length functions = undefined -- io (serialize ex) >> (standardQuery "Adding function" (addTable ex functions n)) |
| | otherwise = undefined -- io (serialize ex) >> (standardQuery "Finished adding!" (index ex)) |
| | n < length functions = io (serialize ex) >> (standardQuery "Adding function" (addTable ex functions n)) |
| | otherwise = io (serialize ex) >> (standardQuery "Finished adding!" (index ex)) |
| -} |
| selectFunctCGI ex = standardQuery "Select functor..." (selectFunct ex) |
@@ -207,7 +207,7 @@
| rowH c = <span onmouseover=<% f2comment getCoAlg c %> ><%= c %></span> |
| rows rg = foldr (>>) empty [ <tr><th scope="row"><% rowH c %></th><% contents c rg %></tr> | c <- keys coalgs] |
| functComment idF = if (aux == "") then "no user comment for this functor" else aux |
| where aux = undefined -- maybe (error "2") functcomment (getFunctor idF ex) |
| where aux = either error fccomment (getFunctor idF ex) |
| in |
| <#> |
| <div> |
@@ -240,22 +240,24 @@
| synth iFunct ex iGenes = |
| let (a, c) = value iGenes |
| idF = lookupByGenes a c ex |
| wrapCode s = <pre class="pf"><%= prettyPrint $ pf2hs s %></pre> |
| idF = combine a c "newF" "" ex |
| wrapCode s = <pre class="pf"><%= prettyPrint s %></pre> |
| wrapCode2 idF s = |
| let f = either error id (getFunction idF ex) |
| in |
| <#> |
| <p>User comment: <%= if (fcomment f == "") then "No user comment for this function" else (fcomment f) %></p> |
| <p>Code:</p> |
| <pre class="pf"><%= prettyPrint $ pf2hs s %></pre> |
| <pre class="pf"><%= prettyPrint s %></pre> |
| </#> |
| in |
| case idF of |
| -- No function at this place, generate new |
| Left e -> undefined -- maybe (<p>Incompatible genes!</p>) wrapCode (mkhylo a c ex) |
| -- There is already a function, show it |
| Right idF -> undefined -- either error (wrapCode2 idF) (expandPFById idF ex) |
| -- There was already a function, show it |
| Left idF -> either error (wrapCode2 idF) (expandPWById idF ex) |
| -- Incompatible genes |
| Right (Left e) -> <p>Incompatible genes!</p> |
| -- New function generated |
| Right (Right newFunct) -> either error wrapCode (expandPW newFunct ex) |
| >> |
| <#> |
| <% submit F0 (generateCGI idF ex a c iFunct) <[ value="Get this function in a module"]> %> |
@@ -270,8 +272,8 @@
| addOn = "module Output where\n\nimport Pointless.Functors\nimport Pointless.Combinators\nimport Pointless.Combinators.Uncurried\nimport Pointless.RecursionPatterns\n\nf = " |
| code = |
| case idF of |
| Left e -> undefined -- maybe (error "5") (prettyPrint . pf2hs) (mkhylo a c ex) |
| Right idF -> undefined -- either error (prettyPrint . pf2hs) (expandPFById idF ex) |
| Left e -> "a" -- maybe (error "5") (prettyPrint . pf2hs) (mkhylo a c ex) |
| Right idF -> "b" -- either error (prettyPrint . pf2hs) (expandPFById idF ex) |
| <#> |
| <pre class="pf"><%= addOn ++ code %></pre> |
| <% tableFunct ex Nothing iFunct %> |