- Define related sets or sequences of algorithms to be defined together (need explicit example)
- Specify required static extension methods for implementing things like LINQ or Rx.
- Transducers cannot currently be implemented efficiently in .NET.
Transducers would need to use
IEnumerable<_>
as a base collection type rather than potentially more efficient implementations (or retaining the input's stype, e.g.List<_>
, etc). - F# modules such as
List
,Array
, andSeq
all provide functions that are the same in nature but differ by wrapper type. However, it is not possible for a new collection type to ensure it adheres to this same specification without manually checking for completeness.
Extension interfaces would allow the implementation of an interface to exist apart from a type definition and would obviate the need for techniques like "Assembly Neutral Interfaces". This feature would provide a more generic form of type classes for implementing functors, monads, etc. or mixins/traits for those looking for ways to adapt existing types without explicit boilerplate to adapt types (and avoiding allocations).
- Re-use existing types to implement new interfaces. Example: define a new generic
IListLike
that exposes a set of required methods for X domain and use existing types such asList<_>
,Array<_>
, etc. as implementations. - Allow implementors to extend a type into an interface based on their own needs rather that the original author's. Example: specify interfaces for HTTP requests and responses that may be implemented as structs in one library, classes in another, F# records in an F# representation, or even implemented as an OWIN dictionary.
- Free monads could be implemented without a lot of boilerplate.