Commit 1aa91173 authored by Pieter Koopman's avatar Pieter Koopman

infix direction added for =>>, ?>>, !>>, <<?, <<! etc.


git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@80 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent 2584986d
......@@ -78,7 +78,7 @@ editTaskPred :: !a !(a -> (Bool, [BodyTag])) -> Task a | iData a
return_V :: lift a value to the iTask domain and return it
*/
(=>>) infix 1 :: !(Task a) !(a -> Task b) -> Task b | iCreateAndPrint b
(=>>) infixl 1 :: !(Task a) !(a -> Task b) -> Task b | iCreateAndPrint b
(#>>) infixl 1 :: !(Task a) !(Task b) -> Task b
return_V :: !a -> Task a | iCreateAndPrint a
......@@ -93,12 +93,12 @@ return_VF :: return the value and show the Html code specified
return_D :: return the value and show it in iData display format
*/
(?>>) infix 5 :: ![BodyTag] !(Task a) -> Task a | iCreate a
(!>>) infix 5 :: ![BodyTag] !(Task a) -> Task a | iCreate a
(<<?) infix 5 :: !(Task a) ![BodyTag] -> Task a | iCreate a
(<<!) infix 5 :: !(Task a) ![BodyTag] -> Task a | iCreate a
(<|) infix 6 :: !(Task a) !(a -> (Bool, [BodyTag])) -> Task a | iCreate a
(<!) infix 6 :: !(Task a) !(a -> .Bool) -> Task a | iCreateAndPrint a
(?>>) infixr 5 :: ![BodyTag] !(Task a) -> Task a | iCreate a
(!>>) infixr 5 :: ![BodyTag] !(Task a) -> Task a | iCreate a
(<<?) infixl 5 :: !(Task a) ![BodyTag] -> Task a | iCreate a
(<<!) infixl 5 :: !(Task a) ![BodyTag] -> Task a | iCreate a
(<|) infixl 6 :: !(Task a) !(a -> (Bool, [BodyTag])) -> Task a | iCreate a
(<!) infixl 6 :: !(Task a) !(a -> .Bool) -> Task a | iCreateAndPrint a
return_VF :: ![BodyTag] !a -> Task a | iCreateAndPrint a
return_D :: !a -> Task a | gForm {|*|}, iCreateAndPrint a
......
......@@ -664,7 +664,7 @@ where
// ******************************************************************************************************
// monads for combining iTasks
(=>>) infix 1 :: !(Task a) !(a -> Task b) -> Task b | iCreateAndPrint b
(=>>) infixl 1 :: !(Task a) !(a -> Task b) -> Task b | iCreateAndPrint b
(=>>) taska taskb = mybind
where
mybind tst=:{options}
......@@ -700,7 +700,7 @@ where
// adding Html code for prompting and feedback
//(?>>) infix 5 :: [BodyTag] !(Task a) -> (Task a) | iCreate a
(?>>) infix 5 :: ![BodyTag] !(Task a) -> Task a | iCreate a
(?>>) infixr 5 :: ![BodyTag] !(Task a) -> Task a | iCreate a
(?>>) prompt task = doTask
where
doTask tst=:{html=ohtml,activated}
......@@ -709,7 +709,7 @@ where
| activated = (a,{tst & html = ohtml})
= (a,{tst & html = ohtml +|+ BT prompt +|+ nhtml})
(<<?) infix 5 :: !(Task a) ![BodyTag] -> Task a | iCreate a
(<<?) infixl 5 :: !(Task a) ![BodyTag] -> Task a | iCreate a
(<<?) task prompt = doTask
where
doTask tst=:{html=ohtml,activated}
......@@ -718,7 +718,7 @@ where
| activated = (a,{tst & html = ohtml})
= (a,{tst & html = ohtml +|+ nhtml +|+ BT prompt})
(!>>) infix 5 :: ![BodyTag] !(Task a) -> (Task a) | iCreate a
(!>>) infixr 5 :: ![BodyTag] !(Task a) -> (Task a) | iCreate a
(!>>) prompt task = doTask
where
doTask tst=:{html=ohtml,activated=myturn}
......@@ -726,7 +726,7 @@ where
# (a,tst=:{html=nhtml}) = task {tst & html = BT []}
= (a,{tst & html = ohtml +|+ BT prompt +|+ nhtml})
(<<!) infix 5 :: !(Task a) ![BodyTag] -> (Task a) | iCreate a
(<<!) infixl 5 :: !(Task a) ![BodyTag] -> (Task a) | iCreate a
(<<!) task prompt = doTask
where
doTask tst=:{html=ohtml,activated=myturn}
......@@ -734,7 +734,7 @@ where
# (a,tst=:{html=nhtml}) = task {tst & html = BT []}
= (a,{tst & html = ohtml +|+ nhtml +|+ BT prompt})
(<|) infix 6 :: !(Task a) !(a -> (Bool, [BodyTag])) -> Task a | iCreate a
(<|) infixl 6 :: !(Task a) !(a -> (Bool, [BodyTag])) -> Task a | iCreate a
(<|) taska pred = doTask
where
doTask tst=:{html = ohtml,activated}
......@@ -794,7 +794,7 @@ where
# (na,tst) = task a tst
= dorepeatTask na tst
(<!) infix 6 :: !(Task a) !(a -> .Bool) -> Task a | iCreateAndPrint a
(<!) infixl 6 :: !(Task a) !(a -> .Bool) -> Task a | iCreateAndPrint a
(<!) taska pred = mkTask "less!" doTask
where
doTask tst=:{activated, tasknr}
......@@ -879,7 +879,7 @@ dochooseTask horizontal taskOptions tst=:{tasknr,html,options,userId} //
# (chosen,tst) = LiftHst (mkStoreForm (Init,storageFormId options taskId -1) id) tst
| chosen.value == -1 // no choice made yet
# allButtons = if horizontal
[[(but txt,\_ -> n) \\ txt <- map fst taskOptions & n <- [0..]]]
[[(but txt,\_ -> n) \\ txt <- map fst taskOptions & n <- [0..]]]
[[(but txt,\_ -> n)] \\ txt <- map fst taskOptions & n <- [0..]]
# (choice,tst) = LiftHst (TableFuncBut (Init,pageFormId options buttonId allButtons)) tst
# (chosen,tst) = LiftHst (mkStoreForm (Init,storageFormId options taskId -1) choice.value) tst
......
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