Commit c172757d authored by Peter Achten's avatar Peter Achten
Browse files

refactoring modules internally

parent 2159cbf8
......@@ -9,44 +9,44 @@ import htmlDataDef, EncodeDecode
// Maintaining the internal state of all forms
:: *FormStates // collection of all states of all forms
:: *FormStates // collection of all states of all forms
emptyFormStates :: *FormStates // creates emtpy states
emptyFormStates :: *FormStates // creates emtpy states
findState :: !(FormId a) *FormStates *NWorld // find the state value given FormId and a correct type
-> (Bool, Maybe a,*FormStates,*NWorld) // true if form has not yet been previously inspected
findState :: !(FormId a) *FormStates *NWorld // find the state value given FormId and a correct type
-> (Bool, Maybe a,*FormStates,*NWorld) // true if form has not yet been previously inspected
| iDataSerAndDeSerialize a
replaceState :: !(FormId a) a *FormStates *NWorld // replace state given FormId
replaceState :: !(FormId a) a *FormStates *NWorld // replace state given FormId
-> (*FormStates,*NWorld) | iDataSerialize a
getUpdateId :: *FormStates -> (String,*FormStates) // id of previously changed form
getUpdate :: *FormStates -> (String,*FormStates) // value typed in by user as string
getUpdateId :: *FormStates -> (String,*FormStates) // id of previously changed form
getUpdate :: *FormStates -> (String,*FormStates) // value typed in by user as string
// storage and retrieval of FormStates
retrieveFormStates :: ServerKind (Maybe String) *NWorld -> (*FormStates,*NWorld) // retrieves all form states hidden in the html page
retrieveFormStates :: ServerKind (Maybe String) *NWorld -> (*FormStates,*NWorld) // retrieves all form states hidden in the html page
storeFormStates :: !FormStates *NWorld -> (BodyTag,*NWorld)
// Triplet handling
:: Triplet :== (String,Int,UpdValue)
:: Triplet :== (String,Int,UpdValue)
:: UpdValue // the updates that can take place
= UpdI Int // new integer value
| UpdR Real // new real value
| UpdB Bool // new boolean value
| UpdC String // choose indicated constructor
| UpdS String // new piece of text
:: UpdValue // the updates that can take place
= UpdI Int // new integer value
| UpdR Real // new real value
| UpdB Bool // new boolean value
| UpdC String // choose indicated constructor
| UpdS String // new piece of text
encodeTriplet :: Triplet -> String // encoding of triplets
decodeTriplet :: String -> Maybe Triplet
encodeTriplet :: Triplet -> String // encoding of triplets
decodeTriplet :: String -> Maybe Triplet
getTriplet :: *FormStates -> (!Maybe Triplet,!Maybe b,*FormStates) | gParse{|*|} b // inspect triplet
getTriplet :: *FormStates -> (!Maybe Triplet,!Maybe b,*FormStates) | gParse{|*|} b // inspect triplet
callClean :: Script // script that will take care of sending the required input to this application
callClean :: Script // script that takes care of sending the required input to this application
// fstate handling used for testing only
initTestFormStates :: *NWorld -> (*FormStates,*NWorld) // creates initial empty form states
initTestFormStates :: *NWorld -> (*FormStates,*NWorld) // creates initial empty form states
setTestFormStates :: (Maybe Triplet) String String *FormStates *NWorld -> (*FormStates,*NWorld) // stores triplet updateid update in state
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment