Version with type classes