Skip to content

Comment on C# almost has implicit interfaces

Comments

In other words: an interface with one member is equivalent to a function reference.

There is an equivalence between public interface IThingDoer { int DoTheThing(int value); } and Func<int, int> doTheThing.

Converting from one to the other is left as an exercise to the reader.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.