Support type alias

Fix #672.
Do you mean poor performances on debug mode or release mode? It release mode, there is still cost on traversing the whole sequence.