import Base import ./world.bend as W import ./ordinary_app_observation_data.bend as DTO import ./ordinary_optional_resource_declaration.bend as D def resource_returned(~S:Data,~C:Type,~R:Type,~E:Data,~Ops:Type -> Type,~V:Data,~declaration:D.Declaration,result:W.World & V) -> W.World & DTO.Observation: match result: case (world,+value):(world,DTO.Observation{value,[D.name(~S,~C,~R,~E,~Ops,~V,declaration) ++ "=" ++ D.presenter(~S,~C,~R,~E,~Ops,~V,declaration)(value)]}) def resource_observe(~S:Data,~C:Type,~R:Type,~E:Data,~Ops:Type -> Type,~V:Data,~declaration:D.Declaration,world:W.World) -> W.World & DTO.Observation: resource_returned(~S,~C,~R,~E,~Ops,~V,~declaration,D.observer(~S,~C,~R,~E,~Ops,~V,declaration)(world))