tag:blogger.com,1999:blog-178174920347765771.post5675298408512871978..comments2023-10-30T09:20:21.742-07:00Comments on One Div Zero: Monads are Elephants Part 4James Iryhttp://www.blogger.com/profile/02835376424060382389noreply@blogger.comBlogger18125tag:blogger.com,1999:blog-178174920347765771.post-21628259494295227532010-11-10T10:29:56.798-08:002010-11-10T10:29:56.798-08:00Tank you so very much for these articles - easy-to...Tank you so very much for these articles - easy-to-grasp explanations are such a great time saver :-)<br /><br />Especially so because after having achieved a first real grasp of a new concept, the many sometimes more in-depth articles all over the web suddenly turn from noise to a valuable source of information ;-)<br /><br />This way it took me just two days to reform myself from complete Sebastian Bohmannhttp://sebastian-bohmann.comnoreply@blogger.comtag:blogger.com,1999:blog-178174920347765771.post-77832015237430250272010-06-13T09:32:21.418-07:002010-06-13T09:32:21.418-07:00I'm kind of late @this party.
The right stuff ...I'm kind of late @this party.<br />The right stuff I was looking for. Thanks a lot!!!<br />It has a pretty practical application: transactions, say, in hibernate.<br />What,s missing is monad transformers. We may want a list or a set from IO, then what?<br />Was there the next part?Vlad Patryshevhttps://www.blogger.com/profile/13466586996802181998noreply@blogger.comtag:blogger.com,1999:blog-178174920347765771.post-21461563880908781372010-05-09T20:41:24.341-07:002010-05-09T20:41:24.341-07:00You mentioned another part, but I don't see it...You mentioned another part, but I don't see it. The public clamors for more knowledge!<br /><br />Great series.Heathhttps://www.blogger.com/profile/16219966444108277892noreply@blogger.comtag:blogger.com,1999:blog-178174920347765771.post-12392308829721146252009-08-09T15:40:43.756-07:002009-08-09T15:40:43.756-07:00Great series of articles!
There will ever be mor...Great series of articles! <br /><br />There will ever be more on monads?Pedro Furlanettohttps://www.blogger.com/profile/14664215916961577508noreply@blogger.comtag:blogger.com,1999:blog-178174920347765771.post-53032140289873451162008-09-29T21:17:00.000-07:002008-09-29T21:17:00.000-07:00>I am happy that Scala does not force one >s...>I am happy that Scala does not force one >style or the other, so I hope that the >different styles can coexist quite nice,<BR/><BR/>I'm a neophyte to FP/scala/monads. But as I understand the point of pure FP and side effects is that you cannot mix them. If anything (say some IO) has side effects then the whole program is imperative.<BR/><BR/>One suggested value of a pure FP marvinghttps://www.blogger.com/profile/11125496868000045917noreply@blogger.comtag:blogger.com,1999:blog-178174920347765771.post-61694902214389005822008-06-30T00:58:00.000-07:002008-06-30T00:58:00.000-07:00Well, this introduction is really wonderful.Should...Well, this introduction is really wonderful.<BR/>Should be downloadable as PDF or even find its way into the new Scala book.<BR/><BR/>OTOH, coming to Scala from the imperative and OO parallel universe, it is hard to understand the "why" of something like the IO monad.<BR/><BR/>You say: "Many will find the IO monad of little practical value in Scala. That's okay, I'm not here to preach about Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-178174920347765771.post-54112143872402582172008-05-22T23:42:00.000-07:002008-05-22T23:42:00.000-07:00Hi James! I've greatly enjoyed the series so far. ...Hi James! I've greatly enjoyed the series so far. It's been one of the best introductions to monad's that I've read. Perhaps, though, you feel that "monad introductions" are just <I>so</I> 2007, and that it would be inappropriate to continue in 2008. <BR/><BR/>IMHO, a monad introduction in '08 would be <I>so</I> retro. I think you should go for it ;^).Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-178174920347765771.post-18322026846017649262008-05-10T15:29:00.000-07:002008-05-10T15:29:00.000-07:00James, in the conclusion you hint two forthcoming ...James, in the conclusion you hint two forthcoming articles - please publish those.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-178174920347765771.post-18864690326127662892008-01-01T17:38:00.000-08:002008-01-01T17:38:00.000-08:00After reading this, I had an 'aha!' moment on Wiki...After reading this, I had an 'aha!' moment on Wikipedia, when I saw:<BR/><BR/>"In the list monad, a do-block is a list comprehension."<BR/><BR/>and<BR/><BR/>"xs >>= f = concat (map f xs)"<BR/><BR/>... looks like flatMap! :) <BR/>Anyways, thanks for the excellent series.Aemon Cannonhttps://www.blogger.com/profile/15851809301111020589noreply@blogger.comtag:blogger.com,1999:blog-178174920347765771.post-35735446889982944842007-12-06T14:20:00.000-08:002007-12-06T14:20:00.000-08:00You did it. This is the first introduction to Mon...You did it. This is the first introduction to Monads I've understood.<BR/><BR/>Thanks!!!<BR/><BR/>Looking forward to your next article!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-178174920347765771.post-18948651762660427802007-11-29T05:34:00.000-08:002007-11-29T05:34:00.000-08:00When I was testing the code I used the interpreter...When I was testing the code I used the interpreter. Using the interpreter, you have to explicitly call main so I didn't notice a problem: my main methods weren't returning Unit. As you discovered, when you try to compile and run the code the JVM won't deal with a main method otherwise. I've fixed the code and it should work as advertised now.<BR/><BR/>Also, an update on the stack overflow James Iryhttps://www.blogger.com/profile/02835376424060382389noreply@blogger.comtag:blogger.com,1999:blog-178174920347765771.post-59268629834388705242007-11-28T19:59:00.000-08:002007-11-28T19:59:00.000-08:00Very interesting articles.I had a little problem r...Very interesting articles.<BR/><BR/>I had a little problem running the examples.<BR/><BR/>HelloWorld inherits from the main method from IOApplication.<BR/><BR/>I thought I could run directly HelloWorld. But then I get:<BR/>Exception in thread "main" java.lang.NoSuchMethodError: main<BR/><BR/>I had to run the examples from another object which calls HelloWorld.main.<BR/><BR/>Why?Oscar Picassohttps://www.blogger.com/profile/14161739987239998942noreply@blogger.comtag:blogger.com,1999:blog-178174920347765771.post-63639712521646519342007-11-16T18:47:00.000-08:002007-11-16T18:47:00.000-08:00Marc, that's not a silly question at all but a dee...Marc, that's not a silly question at all but a deeply insightful one. One aspect of Erlang's binary syntax is that they act a bit like limited special purpose parsers for bit patterns. As it turns out monads are a nice way to build parsers.<BR/><BR/>Having said that, though, I'm not sure that parsers are the best way to duplicate Erlang's capabilities here. First, bit patterns are underpoweredJames Iryhttps://www.blogger.com/profile/02835376424060382389noreply@blogger.comtag:blogger.com,1999:blog-178174920347765771.post-35791249567903408552007-11-15T20:08:00.000-08:002007-11-15T20:08:00.000-08:00This might sound silly - hopefully not...Would mon...This might sound silly - hopefully not...<BR/><BR/>Would monads be the best basis for the development of an equivalent of Erlang's Bit Syntax in Scala?<BR/><BR/>That is matching against a bit string type and extracting based on a "string" of monad patterns? The string of monads building a matcher/extractor?Unknownhttps://www.blogger.com/profile/13285158632265388150noreply@blogger.comtag:blogger.com,1999:blog-178174920347765771.post-2829227244794064052007-11-07T18:26:00.000-08:002007-11-07T18:26:00.000-08:00I've got a solution to the stack overflow by using...I've got a solution to the stack overflow by using Either and continuation passing. I'll publish it as soon as I have some documentation written, but because it complicates the subject a bit I'll do it in a separate post and link to it from this one.James Iryhttps://www.blogger.com/profile/02835376424060382389noreply@blogger.comtag:blogger.com,1999:blog-178174920347765771.post-53862543183933098662007-11-07T07:44:00.000-08:002007-11-07T07:44:00.000-08:00For the purposes of this example, it doesn't need ...For the purposes of this example, it doesn't need to be ASCII characters, does it?<BR/><BR/>Why not have something textual, like 'andThen' or 'after', which might explain them in a little bit more detail instead of restricting yourself to the set of ASCII symbols? There may be people who are reading this may be approaching Scala from a different language where symbols are not identifiers, and theAlBluehttps://www.blogger.com/profile/06362201865553416948noreply@blogger.comtag:blogger.com,1999:blog-178174920347765771.post-90525341012609174442007-11-07T05:32:00.000-08:002007-11-07T05:32:00.000-08:00Unfortunately, the space of reasonably short and r...Unfortunately, the space of reasonably short and readable ASCII identifiers is pretty small and just about anything will collide with something else in some other language.<BR/><BR/>As for loop not being tail recursive - well, it can't be. The reason is a bit subtle. Loop isn't quite a normal loop. Instead, ultimately, it's an instance of ChainedAction. That's where the real problem is: as James Iryhttps://www.blogger.com/profile/02835376424060382389noreply@blogger.comtag:blogger.com,1999:blog-178174920347765771.post-50802832557996855052007-11-07T01:21:00.000-08:002007-11-07T01:21:00.000-08:00A great introduction to monads. Perhaps the 'next'...A great introduction to monads. Perhaps the 'next' and 'before' that you define with angled brackets might be better renamed to non-symbols for people getting to grasps with it? Those that are coming from a C++ background might be confused with the concatenation (though I appreciate the effects are similar).<BR/><BR/>Also, in your loop, it's not tail recursive at this stage as far as I can tell. AlBluehttps://www.blogger.com/profile/06362201865553416948noreply@blogger.com