<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Here&#8217;s (one of the reasons) why Scala is awesome</title>
	<atom:link href="http://www.derekwyatt.org/2011/09/01/heres-one-of-the-reasons-why-monads-are-awesome/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.derekwyatt.org/2011/09/01/heres-one-of-the-reasons-why-monads-are-awesome/</link>
	<description>Vim... and stuff</description>
	<lastBuildDate>Sat, 11 May 2013 19:29:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Derek Wyatt</title>
		<link>http://www.derekwyatt.org/2011/09/01/heres-one-of-the-reasons-why-monads-are-awesome/comment-page-1/#comment-106419</link>
		<dc:creator>Derek Wyatt</dc:creator>
		<pubDate>Mon, 04 Feb 2013 10:31:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.derekwyatt.org/?p=391#comment-106419</guid>
		<description><![CDATA[The latest thing I&#039;ve been using is &lt;a href=&quot;http://mandubian.com/2012/11/11/JSON-inception/&quot; title=&quot;the new JSON parser in the Play Framework&quot; rel=&quot;nofollow&quot;&gt;the new JSON parser in the Play Framework&lt;/a&gt;.]]></description>
		<content:encoded><![CDATA[<p>The latest thing I&#8217;ve been using is <a href="http://mandubian.com/2012/11/11/JSON-inception/" title="the new JSON parser in the Play Framework" rel="nofollow">the new JSON parser in the Play Framework</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jane Smith</title>
		<link>http://www.derekwyatt.org/2011/09/01/heres-one-of-the-reasons-why-monads-are-awesome/comment-page-1/#comment-106406</link>
		<dc:creator>Jane Smith</dc:creator>
		<pubDate>Mon, 04 Feb 2013 09:52:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.derekwyatt.org/?p=391#comment-106406</guid>
		<description><![CDATA[What method do you use now?]]></description>
		<content:encoded><![CDATA[<p>What method do you use now?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derek Wyatt</title>
		<link>http://www.derekwyatt.org/2011/09/01/heres-one-of-the-reasons-why-monads-are-awesome/comment-page-1/#comment-106313</link>
		<dc:creator>Derek Wyatt</dc:creator>
		<pubDate>Sun, 03 Feb 2013 22:02:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.derekwyatt.org/?p=391#comment-106313</guid>
		<description><![CDATA[I&#039;ve certainly moved on from this method since I posted it, but it was a great learning tool at the time. :)]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve certainly moved on from this method since I posted it, but it was a great learning tool at the time. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jane Smith</title>
		<link>http://www.derekwyatt.org/2011/09/01/heres-one-of-the-reasons-why-monads-are-awesome/comment-page-1/#comment-106309</link>
		<dc:creator>Jane Smith</dc:creator>
		<pubDate>Sun, 03 Feb 2013 21:47:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.derekwyatt.org/?p=391#comment-106309</guid>
		<description><![CDATA[@Alex: learn to explain in a way that people can learn before you tell people they are not willing to learn.

@Derek: Scala is awesome, but parsing JSON in this way is sucky, compared to say http://xstream.codehaus.org/json-tutorial.html or https://github.com/codahale/jerkson.]]></description>
		<content:encoded><![CDATA[<p>@Alex: learn to explain in a way that people can learn before you tell people they are not willing to learn.</p>
<p>@Derek: Scala is awesome, but parsing JSON in this way is sucky, compared to say <a href="http://xstream.codehaus.org/json-tutorial.html" rel="nofollow">http://xstream.codehaus.org/json-tutorial.html</a> or <a href="https://github.com/codahale/jerkson" rel="nofollow">https://github.com/codahale/jerkson</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alek Storm</title>
		<link>http://www.derekwyatt.org/2011/09/01/heres-one-of-the-reasons-why-monads-are-awesome/comment-page-1/#comment-101346</link>
		<dc:creator>Alek Storm</dc:creator>
		<pubDate>Sun, 20 Jan 2013 08:30:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.derekwyatt.org/?p=391#comment-101346</guid>
		<description><![CDATA[A year and a half is likely a bit too long for this, but for posterity: List and Option in Scala are monads. The for/yield construction does not work on anything that&#039;s not a monad. The monadic model of computation is very popular in the functional world for writing parsers precisely because it allows this kind of control flow. So, in essence, you were right.

Also, Alexander was needlessly combative.]]></description>
		<content:encoded><![CDATA[<p>A year and a half is likely a bit too long for this, but for posterity: List and Option in Scala are monads. The for/yield construction does not work on anything that&#8217;s not a monad. The monadic model of computation is very popular in the functional world for writing parsers precisely because it allows this kind of control flow. So, in essence, you were right.</p>
<p>Also, Alexander was needlessly combative.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johannes Lichtenberger</title>
		<link>http://www.derekwyatt.org/2011/09/01/heres-one-of-the-reasons-why-monads-are-awesome/comment-page-1/#comment-76442</link>
		<dc:creator>Johannes Lichtenberger</dc:creator>
		<pubDate>Thu, 18 Oct 2012 23:10:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.derekwyatt.org/?p=391#comment-76442</guid>
		<description><![CDATA[I&#039;d probably even use the ?: ternary operator in java for the first case:

final String tmpColor = map.get(&quot;colour&quot;);
final String colour = tmpColor == null ? null : tmpColor;

but I agree that it&#039;s not as elegant and it doesn&#039;t cover the second case. Hell, it&#039;s propably even more horrible (except that you have a final variable, ehm or two ;-)) -- hopefully Java8 will be as elegant, but I doubt it. 

Note to myself: Must (really) learn Scala now. Having read Programming in Scala which is probably almost as great as Effective Java. Effective Scala anyhow? IMHO Scala adheres to (almost?) all of the items from Josh Bloch out of the box.

BTW: I&#039;d like to provide a nice, clean Scala API for an open source project of mine (uses Java7). Maybe that&#039;s the best way to get into Scala... or probably distributing tree-structures with Akka? Hmm ;-) Maybe the best way to ask what is needed for a clean API would be stackoverflow, but currently I think the Java-API might also work out of the box, for instance https://github.com/JohannesLichtenberger/sirix/blob/master/bundles/sirix-core/src/main/java/org/sirix/api/NodeReadTrx.java... but don&#039;t want to advertise or something.

kind regards,
Johannes]]></description>
		<content:encoded><![CDATA[<p>I&#8217;d probably even use the ?: ternary operator in java for the first case:</p>
<p>final String tmpColor = map.get(&#8220;colour&#8221;);<br />
final String colour = tmpColor == null ? null : tmpColor;</p>
<p>but I agree that it&#8217;s not as elegant and it doesn&#8217;t cover the second case. Hell, it&#8217;s propably even more horrible (except that you have a final variable, ehm or two ;-)) &#8212; hopefully Java8 will be as elegant, but I doubt it. </p>
<p>Note to myself: Must (really) learn Scala now. Having read Programming in Scala which is probably almost as great as Effective Java. Effective Scala anyhow? IMHO Scala adheres to (almost?) all of the items from Josh Bloch out of the box.</p>
<p>BTW: I&#8217;d like to provide a nice, clean Scala API for an open source project of mine (uses Java7). Maybe that&#8217;s the best way to get into Scala&#8230; or probably distributing tree-structures with Akka? Hmm ;-) Maybe the best way to ask what is needed for a clean API would be stackoverflow, but currently I think the Java-API might also work out of the box, for instance <a href="https://github.com/JohannesLichtenberger/sirix/blob/master/bundles/sirix-core/src/main/java/org/sirix/api/NodeReadTrx.java" rel="nofollow">https://github.com/JohannesLichtenberger/sirix/blob/master/bundles/sirix-core/src/main/java/org/sirix/api/NodeReadTrx.java</a>&#8230; but don&#8217;t want to advertise or something.</p>
<p>kind regards,<br />
Johannes</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derek Wyatt</title>
		<link>http://www.derekwyatt.org/2011/09/01/heres-one-of-the-reasons-why-monads-are-awesome/comment-page-1/#comment-26536</link>
		<dc:creator>Derek Wyatt</dc:creator>
		<pubDate>Sun, 04 Sep 2011 20:34:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.derekwyatt.org/?p=391#comment-26536</guid>
		<description><![CDATA[Hmmm... not sure how to respond to that.  I learn every day.  I have asked you to explain yourself over and over again, and you&#039;ve failed to do that.  Perhaps you&#039;re not able to teach?

At any rate, I think we&#039;ve gone on long enough and I&#039;m going to close the discussion.  If you really are interested in &quot;teaching&quot; then I suggest you start your own blog, or join some sort of training academy, or something like that.  Trying to convince me doesn&#039;t seem to be working, but I will state emphatically that it&#039;s not because I&#039;m not willing to learn.]]></description>
		<content:encoded><![CDATA[<p>Hmmm&#8230; not sure how to respond to that.  I learn every day.  I have asked you to explain yourself over and over again, and you&#8217;ve failed to do that.  Perhaps you&#8217;re not able to teach?</p>
<p>At any rate, I think we&#8217;ve gone on long enough and I&#8217;m going to close the discussion.  If you really are interested in &#8220;teaching&#8221; then I suggest you start your own blog, or join some sort of training academy, or something like that.  Trying to convince me doesn&#8217;t seem to be working, but I will state emphatically that it&#8217;s not because I&#8217;m not willing to learn.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander Bokov</title>
		<link>http://www.derekwyatt.org/2011/09/01/heres-one-of-the-reasons-why-monads-are-awesome/comment-page-1/#comment-26533</link>
		<dc:creator>Alexander Bokov</dc:creator>
		<pubDate>Sun, 04 Sep 2011 19:10:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.derekwyatt.org/?p=391#comment-26533</guid>
		<description><![CDATA[You are unwilling to learn and that is your problem. My problem is however that somebody would learn something wrong from your example. It should not happen.]]></description>
		<content:encoded><![CDATA[<p>You are unwilling to learn and that is your problem. My problem is however that somebody would learn something wrong from your example. It should not happen.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derek Wyatt</title>
		<link>http://www.derekwyatt.org/2011/09/01/heres-one-of-the-reasons-why-monads-are-awesome/comment-page-1/#comment-26531</link>
		<dc:creator>Derek Wyatt</dc:creator>
		<pubDate>Sun, 04 Sep 2011 18:47:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.derekwyatt.org/?p=391#comment-26531</guid>
		<description><![CDATA[I think you&#039;re missing the point... the point is /ease/.  Yup, we could do that but then None would have the element get quietly skipped, which is not what we&#039;re going for.  We want the exception.

Yes, we could also change all of the constructs to return Either[Throwable, T] and while that might be more &quot;pure&quot; (or however you want to word whatever it is you&#039;re going for) and then collect the Left sides to look for problems, it&#039;s a /major/ pain in the ass an not at all pragmatic.

Now... I really think I&#039;m done here.  The best guess I have is that you&#039;re trying to split hairs, and I&#039;m not interested in that.  I&#039;m interested in using the facilities of Scala to produce correct and pragmatic code, which I believe I&#039;ve done, and I&#039;ve done it using Monads (yes, occasionally it may throw an exception instead of returning Some(String), but that&#039;s splitting hairs).]]></description>
		<content:encoded><![CDATA[<p>I think you&#8217;re missing the point&#8230; the point is /ease/.  Yup, we could do that but then None would have the element get quietly skipped, which is not what we&#8217;re going for.  We want the exception.</p>
<p>Yes, we could also change all of the constructs to return Either[Throwable, T] and while that might be more &#8220;pure&#8221; (or however you want to word whatever it is you&#8217;re going for) and then collect the Left sides to look for problems, it&#8217;s a /major/ pain in the ass an not at all pragmatic.</p>
<p>Now&#8230; I really think I&#8217;m done here.  The best guess I have is that you&#8217;re trying to split hairs, and I&#8217;m not interested in that.  I&#8217;m interested in using the facilities of Scala to produce correct and pragmatic code, which I believe I&#8217;ve done, and I&#8217;ve done it using Monads (yes, occasionally it may throw an exception instead of returning Some(String), but that&#8217;s splitting hairs).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander Bokov</title>
		<link>http://www.derekwyatt.org/2011/09/01/heres-one-of-the-reasons-why-monads-are-awesome/comment-page-1/#comment-26530</link>
		<dc:creator>Alexander Bokov</dc:creator>
		<pubDate>Sun, 04 Sep 2011 18:31:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.derekwyatt.org/?p=391#comment-26530</guid>
		<description><![CDATA[class ClassCaster[T] {
def unapply(a: Any): Option[T] = 
  if(a.isInstanceOf[T]) // yeah here you are, what says the compiler?
  Some(a.asInstanceOf[T])
  else None
}]]></description>
		<content:encoded><![CDATA[<p>class ClassCaster[T] {<br />
def unapply(a: Any): Option[T] =<br />
  if(a.isInstanceOf[T]) // yeah here you are, what says the compiler?<br />
  Some(a.asInstanceOf[T])<br />
  else None<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
