OOP接口和FP类型之间的区别[duplicate](Difference between OOP interfaces and FP type classes [duplicate])
可能重复:
Java的接口和Haskell的类型类:差异和相似之处?当我开始学习haskell时,我被告知类型类比界面更强大/不同。
一年以后,我已经广泛使用了界面和类型,我还没有看到一个例子,或者说是不同的。 这不是一个自然而然的启示,我错过了一些明显的东西,或者实际上没有真正的区别。
搜索互联网没有任何实质。 那么,你有答案吗?
Possible Duplicate:
Java's Interface and Haskell's type class: differences and similarities?When I started learning Haskell, I was told that type classes are different and more powerful than interfaces.
One year later, I've used interfaces and type classes extensively and I've yet to see an example or explanation of how they are different. It's either not a revelation that comes naturally, or I've missed something obvious, or there is in actual fact no real difference.
Searching the Internet hasn't turned up anything substantial. So SO, do you have the answer?
原文:https://stackoverflow.com/questions/8122109