Add type alter capability to type hook.

This pull request means to resolve #1.