3 ms·
What is the part of FP in Haskell you can't do in lets say C++? EDIT: or to phrase it better, what is missing or hard to do that you feel has the biggest influ
by detaro 12y ago
What is the part of FP in Haskell you can't do in lets say C++?
EDIT: or to phrase it better, what is missing or hard to do that you feel has the biggest influence (some things are possible, but just way more complicated)? I don't have enough FP experience myself to judge that.
- codygman 12y agoHow can you guarantee referential with C++? Can you do it in a practical way? I've heard of people using templates to do this, but is a solution like that really maintainable? Can you write maintainable, sane, and performant C++ code that leverages immutable data structures, guarantees referential transparency, and eschews mutable state?
- einhverfr 12y agoNow, note what I said that started this thread, that you can do FP in any language. I never said you could do it well or maintainably. For some languages (I am thinking of Java in particular, but C++ seems similar there), I can't imagine it being more than useful as an academic exercise. Certainly there are languages which don't support FP approaches well. But lack of utility is not the same as impossibility. If nothing else the exercise ("How far can you take FP in Java?") will teach you all kinds of things.
- codygman 12y ago> Now, note what I said that started this thread, that you can do FP in any language. I never said you could do it well or maintainably. For some languages (I am thinking of Java in particular, but C++ seems similar there), I can't imagine it being more than useful as an academic exercise. > Certainly there are languages which don't support FP approaches well. But lack of utility is not the same as impossibility. If nothing else the exercise ("How far can you take FP in Java?") will teach you all kinds of things. My mistake then. I agree that seeing how far you can take FP in Java is a useful exercise.