Deep runtime type equality testing
A helper which produces serial async functions without losing return values