Abstract that accepts callback functions to the then method.

Valid callbacks are:

  • T->R: Function that returns a value of type R.
  • T->Thenable<R>: Function that returns a thenable Thenable with value type R.
  • T->Promise<R>: Function that returns a promise Promise with value type R.

On JS, this unifies to js.lib.Promise.PromiseHandler.