4 ms·
>- static typing; I'm not an expert on the theory or design of programming languages, but isn't static typing orthogonal to FP?
by vram22 12y ago
>- static typing;
I'm not an expert on the theory or design of programming languages, but isn't static typing orthogonal to FP?
- _Robbie 12y agoI will discuss Haskell, since I am not very familiar with other FP languages. In Haskell static typing is more useful than in other languages. This is because in Haskell the type signature of a function gives an upper bound of what the function does. In an impure language, a function may change any accessible mutable values and/or perform IO. These possible side effects mean that in an impure language the type of a function is a very weak indicator of what the function actually does.
- vram22 12y agoSo you're saying that static typing helps FP and hence is sort of a part of it? Thanks for the answer.
- noelwelsh 12y agoYes and no. A lot of the action in modern programming languages is in type systems. Static typing is synonymous with the dominant group of programming languages that subscribe to the "functional" label. There are other languages, such as Scheme, that are not statically typed that also subscribe to this label but they don't have the same mindshare at present. It's important to keep in mind that FP does not name some formally defined concept like the number 3 or the function cos. Rather it's a name given to a group of people and programming languages that share a common ancestry and world view. The definition is fuzzy and can be split many ways.
- vram22 12y agoInteresting, thanks. >It's important to keep in mind that FP does not name some formally defined concept like the number 3 or the function cos. Got it.