Preface、SML概観 ぱらぱらめくる『Purely Functional Data Structures』
- Haskellは関数型言語。Standard MLもそう。SMLはOCalm系らしい。似ている点もあれば違う点もある(こちら)。
- 共通点
- First-class support for algebraic datatypes (disjoint unions)
- Pattern matching on primitive and custom values
- Arbitrarily higher order functions
- Type synonyms
- Hindley-Milner Type Inference
- Parametric Polymorphism (define arbitrary Functors etc.)
- Ad-hoc polymorphism (Haskell through type classes, SML through modules)
- scorn of inclusion polymorphism (sub-type relations, a la object-wise inheritance)
- Monads (and other exotic algebraic structures)—"Haskell has monads" is a common claim of superiority, but the reality is that at the language level a monad is nothing more than an abstraction pattern, and hence every language (can) have monads. Including a monad or not in any given language is a library-level decision.
- 違い
- 評価全体