Latest Tech News

Stay updated with the latest in technology, AI, cybersecurity, and more

Filtered by: insert Clear Filter

Generic interfaces

Generic interfaces Axel Wagner 7 July 2025 There is an idea that is not obvious until you hear about it for the first time: as interfaces are types themselves, they too can have type parameters. This idea proves to be surprisingly powerful when it comes to expressing constraints on generic functions and types. In this post, we’ll demonstrate it, by discussing the use of interfaces with type parameters in a couple of common scenarios. A simple tree set As a motivating example, assume we need