10 ms·
True enough, when you're writing imperative Haskell, you're not hitting the claimed magic of FP. But: 1. Haskell lets your write the majority of your code in
by garethrowlands 5y ago
True enough, when you're writing imperative Haskell, you're not hitting the claimed magic of FP.
But:
1. Haskell lets your write the majority of your code in pure style. And it helps you separate the imperative parts (like pure core, imperative shell).
2. The compiler tries hard to generate the same machine code as C. The difference is that it gives the programmer more options: because the imperative parts are values (actions), it's strightforward to calculate them, which you can't do in C (you'd need the preprocessor or maybe LISP macros).