Commit d3890a53 authored by Steffen Michels's avatar Steffen Michels

make datatypes used in task tree strict, solves some space leaks

parent a3a930ba
Pipeline #12529 passed with stage
in 4 minutes and 3 seconds
......@@ -62,13 +62,12 @@ derive JSONDecode TIMeta, TIReduct, TaskTree
= TCInit !TaskId !TaskTime //Initial state for all tasks
| TCBasic !TaskId !TaskTime !DeferredJSON !Bool //Encoded value and stable indicator
| TCInteract !TaskId !TaskTime !DeferredJSON !DeferredJSON !EditMask
| TCStep !TaskId !TaskTime !(Either (TaskTree,[String]) (DeferredJSON,Int,TaskTree))
| TCParallel !TaskId !TaskTime ![(!TaskId,!TaskTree)] [String] //Subtrees of embedded tasks and enabled actions
| TCStep !TaskId !TaskTime !(Either (!TaskTree, ![String]) (!DeferredJSON, !Int, !TaskTree))
| TCParallel !TaskId !TaskTime ![(!TaskId,!TaskTree)] ![String] //Subtrees of embedded tasks and enabled actions
| TCShared !TaskId !TaskTime !TaskTree
| TCAttach !TaskId !TaskTime !AttachmentStatus !String !String
| TCExposedShared !TaskId !TaskTime !String !TaskTree // +URL //TODO: Remove
| TCStable !TaskId !TaskTime !DeferredJSON
//| TCLayout !DeferredJSON !TaskTree
| TCLayout !(!LUI,!LUIMoves) !TaskTree
| TCNop
| TCDestroy !TaskTree //Marks a task state as garbage that must be destroyed (TODO: replace by explicit event
......
......@@ -117,11 +117,11 @@ sequenceLayouts :: [LayoutRule] -> LayoutRule
//From this data structure both the UI with, and without the layout effects, can be deduced
:: LUI
//UI nodes (with upstream changes)
= LUINode UIType UIAttributes [LUI] LUIChanges LUIEffects
= LUINode !UIType !UIAttributes ![LUI] !LUIChanges !LUIEffects
//Placeholder nodes
| LUIShiftDestination LUIShiftID
| LUIMoveSource LUIMoveID
| LUIMoveDestination LUIMoveID LUINo
| LUIShiftDestination !LUIShiftID
| LUIMoveSource !LUIMoveID
| LUIMoveDestination !LUIMoveID !LUINo
//Upstream UI changes
:: LUIChanges =
......@@ -129,18 +129,18 @@ sequenceLayouts :: [LayoutRule] -> LayoutRule
, toBeRemoved :: !Bool
, toBeReplaced :: !Maybe LUI
, toBeShifted :: !Maybe LUIShiftID
, setAttributes :: UIAttributes
, delAttributes :: Set UIAttributeKey
, setAttributes :: !UIAttributes
, delAttributes :: !Set UIAttributeKey
}
:: LUIEffects =
{ overwrittenType :: LUIEffectStage (LUINo,UIType)
, overwrittenAttributes :: Map UIAttributeKey (LUIEffectStage (LUINo,JSONNode))
, hiddenAttributes :: Map UIAttributeKey (LUIEffectStage LUINo)
, additional :: LUIEffectStage LUINo
, hidden :: LUIEffectStage LUINo
, wrapper :: LUIEffectStage LUINo
, unwrapped :: LUIEffectStage LUINo
{ overwrittenType :: !LUIEffectStage (!LUINo, !UIType)
, overwrittenAttributes :: !Map UIAttributeKey (LUIEffectStage (!LUINo, !JSONNode))
, hiddenAttributes :: !Map UIAttributeKey (LUIEffectStage LUINo)
, additional :: !LUIEffectStage LUINo
, hidden :: !LUIEffectStage LUINo
, wrapper :: !LUIEffectStage LUINo
, unwrapped :: !LUIEffectStage LUINo
}
//Layout rules determine that an effect should according to that rule be applied or restored.
......@@ -149,11 +149,11 @@ sequenceLayouts :: [LayoutRule] -> LayoutRule
:: LUIEffectStage a
//In between events effects can only be either applied or not
= ESNotApplied
| ESApplied a
| ESApplied !a
//While the layout rules are applied the effects can be in intermediate state
| ESToBeApplied a
| ESToBeUpdated a a
| ESToBeRemoved a
| ESToBeApplied !a
| ESToBeUpdated !a !a
| ESToBeRemoved !a
//Nodes that are moved by a moveSubUIs rule need to be accesible both in their source location (to apply changes)
//and in their destination location (to apply further effects).
......@@ -165,7 +165,7 @@ noChanges :: LUIChanges
noEffects :: LUIEffects
//When layout rules make changes, it must be tracable which layout rule caused the change
:: LUINo = LUINo [Int]
:: LUINo = LUINo ![Int]
instance < LUINo
instance == LUINo
......
......@@ -68,8 +68,8 @@ ActionClose :== Action "Close"
* State of another task instance.
*/
:: AttachmentStatus
= ASAttached Stability //* the task instance is currently attached to this task
| ASInUse TaskId //* the task instance is already attached to another task
= ASAttached !Stability //* the task instance is currently attached to this task
| ASInUse !TaskId //* the task instance is already attached to another task
| ASExcepted //* the task instance had an uncaught exception
| ASDeleted //* the task instance does not exist anymore
| ASIncompatible //* the task instance can not be executed in this is version of the program (it was created by an older version)
......
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