Implement interface by expression
One of the key recommendations for using the object-oriented features of F# is to "prefer composition over inheritance". One problem with this approach is that we often need to re-implement an interface that is already implemented by some object that we are using. The re-implementation has to explicitly implement the interface and all methods have to be delegated to the object that already implements the functionality.
To make this easier, I would like to be able to "implement an interface by expression". For example how this might work, see: http://fssnip.net/jP
This would allow wider range of uses - for example, one could implement IDisposable just by writing a function that takes a list of IDisposables and composes them into a single one.
Joerg Beekmann commented
I suggest a slight refinement. Rather than delegating all operations to the object return by the expression, delegate only those NOT implemented by the new type.