<?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: Monads by stealth</title>
	<atom:link href="http://www.nobugs.org/blog/archives/2004/05/02/monads-by-stealth/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nobugs.org/blog/archives/2004/05/02/monads-by-stealth/</link>
	<description>Thoughts of a software engineer</description>
	<lastBuildDate>Sat, 19 Nov 2011 18:48:17 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
	<item>
		<title>By: Pavlos</title>
		<link>http://www.nobugs.org/blog/archives/2004/05/02/monads-by-stealth/comment-page-1/#comment-73</link>
		<dc:creator>Pavlos</dc:creator>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.nobugs.org/blog/archives/2004/05/02/monads-by-stealth/#comment-73</guid>
		<description>I&#039;m not familiar enough with the subject, but I&#039;d like to note that a function is a detriment to clarity that you pay to buy abstraction. In this case, I see the tradeoff as misplaced, but then I&#039;m a dinosaur.

Presumably what you want is not to abstract the program logic but to ensure it is well-formed. I would prefer too see that done with typing of expressions rather than functions, for example by adding an overloaded &quot;maybe&quot; keyword to C++. It&#039;s use is made clear by the following example:


  maybe int m;

  maybe (m) {
        // m is in scope as type int
  } else {
        // m is hidden from scope
  }


I did say I was a dinosaur ;-)</description>
		<content:encoded><![CDATA[<p>I&#8217;m not familiar enough with the subject, but I&#8217;d like to note that a function is a detriment to clarity that you pay to buy abstraction. In this case, I see the tradeoff as misplaced, but then I&#8217;m a dinosaur.</p>
<p>Presumably what you want is not to abstract the program logic but to ensure it is well-formed. I would prefer too see that done with typing of expressions rather than functions, for example by adding an overloaded &#8220;maybe&#8221; keyword to C++. It&#8217;s use is made clear by the following example:</p>
<p>  maybe int m;</p>
<p>  maybe (m) {<br />
        // m is in scope as type int<br />
  } else {<br />
        // m is hidden from scope<br />
  }</p>
<p>I did say I was a dinosaur <img src='http://www.nobugs.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anthony Bailey</title>
		<link>http://www.nobugs.org/blog/archives/2004/05/02/monads-by-stealth/comment-page-1/#comment-74</link>
		<dc:creator>Anthony Bailey</dc:creator>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.nobugs.org/blog/archives/2004/05/02/monads-by-stealth/#comment-74</guid>
		<description>(I note that if you come straight to this page, you can&#039;t easily see that I commented previously via a TrackBack, so...

&quot;I commented previously in my own blog, which you can get to if you hit the TrackBack link at the foot of Andy&#039;s article.&quot;

Now on to this comment...)


I note that you can write code with structure much like Pavlos desires by having Maybe&lt;X&gt; implement an implicit cast to X that throws a MaybeIsInvalid exception when the object is invalid. Then you can write

Maybe&lt;int&gt; m;
try {
// use m as if it has type int
} catch MaybeIsInvalid {
// your alternative action
// (m remains in scope, but I&#039;m not sure why it shouldn&#039;t, Pavlos - you might want e.g. to assign to it.)
}</description>
		<content:encoded><![CDATA[<p>(I note that if you come straight to this page, you can&#8217;t easily see that I commented previously via a TrackBack, so&#8230;</p>
<p>&#8220;I commented previously in my own blog, which you can get to if you hit the TrackBack link at the foot of Andy&#8217;s article.&#8221;</p>
<p>Now on to this comment&#8230;)</p>
<p>I note that you can write code with structure much like Pavlos desires by having Maybe&lt;X&gt; implement an implicit cast to X that throws a MaybeIsInvalid exception when the object is invalid. Then you can write</p>
<p>Maybe&lt;int&gt; m;<br />
try {<br />
// use m as if it has type int<br />
} catch MaybeIsInvalid {<br />
// your alternative action<br />
// (m remains in scope, but I&#8217;m not sure why it shouldn&#8217;t, Pavlos &#8211; you might want e.g. to assign to it.)<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anthony Bailey's blog</title>
		<link>http://www.nobugs.org/blog/archives/2004/05/02/monads-by-stealth/comment-page-1/#comment-75</link>
		<dc:creator>Anthony Bailey's blog</dc:creator>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.nobugs.org/blog/archives/2004/05/02/monads-by-stealth/#comment-75</guid>
		<description>&lt;strong&gt;http://anthonybailey.livejournal.com/15867.html&lt;/strong&gt;
Andrew Birkett tries to sneak a monad passed us over on his software engineering blog. [...] I approve of where he&#039;s coming from with the whole stealth-abstraction thing [...] yet there&#039;s something about the example as presented that I don&#039;t like much....
</description>
		<content:encoded><![CDATA[<p><strong><a href="http://anthonybailey.livejournal.com/15867.html" rel="nofollow">http://anthonybailey.livejournal.com/15867.html</a></strong><br />
Andrew Birkett tries to sneak a monad passed us over on his software engineering blog. [...] I approve of where he&#8217;s coming from with the whole stealth-abstraction thing [...] yet there&#8217;s something about the example as presented that I don&#8217;t like much&#8230;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

