anchor.diff:    Stream<T> get onEnter => _settable.onEnter;
   
     Stream<T> get onExit => _settable.onExit;
  +}
  +
  +/// A scope that is a function of another scope.
  +class TransformScope<T> extends Scope<T> {
  +  final SettableScope<T> _backing;
  +
  +  TransformScope._(
  +      this._backing,
  +      Scope<T> original,
  +      void onEnter(T value, SettableScope<T> scope),
  +      void onExit(T value, SettableScope<T> scope)) {
  +    if (onEnter != null) original.onEnter.listen((t) => onEnter(t, _backing));
  +    if (onExit != null) original.onExit.listen((t) => onExit(t, _backing));
  +  }
  +
  +  TransformScope.entered(Scope<T> original,
  +      {void onEnter(T value, SettableScope<T> scope),
  +      void onExit(T value, SettableScope<T> scope)})
  +      : this._(new SettableScope.entered(), original, onEnter, onExit);
  +
  +  TransformScope.notEntered(Scope<T> original,
  +      {void onEnter(T value, SettableScope<T> scope),
  +      void onExit(T value, SettableScope<T> scope)})
  +      : this._(new SettableScope.notEntered(), original, onEnter, onExit);
  +
  +  bool get isEntered => _backing.isEntered;
  +  Stream<T> get onEnter => _backing.onEnter;
  +  Stream<T> get onExit => _backing.onExit;
   }
   
   typedef T GetNewValue<T>(T currentValue);
  
positive.code:   Stream<T> get onExit => _onExit;
  
    // TODO onClose ?
  }
  
  class ForwardingScope extends Scope {
    // TODO: API for closing scope
    final StreamController _enters = new StreamController.broadcast(sync: true);
    final StreamController _exits = new StreamController.broadcast(sync: true);
  
  
negative.code:   }
  
    SettableScope.entered() : this._(true);
    SettableScope.notEntered() : this._(false);
  
    /// Immediately changes scope state and calls onEnter listeners.
  