Commit 727d9a79 authored by Peter Achten's avatar Peter Achten
Browse files

made signature of universalDB more consistent with universalRefEditor

parent f7519628
......@@ -11,8 +11,7 @@ import StdListExtensions
AccountsDB :: !Init !ConfAccounts *HSt -> (ConfAccounts,!*HSt) // conf management database
AccountsDB init accounts hst
# accounts = setInvariantAccounts accounts // ensure that all links are correct
= universalDB init (\s a -> invariantLogAccounts s a + invariantConfAccounts s a)
uniqueDBname accounts hst
= universalDB (init,accounts,uniqueDBname) (\s a -> invariantLogAccounts s a + invariantConfAccounts s a) hst
PaperNrStore :: !(Int -> Int) *HSt -> (Int,!*HSt) // paper counter
PaperNrStore fun hst
......
......@@ -187,12 +187,12 @@ discussPapersPage account accounts hst
# selectedpaper = allpapernrs!!selected
# mbpaperrefinfo = getPaperInfo selectedpaper accounts
# (RefDiscussion (Ref2 name)) = (fromJust mbpaperrefinfo).discussion
# (disclist,hst) = universalDB Init (\_ _ -> Ok) name (Discussion []) hst
# (disclist,hst) = universalDB (Init,Discussion []) name (\_ _ -> Ok) hst
# (time,date,hst) = getTimeAndDate hst
# (newsubmit,newdiscf,hst)
= mkSubStateForm (if pdfun.changed Set Init, nFormId "sh_dpp_adddisc" (TS 80 "")) disclist
(\s -> addItemTextInput (account.login.loginName) time date (toS s)) hst
# (_,hst) = if newsubmit (universalDB Set (\_ _ -> Ok) name newdiscf.value hst) (undef,hst)
# (_,hst) = if newsubmit (universalDB (Set,newdiscf.value) name (\_ _ -> Ok) hst) (undef,hst)
# (disclistf,hst) = mkEditForm (Set,sdFormId "sh_show_disc" newdiscf.value) hst
# (newsubmit,newdiscf,hst)
= if newsubmit (mkSubStateForm (Set,nFormId "sh_dpp_adddisc" (TS 80 "")) disclist
......
......@@ -50,7 +50,3 @@ instance == PasswordBox
:: HtmlTime = Time Int Int Int // Hours Minutes Seconds
getTimeAndDate :: !*HSt -> *(!HtmlTime,!HtmlDate,!*HSt)
......@@ -14,7 +14,7 @@ invokeRefEditor :: (!(InIDataId b) !*HSt -> (Form d,!*HSt)) (InIDataId b) !*HSt
universalRefEditor :: !(InIDataId (Ref2 a)) !(a -> Judgement) !*HSt -> (Form a,!*HSt) | iData, TC a
universalDB :: !Init !(String a -> Judgement) !String !a !*HSt -> (a,!*HSt) | iData, TC a
universalDB :: !(!Init,!a) !String !(String a -> Judgement) !*HSt -> (a,!*HSt) | iData, TC a
// Usefull for exception handling
......
......@@ -72,8 +72,8 @@ where
// editor for persistent information
universalDB :: !Init !(String a -> Judgement) !String !a !*HSt -> (a,!*HSt) | iData, TC a
universalDB init invariant filename value hst
universalDB :: !(!Init,!a) !String !(String a -> Judgement) !*HSt -> (a,!*HSt) | iData, TC a
universalDB (init,value) filename invariant hst
# (dbf,hst) = myDatabase Init 0 value hst // create / read out database file
# dbversion = fst dbf.value // version number stored in database
# dbvalue = snd dbf.value // value stored in database
......
Markdown is supported
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