The mechanism of N-haloamide promoted electrophilic additions. High regio- and stereoselectivity in the conversion of 2-tert-butyl-3,6-dihydro-2H-pyran into bromohydrins and in the opening of the corresponding epoxides