add reduce for basic types

add basic type reduce support.