Type-classes for mirage applications