I have been learning about various functional languages for some time now including Haskell, Scala and Clojure. Haskell has a very strict and well-defined static type system. Scala is also statically typed. Clojure on the other hand, is dynamically typed.
So my questions are
- What role does the type system play in a functional language?
- Is it necessary for a language to have a type system for it to be functional?
- How is the “functional” level of a language related to the kind of the type system of the language?
A language does not need to be typed to be functional – at the heart of functional programming is the lambda calculus, which comes in untyped and typed variants.
The type system plays two roles:
In advanced type systems like Haskell’s, the type system can provide more benefits: