Improve types::enumerate
Reimplement enum.h with types