<?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: Scala Goodness: Compound Types</title>
	<atom:link href="http://codemonkeyism.com/compound-types-scala-goodness/feed/" rel="self" type="application/rss+xml" />
	<link>http://codemonkeyism.com/compound-types-scala-goodness/</link>
	<description></description>
	<lastBuildDate>Tue, 03 Jan 2012 15:08:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Pooria</title>
		<link>http://codemonkeyism.com/compound-types-scala-goodness/comment-page-1/#comment-261558</link>
		<dc:creator>Pooria</dc:creator>
		<pubDate>Fri, 01 Jan 2010 22:55:56 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1378#comment-261558</guid>
		<description>&quot;Think of Traits like interfaces in Java with implementation code.&quot;


That makes me think of abstract classes in C++ with implementation code!</description>
		<content:encoded><![CDATA[<p>&#8220;Think of Traits like interfaces in Java with implementation code.&#8221;</p>
<p>That makes me think of abstract classes in C++ with implementation code!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://codemonkeyism.com/compound-types-scala-goodness/comment-page-1/#comment-261269</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Thu, 31 Dec 2009 07:31:51 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1378#comment-261269</guid>
		<description>@Dimitirs: &quot;... continuous marketing can result in more mindshare, so, thanks :)&quot;

Thought the same about continuous marketing.</description>
		<content:encoded><![CDATA[<p>@Dimitirs: &#8220;&#8230; continuous marketing can result in more mindshare, so, thanks :)&#8221;</p>
<p>Thought the same about continuous marketing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yardena</title>
		<link>http://codemonkeyism.com/compound-types-scala-goodness/comment-page-1/#comment-261266</link>
		<dc:creator>Yardena</dc:creator>
		<pubDate>Thu, 31 Dec 2009 06:56:41 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1378#comment-261266</guid>
		<description>@Dimitris you don&#039;t necessarily need a value of a type to make it useful. Nothing is a very useful type :-) Seriously though - sometimes you just need to express a certain constraint for the compiler to check. Take a look at HTMap - you put 5 and &quot;hello&quot; into it, get an HTMap[Int with String] and then obtain 5 from it with get[Int] and &quot;hello&quot; with get[String].</description>
		<content:encoded><![CDATA[<p>@Dimitris you don&#8217;t necessarily need a value of a type to make it useful. Nothing is a very useful type :-) Seriously though &#8211; sometimes you just need to express a certain constraint for the compiler to check. Take a look at HTMap &#8211; you put 5 and &#8220;hello&#8221; into it, get an HTMap[Int with String] and then obtain 5 from it with get[Int] and &#8220;hello&#8221; with get[String].</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dimitris Andreou</title>
		<link>http://codemonkeyism.com/compound-types-scala-goodness/comment-page-1/#comment-261236</link>
		<dc:creator>Dimitris Andreou</dc:creator>
		<pubDate>Thu, 31 Dec 2009 03:19:03 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1378#comment-261236</guid>
		<description>@Yardena, &quot;String with Integer&quot; is a type with no values, pretty much useless, which makes it a poor example :)

@Dirk, the types define allowable collaborations. So what do you feel is missing? 

@stephan, I wanted to see a &quot;Scala Goodness&quot; blog for some weeks now - since I was seeing &quot;Groovy Goodness&quot; floating around, and continuous marketing can result in more mindshare, so, thanks :)</description>
		<content:encoded><![CDATA[<p>@Yardena, &#8220;String with Integer&#8221; is a type with no values, pretty much useless, which makes it a poor example :)</p>
<p>@Dirk, the types define allowable collaborations. So what do you feel is missing? </p>
<p>@stephan, I wanted to see a &#8220;Scala Goodness&#8221; blog for some weeks now &#8211; since I was seeing &#8220;Groovy Goodness&#8221; floating around, and continuous marketing can result in more mindshare, so, thanks :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Viktor Klang</title>
		<link>http://codemonkeyism.com/compound-types-scala-goodness/comment-page-1/#comment-261210</link>
		<dc:creator>Viktor Klang</dc:creator>
		<pubDate>Thu, 31 Dec 2009 00:23:03 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1378#comment-261210</guid>
		<description>Dirk: You can, with self-type declarations</description>
		<content:encoded><![CDATA[<p>Dirk: You can, with self-type declarations</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Random Links #102 &#124; YASDW - yet another software developer weblog</title>
		<link>http://codemonkeyism.com/compound-types-scala-goodness/comment-page-1/#comment-261191</link>
		<dc:creator>Random Links #102 &#124; YASDW - yet another software developer weblog</dc:creator>
		<pubDate>Wed, 30 Dec 2009 22:20:37 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1378#comment-261191</guid>
		<description>[...] Scala Goodness: Compound Types Ja, Scala ist auf jeden Fall einen genauen Blick wert &#8230; [...]</description>
		<content:encoded><![CDATA[<p>[...] Scala Goodness: Compound Types Ja, Scala ist auf jeden Fall einen genauen Blick wert &#8230; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dirk Riehle</title>
		<link>http://codemonkeyism.com/compound-types-scala-goodness/comment-page-1/#comment-261159</link>
		<dc:creator>Dirk Riehle</dc:creator>
		<pubDate>Wed, 30 Dec 2009 18:35:14 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1378#comment-261159</guid>
		<description>I only wished Scala didn&#039;t only support roles/traits but also first-class collaborations. The action is in the interaction of the roles, not in the class interface combining the roles.</description>
		<content:encoded><![CDATA[<p>I only wished Scala didn&#8217;t only support roles/traits but also first-class collaborations. The action is in the interaction of the roles, not in the class interface combining the roles.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yardena</title>
		<link>http://codemonkeyism.com/compound-types-scala-goodness/comment-page-1/#comment-261145</link>
		<dc:creator>Yardena</dc:creator>
		<pubDate>Wed, 30 Dec 2009 16:53:29 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1378#comment-261145</guid>
		<description>@Stephan - great post on indeed very useful Scala feature. 
@Daniel - you are right, but in Java the support for compound types is very limited. Compound types can only be used in generic methods, they can only compose of interface types (and java.lang.Object for erasure tricks), and they don&#039;t support type parameters. While Java&#039;s conservative approach is understandable, in Scala, you can really go wild and define types like &quot;String with Integer&quot; or &quot;T with S&quot; and even do something useful with it, like the HTMap (http://github.com/dlwh/scalanlp-core/blob/master/src/main/scala/scalanlp/collection/immutable/HTMap.scala)</description>
		<content:encoded><![CDATA[<p>@Stephan &#8211; great post on indeed very useful Scala feature.<br />
@Daniel &#8211; you are right, but in Java the support for compound types is very limited. Compound types can only be used in generic methods, they can only compose of interface types (and java.lang.Object for erasure tricks), and they don&#8217;t support type parameters. While Java&#8217;s conservative approach is understandable, in Scala, you can really go wild and define types like &#8220;String with Integer&#8221; or &#8220;T with S&#8221; and even do something useful with it, like the HTMap (<a href="http://github.com/dlwh/scalanlp-core/blob/master/src/main/scala/scalanlp/collection/immutable/HTMap.scala" rel="nofollow">http://github.com/dlwh/scalanlp-core/blob/master/src/main/scala/scalanlp/collection/immutable/HTMap.scala</a>)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://codemonkeyism.com/compound-types-scala-goodness/comment-page-1/#comment-261136</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Wed, 30 Dec 2009 16:19:10 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1378#comment-261136</guid>
		<description>@Daniel: Excellent, thx, helps me with current code!</description>
		<content:encoded><![CDATA[<p>@Daniel: Excellent, thx, helps me with current code!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Spiewak</title>
		<link>http://codemonkeyism.com/compound-types-scala-goodness/comment-page-1/#comment-261124</link>
		<dc:creator>Daniel Spiewak</dc:creator>
		<pubDate>Wed, 30 Dec 2009 15:46:55 +0000</pubDate>
		<guid isPermaLink="false">http://codemonkeyism.com/?p=1378#comment-261124</guid>
		<description>Strictly speaking, Java supports &quot;compound types&quot; as well, at least in the example you gave of the method parameter requiring two interfaces:

public &lt;T extends Callable &amp; Feedable&gt; void callAndFeed(T cf) {
    cf.call();
    cf.feed();
}</description>
		<content:encoded><![CDATA[<p>Strictly speaking, Java supports &#8220;compound types&#8221; as well, at least in the example you gave of the method parameter requiring two interfaces:</p>
<p>public &lt;T extends Callable &amp; Feedable&gt; void callAndFeed(T cf) {<br />
    cf.call();<br />
    cf.feed();<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk (user agent is rejected)
Database Caching using disk

Served from: codemonkeyism.com @ 2012-02-10 06:35:46 -->
