update (AddRegion si ri c r) = do
    modify $ \s ->
        case Map.lookup si (scenes s) of
            Nothing -> s
            Just sc ->
                s {
                    scenes =
                        Map.insert si (sc {
                            featureSpace = FeatureSpace.updateRegion (FeatureSpace.mkRegion ri c r) (featureSpace sc)
                            })
                            (scenes s) }
    output $ AddRegion' si ri
update (AddRegion si ri c r) = do
    modify $ \s ->
        case Map.lookup si (scenes s) of
            Nothing -> s
            Just sc ->
                s {
                    scenes =
                        Map.insert si (sc {
                            featureSpace = FeatureSpace.updateRegion (FeatureSpace.mkRegion ri c r) (featureSpace sc)
                            })
                            (scenes s) }
    output $ AddRegion' si ri
update (AddRegion si ri c r) = do
    modify $ \s ->
        case Map.lookup si (scenes s) of
            Nothing -> s
            Just sc ->
                s {
                    scenes =
                        Map.insert si (sc {
                            featureSpace = FeatureSpace.updateRegion (FeatureSpace.mkRegion ri c r) (featureSpace sc)
                            })
                            (scenes s) }
    output $ AddRegion' si ri