|
|
|
|
|
by ScottBurson
4354 days ago
|
|
This is certainly an intriguing answer, and makes me want to try Haskell sometime, but it also makes me wonder if I can't get the same benefits, with a little effort and discipline, in a "semi-functional" language such as something in the ML family or even (if I can live without static typing) Lisp. In fact, I've always made a point, when working in a semi-functional language, of writing as much code functionally as possible. My experience is that it has the same benefits as you describe. So I don't know how much more there is to be gotten by actually switching to Haskell. My guess is, most of the additional benefit would come from the type system. But maybe I would be motivated to write even more code functionally. |
|
You certainly can write similar code in ML, Java, or C - or whatever language strikes your fancy. It just helps when the type system is lined up with that goal, such as forcing you to denote where side-effects occur, and ensuring only functions that expect side-effect based code can operate on them. (For what it's worth, I've used both ML and Scheme to write similar style code as part of a programming languages class; and similarly, the C code I write relies on the functional ideas as much as possible.)
I just like the combination of Haskell's syntax and type system, so I prefer it to something like C (where functions aren't exactly a first class datatype, and the type system is somewhat weaker).