Skip to content
Snippets Groups Projects
Commit ceca3382 authored by Michael Hanus's avatar Michael Hanus
Browse files

read/show/QTerm removed

parent bd0ed36e
No related branches found
Tags v3.0.0
No related merge requests found
......@@ -11,7 +11,6 @@
"global" : " >= 3.0.0, < 4.0.0",
"html2" : " >= 3.0.0, < 4.0.0",
"inversion" : " >= 3.0.0, < 4.0.0",
"read-legacy": " >= 3.0.0, < 4.0.0",
"time" : " >= 3.0.0, < 4.0.0"
},
"source": {
......
......@@ -46,7 +46,6 @@ import Data.Function.Inversion ( invf1 )
import Global
import HTML.Base
import HTML.Session
import ReadShowTerm ( readQTerm, showQTerm )
infixl 0 `withRendering`
infixl 0 `withError`
......@@ -67,11 +66,11 @@ cgiRef2state cr = Ref cr
state2cgiRef :: WuiState -> HtmlRef
state2cgiRef (Ref cr) = cr
value2state :: _ -> WuiState
value2state v = Hidden (showQTerm v)
value2state :: Show a => a -> WuiState
value2state v = Hidden (show v)
state2value :: WuiState -> _
state2value (Hidden s) = readQTerm s
state2value :: Read a => WuiState -> a
state2value (Hidden s) = read s
states2state :: [WuiState] -> WuiState
states2state sts = CompNode sts
......@@ -182,7 +181,7 @@ adaptWSpec a2b = transformWSpec (a2b, invf1 a2b)
--- A hidden widget for a value that is not shown in the WUI.
--- Usually, this is used in components of larger
--- structures, e.g., internal identifiers, data base keys.
wHidden :: WuiSpec a
wHidden :: (Read a, Show a) => WuiSpec a
wHidden =
WuiSpec (head, "?", const True) -- dummy values, not used
(\_ _ v -> (hempty, value2state v))
......@@ -192,7 +191,7 @@ wHidden =
--- A widget for values that are shown but cannot be modified.
--- The first argument is a mapping of the value into a HTML expression
--- to show this value.
wConstant :: (a -> HtmlExp) -> WuiSpec a
wConstant :: (Read a, Show a) => (a -> HtmlExp) -> WuiSpec a
wConstant showhtml =
WuiSpec (head, "?", const True)
(\wparams _ v -> ((renderOf wparams) [showhtml v], value2state v))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment