import Base import ./ordinary_app_observation_data.bend as DTO type Recipe World & DTO.Observation> is Type: Recipe{} def observation_right(~World:Type,~L:Data,~R:Data,left:L,leftText:List<&2,String>,result:World & DTO.Observation) -> World & DTO.Observation>: match result: case (world,DTO.Observation{right,rightText}):(world,DTO.Observation{DTO.Product{left,right},List.append(&2,String,leftText,rightText)}) def observation_left(~World:Type,~L:Data,~R:Data,~right:World -> World & DTO.Observation,result:World & DTO.Observation) -> World & DTO.Observation>: match result: case (world,DTO.Observation{value,text}):observation_right(~World,~L,~R,value,text,right(world)) def observe_pair(~World:Type,~L:Data,~R:Data,~left:World -> World & DTO.Observation,~right:World -> World & DTO.Observation,world:World) -> World & DTO.Observation>: observation_left(~World,~L,~R,~right,left(world))