from Text import class Text(startsWith,concat,split,join), instance Text String
+import qualified Data.Map as DM
+
from Data.Func import $
import Data.Tuple
import Data.List
]
viewShares :: Task ()
- viewShares = viewInformation () [] ()
+ viewShares = forever (
+ enterChoiceWithShared "Shares" [ChooseFromList sdsvw] sdsShare
+ >>* [OnValue $ withValue $ Just o updateShare]
+ >>* [OnAction (Action "Back") (const $ Just $ treturn ())]
+ )
+ where
+ sdsvw (k, v) = concat ["SDS ", toString k, ": ", toString v]
+ updateShare (k, v) = (viewInformation "Key" [] k
+ ||- updateInformation "Value" [] v)
+ >>= \nv->upd
+
viewDevices :: [MTaskDevice] -> Task ()
viewDevices ds = anyTask [
channels :: String -> Shared Channels
channels s = sdsFocus s $ memoryStore "" $ Just ([], [], False)
+ sdsShare :: Shared [(Int, Int)]
+ sdsShare = sdsFocus "mTaskSDSs" $ memoryStore "" $ Just [(1, 1)]
+
addDevice :: (Shared [MTaskDevice]) -> Task ()
addDevice devices = enterInformation "Device type and name" []
>>= \(name, ty)->get randomInt @ ((+++) name o toString)