<?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"
	>
<channel>
	<title>Comments on: Strong Type Systems</title>
	<atom:link href="http://blog.tmorris.net/strong-type-systems/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tmorris.net/strong-type-systems/</link>
	<description>The weblog of Tony Morris</description>
	<pubDate>Wed, 19 Nov 2008 23:56:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: &#38;nbsp; Idempotence versus Referential Transparency&#38;nbsp;by&#38;nbsp;λ Tony&#38;#8217;s blog λ</title>
		<link>http://blog.tmorris.net/strong-type-systems/#comment-596</link>
		<dc:creator>&#38;nbsp; Idempotence versus Referential Transparency&#38;nbsp;by&#38;nbsp;λ Tony&#38;#8217;s blog λ</dc:creator>
		<pubDate>Thu, 05 Jul 2007 03:27:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/strong-type-systems/#comment-596</guid>
		<description>[...] I will assume that my reader is roughly familiar with the concept of referential transparency, but not necessarily its implications (since there are many), even though some clearly demonstrate a lack of understanding of this concept, strangely accusing others of same (go figure?) and even trying to proclaim that Java has higher-ranked types while suggesting that others do not understand Java&#38;#8217;s (mediocre) type system. Ignorance is bliss and all that, anyway on with the story&#38;#8230; [...]</description>
		<content:encoded><![CDATA[<p>[...] I will assume that my reader is roughly familiar with the concept of referential transparency, but not necessarily its implications (since there are many), even though some clearly demonstrate a lack of understanding of this concept, strangely accusing others of same (go figure?) and even trying to proclaim that Java has higher-ranked types while suggesting that others do not understand Java&#38;#8217;s (mediocre) type system. Ignorance is bliss and all that, anyway on with the story&#38;#8230; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan2</title>
		<link>http://blog.tmorris.net/strong-type-systems/#comment-595</link>
		<dc:creator>Jonathan2</dc:creator>
		<pubDate>Wed, 21 Mar 2007 15:38:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/strong-type-systems/#comment-595</guid>
		<description>Clearly I arrive late. Apologies.

May I re-ask &lt;a href="http://blog.tmorris.net/strong-type-systems/#comment-1424" rel="nofollow"&gt;Jonathan's question&lt;/a&gt;?

My understanding, from having read OOSC (instead of TAPL, which I hope to rectify but have not yet), is that method arguments can only be contravariant to the type hierarchy. I think you claim that Java's type system is weak (in this instance) because it does not allow contravariant method arguments. How do functional types deal with this - it seems from my understanding - contradiction?</description>
		<content:encoded><![CDATA[<p>Clearly I arrive late. Apologies.</p>
<p>May I re-ask <a href="http://blog.tmorris.net/strong-type-systems/#comment-1424"  rel="nofollow">Jonathan&#8217;s question</a>?</p>
<p>My understanding, from having read OOSC (instead of TAPL, which I hope to rectify but have not yet), is that method arguments can only be contravariant to the type hierarchy. I think you claim that Java&#8217;s type system is weak (in this instance) because it does not allow contravariant method arguments. How do functional types deal with this - it seems from my understanding - contradiction?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Deleted</title>
		<link>http://blog.tmorris.net/strong-type-systems/#comment-594</link>
		<dc:creator>Deleted</dc:creator>
		<pubDate>Fri, 02 Mar 2007 17:24:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/strong-type-systems/#comment-594</guid>
		<description>&lt;em&gt;Deleted pointless comment&lt;/em&gt;</description>
		<content:encoded><![CDATA[<p><em>Deleted pointless comment</em></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony Morris</title>
		<link>http://blog.tmorris.net/strong-type-systems/#comment-593</link>
		<dc:creator>Tony Morris</dc:creator>
		<pubDate>Wed, 14 Feb 2007 04:03:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/strong-type-systems/#comment-593</guid>
		<description>http://kawagner.blogspot.com/2007/02/why-monads-are-evil.html

Yep, it's not (necessarily) me who doesn't understand purity :)</description>
		<content:encoded><![CDATA[<p><a href="http://kawagner.blogspot.com/2007/02/why-monads-are-evil.html" onclick="javascript:pageTracker._trackPageview('/outbound/comment/kawagner.blogspot.com');" rel="nofollow">http://kawagner.blogspot.com/2007/02/why-monads-are-evil.html</a></p>
<p>Yep, it&#8217;s not (necessarily) me who doesn&#8217;t understand purity <img src='http://blog.tmorris.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony Morris</title>
		<link>http://blog.tmorris.net/strong-type-systems/#comment-592</link>
		<dc:creator>Tony Morris</dc:creator>
		<pubDate>Wed, 14 Feb 2007 03:34:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/strong-type-systems/#comment-592</guid>
		<description>Hi Karsten,
Would you mind substantiating your claims? The difference between 'String' and the given example is that String has (effectively) all fields declared final. This means that 'this' as an implicit argument maintains referential transparency. Without this restriction, 'this' becomes a mutating variable. Of course, referential transparency is &lt;b&gt;relative to the observer&lt;/b&gt;, so no doubt a counter-claim might simply take a different point of observation.

In fact, it is possible to demonstrate that the function &lt;code&gt;void touch(String filename)&lt;/code&gt; is referentially transparent, simply by taking a stance that most audiences accept as plausible. The difference is of course, that the so-called 'implicit' arguments are not expressed by the function type, which leads to errors. In fact, I have yet to find a piece of software, be it the touch function or J2EE Jumping Joey's database application, that cannot be written as a lambda expression. Maybe it is not me who does not understand purity? I can't really refute any of your other claims, since they are simply unsupported.

Further, there is no attempt to legitimise the use of a monad type in Java - simply to point out that higher-order types exist to Java users and postulate that they might be important.</description>
		<content:encoded><![CDATA[<p>Hi Karsten,<br />
Would you mind substantiating your claims? The difference between &#8216;String&#8217; and the given example is that String has (effectively) all fields declared final. This means that &#8216;this&#8217; as an implicit argument maintains referential transparency. Without this restriction, &#8216;this&#8217; becomes a mutating variable. Of course, referential transparency is <b>relative to the observer</b>, so no doubt a counter-claim might simply take a different point of observation.</p>
<p>In fact, it is possible to demonstrate that the function <code>void touch(String filename)</code> is referentially transparent, simply by taking a stance that most audiences accept as plausible. The difference is of course, that the so-called &#8216;implicit&#8217; arguments are not expressed by the function type, which leads to errors. In fact, I have yet to find a piece of software, be it the touch function or J2EE Jumping Joey&#8217;s database application, that cannot be written as a lambda expression. Maybe it is not me who does not understand purity? I can&#8217;t really refute any of your other claims, since they are simply unsupported.</p>
<p>Further, there is no attempt to legitimise the use of a monad type in Java - simply to point out that higher-order types exist to Java users and postulate that they might be important.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karsten Wagner</title>
		<link>http://blog.tmorris.net/strong-type-systems/#comment-591</link>
		<dc:creator>Karsten Wagner</dc:creator>
		<pubDate>Sun, 11 Feb 2007 14:34:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/strong-type-systems/#comment-591</guid>
		<description>The problem here is that Tony obviously don't know Java well enough to make the statements he makes. While there really are examples which shows the advantages of Haskell's type-system. Funnily the example Tony presented here was simply based on a blatant lack of understanding of the Java type system.

And the idea that 'using this makes a method impure' is so obviously wrong. Even for Java beginners. Just look at the String-class as an example. 'this' is simply an implicit parameter to a call, it can't break purity more or less than any explicit parameter can. I really have ask myself, if Tony even knows the meaning of 'pure' in this context.</description>
		<content:encoded><![CDATA[<p>The problem here is that Tony obviously don&#8217;t know Java well enough to make the statements he makes. While there really are examples which shows the advantages of Haskell&#8217;s type-system. Funnily the example Tony presented here was simply based on a blatant lack of understanding of the Java type system.</p>
<p>And the idea that &#8216;using this makes a method impure&#8217; is so obviously wrong. Even for Java beginners. Just look at the String-class as an example. &#8216;this&#8217; is simply an implicit parameter to a call, it can&#8217;t break purity more or less than any explicit parameter can. I really have ask myself, if Tony even knows the meaning of &#8216;pure&#8217; in this context.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matías Giovannini</title>
		<link>http://blog.tmorris.net/strong-type-systems/#comment-590</link>
		<dc:creator>Matías Giovannini</dc:creator>
		<pubDate>Fri, 09 Feb 2007 15:01:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/strong-type-systems/#comment-590</guid>
		<description>You just don't know how to use F-bounded polymorphism. The Maybe monad can be written in Java perfectly, without excessive trouble. I grant that the lack of type inference makes things quite ugly, but it is doable (I have the code). In this case, the key insight is that Maybe is not rank-two, but rank-one. A simple encoding of the typeclass as a functor (much as you would do in ML) gives the solution.

Why would you want to use a monad in Java is entirely another mystery. It is analogous to advocating the elimination of the while loop in favor of right folds. You should keep in mind that monads were always and are still a semantic concept (categories belong to the domain of semantics), not a syntactic one. That Haskell implementers found it appropriate to model (_not_ implement) sequencing, side-effecting, etc. doesn't mean that they must be tacked onto any "imperative" problem whatsoever (whatever that is, if it is anything at all).</description>
		<content:encoded><![CDATA[<p>You just don&#8217;t know how to use F-bounded polymorphism. The Maybe monad can be written in Java perfectly, without excessive trouble. I grant that the lack of type inference makes things quite ugly, but it is doable (I have the code). In this case, the key insight is that Maybe is not rank-two, but rank-one. A simple encoding of the typeclass as a functor (much as you would do in ML) gives the solution.</p>
<p>Why would you want to use a monad in Java is entirely another mystery. It is analogous to advocating the elimination of the while loop in favor of right folds. You should keep in mind that monads were always and are still a semantic concept (categories belong to the domain of semantics), not a syntactic one. That Haskell implementers found it appropriate to model (_not_ implement) sequencing, side-effecting, etc. doesn&#8217;t mean that they must be tacked onto any &#8220;imperative&#8221; problem whatsoever (whatever that is, if it is anything at all).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony Morris</title>
		<link>http://blog.tmorris.net/strong-type-systems/#comment-589</link>
		<dc:creator>Tony Morris</dc:creator>
		<pubDate>Thu, 04 Jan 2007 06:31:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/strong-type-systems/#comment-589</guid>
		<description>So this is a side issue - which is 'better'? I will claim that a non-static method is by definition, not 'better' than just about anything (I say 'just about' because I can't think of anything - but do not rule out the possibility). In fact, I will blame it (and its implications) on most (all?) software problems that plague the industry. But again, this is a side issue. I'll go into more detail about it another time.</description>
		<content:encoded><![CDATA[<p>So this is a side issue - which is &#8216;better&#8217;? I will claim that a non-static method is by definition, not &#8216;better&#8217; than just about anything (I say &#8216;just about&#8217; because I can&#8217;t think of anything - but do not rule out the possibility). In fact, I will blame it (and its implications) on most (all?) software problems that plague the industry. But again, this is a side issue. I&#8217;ll go into more detail about it another time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ricky Clarkson</title>
		<link>http://blog.tmorris.net/strong-type-systems/#comment-588</link>
		<dc:creator>Ricky Clarkson</dc:creator>
		<pubDate>Thu, 04 Jan 2007 05:36:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/strong-type-systems/#comment-588</guid>
		<description>Any non-static method involves 'this' in Java.  As your bind method is non-static, it's no better than mine.

Without pattern matching as part of the language, the optimum case is that the object can match patterns for you - this is why my Maybe type looks like:

public interface Maybe&#38;lt;T&#38;gt;
{
	&#38;lt;R&#38;gt; R apply(Lazy&#38;lt;R&#38;gt; ifNothing,Function&#38;lt;T,R&#38;gt; ifJust);
}

(not the same as the one posted earlier; this one is from real code)

Lazy has T invoke() and Function has R invoke(T).

I implement bind as a static method, and only implement it for Maybe, not for any general Monad interface, as I don't have a meaningful abstraction for monads in general.  You can consider apply as emulating pattern matching; it is the minimum and maximum required to enable all use cases of Maybe.</description>
		<content:encoded><![CDATA[<p>Any non-static method involves &#8216;this&#8217; in Java.  As your bind method is non-static, it&#8217;s no better than mine.</p>
<p>Without pattern matching as part of the language, the optimum case is that the object can match patterns for you - this is why my Maybe type looks like:</p>
<p>public interface Maybe&#38;lt;T&#38;gt;<br />
{<br />
	&#38;lt;R&#38;gt; R apply(Lazy&#38;lt;R&#38;gt; ifNothing,Function&#38;lt;T,R&#38;gt; ifJust);<br />
}</p>
<p>(not the same as the one posted earlier; this one is from real code)</p>
<p>Lazy has T invoke() and Function has R invoke(T).</p>
<p>I implement bind as a static method, and only implement it for Maybe, not for any general Monad interface, as I don&#8217;t have a meaningful abstraction for monads in general.  You can consider apply as emulating pattern matching; it is the minimum and maximum required to enable all use cases of Maybe.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony Morris</title>
		<link>http://blog.tmorris.net/strong-type-systems/#comment-587</link>
		<dc:creator>Tony Morris</dc:creator>
		<pubDate>Thu, 04 Jan 2007 03:32:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tmorris.net/strong-type-systems/#comment-587</guid>
		<description>"My function bind is not impure."

So it seems we have identified your mistake. Your function is indeed impure. I truly struggle to find a way of pointing this out, since it is bleedingly obvious. Perhaps a use case if you don't see it immediately upon reflection.

Further, a curried function has nothing to do with state, but I can see how you have become confused. I still maintain that if you were to fix your code, you'd end up with my original function signature.

It is not a secret that referential transparency is a property that is relative to the observer and you have simply shifted your point of observation, into the murky waters of imperative programming. You will then freely admit that there is an additional function argument that is not expressed in your code? It is represented by 'this' in Java.

Passing your entire universe of discourse is guaranteed to provide referential transparency, regardless. Regress from that point and I think you'll see your mistake.</description>
		<content:encoded><![CDATA[<p>&#8220;My function bind is not impure.&#8221;</p>
<p>So it seems we have identified your mistake. Your function is indeed impure. I truly struggle to find a way of pointing this out, since it is bleedingly obvious. Perhaps a use case if you don&#8217;t see it immediately upon reflection.</p>
<p>Further, a curried function has nothing to do with state, but I can see how you have become confused. I still maintain that if you were to fix your code, you&#8217;d end up with my original function signature.</p>
<p>It is not a secret that referential transparency is a property that is relative to the observer and you have simply shifted your point of observation, into the murky waters of imperative programming. You will then freely admit that there is an additional function argument that is not expressed in your code? It is represented by &#8216;this&#8217; in Java.</p>
<p>Passing your entire universe of discourse is guaranteed to provide referential transparency, regardless. Regress from that point and I think you&#8217;ll see your mistake.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
