Observable<TResult> Select<T, TResult>(this Observable<T> source, Func<T, TResult> selector { return new Select<T, TResult>(source, selector); } } internal sealed class Select<T, TResult>(Observable<T> source, Func<T, TResult> selector) : Observable<TResult> { protected override IDisposable SubscribeCore(Observer<TResult> observer) { return source.Subscribe(new _Select(observer, selector)); } sealed class _Select(Observer<TResult> observer, Func<T, TResult> selector) : Observer<T> { protected override void OnNextCore(T value) => observer.OnNext(selector(value)); protected override void OnErrorResumeCore(Exception error) => observer.OnErrorResume(error); protected override void OnCompletedCore(Result result) => observer.OnCompleted(result); } } 抽象クラスに重要な箇所を押し付けているた め、非常にシンプルもOperatorが書ける! primary constructorが威力を発揮する