From a conversation started on GitHub:
class A { constructor(public value: T) {} } const wrap = (value: T) => { if (value instanceof A)