Closed henix closed 10 years ago
这篇文章讨论了如何用 scala 的 implicit class 实现类似 Haskell 的 type class 的功能。
http://eed3si9n.com/ja/scala-implicits-type-classes http://debasishg.blogspot.com/2010/01/case-for-orthogonality-in-design.html
最后的结论是 scala 和 Haskell 的方法各有优劣
把各种概念分解到不要互相关联的粒度,概念与概念之间垂直,不要互相依赖
这篇文章讨论了如何用 scala 的 implicit class 实现类似 Haskell 的 type class 的功能。
http://eed3si9n.com/ja/scala-implicits-type-classes http://debasishg.blogspot.com/2010/01/case-for-orthogonality-in-design.html
最后的结论是 scala 和 Haskell 的方法各有优劣
把各种概念分解到不要互相关联的粒度,概念与概念之间垂直,不要互相依赖