- tune ArrangeHorizontal
- $ enterChoiceWithShared () [ChooseFromList (\(_, f, l)->f +++ ", " +++ l)] data
- >&> \v->whileUnchanged v \selection->case selection of
- Nothing = viewInformation "Nothing selected" [] () @? const NoValue
- Just x = updateInformation () [] x
+ tune ArrangeHorizontal
+ $ enterChoiceWithShared () [ChooseFromList (toString o snd)] (mapRead 'DM'.toList data)
+ >&> \sh->whileUnchanged sh \v->case v of
+ Nothing = return () @? const NoValue
+ Just x = updateInformation () [UpdateAs snd (tuple o fst)] x
+ >^* [ OnAction (Action "new") $ always $ upd (\l->'DM'.put (inc $ maxList $ 'DM'.keys l) (name "-" "-") l) data
+ , OnAction (Action "update") $ withValue \(i, n)->Just $ upd ('DM'.put i n) data
+ , OnAction (Action "delete") $ withValue \(i, n)->Just $ upd ('DM'.del i) data
+ ]