4 ms·
The function doesn't have to be useless. He uses a small and simple example to illustrate it. However the more common example of this is an interface with publi
by zaphar 13y ago
The function doesn't have to be useless. He uses a small and simple example to illustrate it. However the more common example of this is an interface with public piece your consumers can interact with and a private piece that only you can interact with.
- seanmcdirmid 13y ago> However the more common example of this is an interface with public piece your consumers can interact with and a private piece that only you can interact with. Also known as...a class. Honestly, this is why classes exist: they are able to support both public and private interfaces, while interfaces and type classes are only able to support public interfaces. The closest we get to this essential aspect of OO programming in the H & M world is via existential types.