Commit bd37fd74 authored by Bas Lijnse's avatar Bas Lijnse

More refactoring. Isolated the Void type in its own module.

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/branches/fancyTasks@339 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent 9de80479
definition module Void
/**
* This module defines the empty type 'Void' which means something like 'no value'.
*/
:: Void = Void
implementation module Void
......@@ -2,6 +2,7 @@ definition module iDataForms
import iDataSettings
import iDataState
import StdMaybe, Void
import GenPrint, GenParse
import HSt
......@@ -69,8 +70,8 @@ derive gUpd Int, Real, Bool, String, UNIT, PAIR, EITHER, OBJECT, CONS, FIELD
/**
* Instances of the generics for very common types
*/
derive gForm (,), (,,), (,,,), Maybe
derive gUpd (,), (,,), (,,,), Maybe
derive gForm (,), (,,), (,,,), Maybe, Void
derive gUpd (,), (,,), (,,,), Maybe, Void
derive bimap Form, FormId
......
......@@ -279,7 +279,7 @@ gForm{|(,,,)|} gHa gHb gHc gHd (init,formid) hst
where
(a,b,c,d) = formid.ival
derive gForm Maybe //TODO: Define the gForm for maybe with a checkbox
derive gForm Maybe, Void //TODO: Define the gForm for maybe with a checkbox
// gUpd calculates a new value given the current value and a change in the value.
// If necessary it invents new default values (e.g. when switching from Nil to Cons)
......@@ -368,10 +368,8 @@ gUpd{|FIELD|} gUpdx mode (FIELD x) // other cases
gUpd{|(->)|} gUpdArg gUpdRes mode f
= (mode,f)
derive gUpd (,)
derive gUpd (,,)
derive gUpd (,,,)
derive gUpd Maybe
derive gUpd (,), (,,), (,,,), Maybe, Void
// gForm: automatically derives a Html form for any Clean type
mkForm :: !(InIDataId a) *HSt -> *(Form a, !*HSt) | gForm {|*|} a
......
......@@ -8,9 +8,9 @@ import StdMaybe
import iDataForms
//Always derive storage generic functions for common types
derive gPrint (,), (,,), (,,,), Maybe
derive gParse (,), (,,), (,,,), Maybe
derive gerda (,), (,,), (,,,)
derive gPrint (,), (,,), (,,,), Maybe, Void
derive gParse (,), (,,), (,,,), Maybe, Void
derive gerda (,), (,,), (,,,), Void
/*
* The FormStates structure contains the state of all forms
......
......@@ -9,10 +9,10 @@ import FormId
import StdMaybe
import StdDebug
derive gPrint (,), (,,), (,,,), Maybe
derive gParse (,), (,,), (,,,), Maybe
derive gerda (,), (,,), (,,,)
derive bimap (,), (,,), (,,,), Maybe
derive gPrint (,), (,,), (,,,), Maybe, Void
derive gParse (,), (,,), (,,,), Maybe, Void
derive gerda (,), (,,), (,,,), Void
derive bimap (,), (,,), (,,,), Maybe, Void
// This module controls the handling of state forms and the communication with the browser
// iData states are maintained in a binary tree
......
......@@ -51,7 +51,7 @@ Execute all Tasks in parallel / interleaved and FINISH as soon as the predicate
allTasksCond :: - string is used to give a useful name to the trace;
- the predicate is applied on the set of tasks which are finished
*/
:: DisplaySubTasks :== !String !TaskNr ![(Bool,HtmlTree)] -> HtmlTree // function determining how to display the subtasks
:: DisplaySubTasks :== String TaskNr [(Bool,HtmlTree)] -> HtmlTree // function determining how to display the subtasks
:: FinishPred a :== [a] -> Bool // predicate determining when the task is finished, depending on the results returned by finished subtasks
allTasksCond :: !String !DisplaySubTasks !(FinishPred a) ![LabeledTask a] -> Task [a] | iData a
......
......@@ -9,21 +9,6 @@ definition module iTasksTypes
import InternaliTasksCommon
derive gForm Void
derive gUpd Void
derive gPrint Void
derive gParse Void
derive read Void
derive write Void
// ******************************************************************************************************
// iTask end user types.
// ******************************************************************************************************
//:: Task a // for the end user a Task can be regarded as an abstract data type
:: Void = Void // for tasks returning non interesting results, won't show up in editors either
// ******************************************************************************************************
// iTask options + overloaded operators to set the options
// iTasks inherits the following options from the iData library: Lifespan, SorageFormat, Mode
......
implementation module iTasksTypes
derive gForm Void, []
derive gUpd Void, []
derive gParse Void
derive gPrint Void
derive gerda Void
derive read Void
derive write Void
import StdEnv
import InternaliTasksCommon, InternaliTasksThreadHandling, BasicCombinators
import GenBimap
......
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