Defined type classes and implemented their instances.