improved efficiency for some constraint stuff
Merge pull request #2 from tobyink/type-constraints

improved efficiency for some constraint stuff