On Nov 27, 2007 4:45 AM, Chris Eidhof <<a href="mailto:chris@eidhof.nl">chris@eidhof.nl</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
First, some people want to use return just as an imperative programmer<br>would use it: to exit from a function. So the programmer doesn't<br>expect the commands after that return are executed.<br></blockquote><div><br>
This is more a problem with the name. I doubt this particular problem would arise if return were called something like "pure" (like the equivalent in Applicative). <br><br>I suspect the solution here is better documentation. There are logical reasons for return to be called "return". We just need to point out to new programmers that it's not the same as return in other languages. Much like how Haskell's classes are not like the classes in object-oriented languages.
<br><br>Incidentally, lots of early monad papers use names like "unit". When did Haskell settle on the name "return"? My guess is that it has something to do with the old monad comprehension syntax.<br>
</div></div><br>-- <br>Dave Menendez <<a href="mailto:dave@zednenem.com">dave@zednenem.com</a>><br><<a href="http://www.eyrie.org/~zednenem/">http://www.eyrie.org/~zednenem/</a>>