Hacker News new | ask | show | jobs
by gelisam 4827 days ago
try this:

    > let foo = map reverse
As the error message "clearly" says, the result "map reverse" is a function, which doesn't have a printed representation. You might think that all objects would at the minimum have a default printable representation as "[Object 0x011432542]" or something, but they don't. As always with haskell, the idea is to catch mistakes at compile time: in this case, mistakes where you wanted to show something meaningful to the user, but forgot to define how that kind of object should be printed.