add code for type inference
remove isInstanceOf
rename
Merge pull request #6 from typesafehub/wip/typeinference

add code for type inference