*/
import iTasks
+import StdArray // To check string length
:: Idea:== String
:: Name:== String
-:: NamedIdea = { name :: Name, idea :: Idea}
+:: NamedIdea = { name :: Name, idea :: [Idea]}
derive class iTask NamedIdea // generic magic
doIdentified :: (Name -> Task x) -> Task x | iTask x
doIdentified task = enterInformation "Enter your name" [] >>= task
editIdea :: Name -> Task NamedIdea
-editIdea name = enterInformation (name +++ " add your idea") []
+editIdea name = enterInformation (name +++ " add your ideas") []
>>= \idea . return {name = name, idea = idea}
-mainTask = doIdentified editIdea >>= viewInformation "The result" []
+mainTask = doIdentified editIdea >>= viewInformation "The result" [
+ ViewWith (\x=:{name,idea}.{x & idea=[name:fideas idea]})]
+ where
+ //Format the indices and the ideas
+ fideas i = map (\(x,y).toString (x+1) +++ ": " +++ y) (filt i)
+ //Filter the ideas on length and add indices
+ filt i = zip2 (indexList i) (filter (\x.size x > 10) i)
Start :: *World -> *World
Start world = startEngine mainTask world