Aside the pitch from @davedelong, I tried to create my own type to accumulate the context but I failed because the current static capturing behavior isn't that trivial as I initially thought.
So it definitely requires a formal proposal and some compiler help to create such a type.