Let 5 = 6
martijn.van.steenbergen.nl
martijn.van.steenbergen.nl
C++ is used more often as a common-denominator language for many programmers of varying skill who are collaborating on a project, and as you move toward that domain, transparency and safety start to become more important than power, since a big element of getting anything done is just not screwing each other over with unreadable code.
You can get away with only implementing some of the functions in a typeclass. However you'll get a warning.
If you need the code watered down into a deluge of little baby steps to satisfy your own definition of "readability", that's fine. I personally don't find useless dissipation of program logic to be readable.
'accidental complexity' = 'essential complexity' / 'your intelligence' You are forgetting accidental circumstances, like your current involvement with this particular code and the particular problems it solves. Code should read like a mathematical proof, exactly because it allows you to follow the steps in between.
The requisite granularity of the between steps is completely subjective. If you're catering for the lowest common denominator, then you give up some succinctness, which may be more readable to someone unfamiliar with the concepts, but may just act as a time-wasting loss of abstraction that actually obscures readability to those who are familiar. You wouldn't want me to step through the proofs of associativity and commutativity of addition every time the rule is used, would you? That's why we just prove it once, give it a name, and assume a basic standard of intelligence/familiarity for those who have commit access.
If you're not comfortable with (otherwise sane) overloading in C++, you probably aren't going to like it in Haskell, either.
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.
I think Haskell is a very nice language and it's flexibility on definitions is very cool, but I don't think this is a good example of it.
You'd probably do something like: let n - m = ( n + (-m) ) `mod` 6
'let 3 - 4 = 5' is just a non-sense example.