4 ms·
Let bindings create a new local scope. It's only in the GHCi prompt that they apply "from this point on". It is possible to do a more global redefinition but a
by almost 17y ago
Let bindings create a new local scope. It's only in the GHCi prompt that they apply "from this point on".
It is possible to do a more global redefinition but as far as I know you'd have to suppress the Standard Prelude which would mean you wouldn't really be in Haskell 98 anymore. It's certainly not something that would happen in a normal software project.
So to answer your question: In Haskell the effect is contained to a lexical scope (a few lines usually) where as in C++ it infects absolutely everything.