In the arithmetic of love, one plus one equals everything, and two minus one equals nothing.
-Mignon McLaughlin
What does the following expression in haskell evaluate to?
1 |
|
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Addition is just a binary operation. It works the way you define it!
In Haskell, you are allowed to overwrite the way + works like an ordinary function. In particular, this code defines 2+2 to be 5