improve operator== and stringizing types

- check the left hand side of operator== in types
- add type::to_string() for more convenience
add unknown type to deal with compilation errors