async: Add type constraints to modules

Without these, all types would be opaque and useless.
async: learning switch example