module test
import iTasks
+import Data.Func
-:: OpenWeatherResponse =
- { main :: OpenWeatherResponseMain
- , weather :: [OpenWeatherResponseWeather]
- }
+Start w = doTasks t w
+where
+ t = parallel
+ [(Embedded, \stl->tune (Title "New Task") $ addTask stl
+ >>* [OnAction (Action "Close") (always (return ()))])
+ ] [] <<@ ArrangeWithTabs True
-:: OpenWeatherResponseWeather =
- { id :: Int
- , main :: String
- , description :: String
- , icon :: String
- }
-:: OpenWeatherResponseMain =
- { temp :: Real
- , pressure :: Int
- , humidity :: Int
- , temp_min :: Real
- , temp_max :: Real
- }
-
-derive class iTask OpenWeatherResponseMain, OpenWeatherResponseWeather, OpenWeatherResponse
-Start w = doTasks (viewInformation [] v <<@ Title "Weather in Nijmegen from openweather.com") w
-
-v = {temp=18.4, pressure=1050, humidity=60, temp_min=12.5, temp_max=24.1}
+ addTask :: (SharedTaskList ()) -> Task ()
+ addTask stl
+ = (enterInformation [] <<@ Label "Title") -&&- updateInformation [] "text"
+ >>! \(title, text)->appendTask Embedded
+ (\_->tune (Title title) $ viewInformation [] text @? const NoValue)
+ stl
+ >-| addTask stl