What would the following haskell code print?
1 2 3 4 5 6 7 |
|
Bonus: How does a similar piece of code behave in each of Python ? What about Mathematica?
Inspiration: Calvin's Problem
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.
If you have read the solution here , you might be thinking what the difference between that code and this code is.
There isn't. The difference is in the paradigm of programming: Haskell and Mathematica are functional languages where
=
is actually a definition, not an assertion.