<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments for A Ham Sandwich</title>
	<atom:link href="http://ahamsandwich.wordpress.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://ahamsandwich.wordpress.com</link>
	<description>Computer Science and Goings-On</description>
	<lastBuildDate>Wed, 15 Jul 2009 07:01:02 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Monads! (and Why Monad Tutorials Are All Awful) by Captain Oblivious</title>
		<link>http://ahamsandwich.wordpress.com/2007/07/26/monads-and-why-monad-tutorials-are-all-awful/#comment-157</link>
		<dc:creator>Captain Oblivious</dc:creator>
		<pubDate>Wed, 15 Jul 2009 07:01:02 +0000</pubDate>
		<guid isPermaLink="false">http://ahamsandwich.wordpress.com/2007/07/26/monads-and-why-monad-tutorials-are-all-awful/#comment-157</guid>
		<description>The simplest way to think about a monad is to realize that every function/program is a &quot;hylomorphism&quot; -- consists of an unfolding of a data structure, piece-wise function application, and then a folding into a new data structure (&quot;rendering&quot;).

This is even true for plain Haskell functions (pattern matching handles the &quot;parsing&quot; step, rendering is either done by the identity (in the trivial case) or &quot;show&quot;).  However, we can use an algebraic/category theoretic concept (&quot;the monad&quot;) to encapsulate the folding and unfolding of a data structure into another.

The monad defines a &quot;bind&quot; operator &gt;&gt;=, which takes a monad element and a function on the monad element&#039;s underlying type back to the monad.  The monad element is unfolded (as defined by &gt;&gt;=), and f is applied to refold it, perhaps in terms of a different kind of data structure.

Of course, a parser is automatically a state machine and lots of other &quot;equivalent&quot; things, and so by changing the emphasis of interpretation, one can construct them all using the same simple Haskell notation.

From a different point of view, a programming language&#039;s &quot;object system&quot; is a specific monad operating on a tree of object-oriented classes to seek methods.  &quot;Generalized object systems&quot; can be built, and the monads are them.</description>
		<content:encoded><![CDATA[<p>The simplest way to think about a monad is to realize that every function/program is a &#8220;hylomorphism&#8221; &#8212; consists of an unfolding of a data structure, piece-wise function application, and then a folding into a new data structure (&#8220;rendering&#8221;).</p>
<p>This is even true for plain Haskell functions (pattern matching handles the &#8220;parsing&#8221; step, rendering is either done by the identity (in the trivial case) or &#8220;show&#8221;).  However, we can use an algebraic/category theoretic concept (&#8220;the monad&#8221;) to encapsulate the folding and unfolding of a data structure into another.</p>
<p>The monad defines a &#8220;bind&#8221; operator &gt;&gt;=, which takes a monad element and a function on the monad element&#8217;s underlying type back to the monad.  The monad element is unfolded (as defined by &gt;&gt;=), and f is applied to refold it, perhaps in terms of a different kind of data structure.</p>
<p>Of course, a parser is automatically a state machine and lots of other &#8220;equivalent&#8221; things, and so by changing the emphasis of interpretation, one can construct them all using the same simple Haskell notation.</p>
<p>From a different point of view, a programming language&#8217;s &#8220;object system&#8221; is a specific monad operating on a tree of object-oriented classes to seek methods.  &#8220;Generalized object systems&#8221; can be built, and the monads are them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Monads! (and Why Monad Tutorials Are All Awful) by Captain Oblivious</title>
		<link>http://ahamsandwich.wordpress.com/2007/07/26/monads-and-why-monad-tutorials-are-all-awful/#comment-156</link>
		<dc:creator>Captain Oblivious</dc:creator>
		<pubDate>Wed, 15 Jul 2009 07:01:02 +0000</pubDate>
		<guid isPermaLink="false">http://ahamsandwich.wordpress.com/2007/07/26/monads-and-why-monad-tutorials-are-all-awful/#comment-156</guid>
		<description>The simplest way to think about a monad is to realize that every function/program is a &quot;hylomorphism&quot; -- consists of an unfolding of a data structure, piece-wise function application, and then a folding into a new data structure (&quot;rendering&quot;).

This is even true for plain Haskell functions (pattern matching handles the &quot;parsing&quot; step, rendering is either done by the identity (in the trivial case) or &quot;show&quot;).  However, we can use an algebraic/category theoretic concept (&quot;the monad&quot;) to encapsulate the folding and unfolding of a data structure into another.

The monad defines a &quot;bind&quot; operator &gt;&gt;=, which takes a monad element and a function on the monad element&#039;s underlying type back to the monad.  The monad element is unfolded (as defined by &gt;&gt;=), and f is applied to refold it, perhaps in terms of a different kind of data structure.

Of course, a parser is automatically a state machine and lots of other &quot;equivalent&quot; things, and so by changing the emphasis of interpretation, one can construct them all using the same simple Haskell notation.

From a different point of view, a programming language&#039;s &quot;object system&quot; is a specific monad operating on a tree of object-oriented classes to seek methods.  &quot;Generalized object systems&quot; can be built, and the monads are them.</description>
		<content:encoded><![CDATA[<p>The simplest way to think about a monad is to realize that every function/program is a &#8220;hylomorphism&#8221; &#8212; consists of an unfolding of a data structure, piece-wise function application, and then a folding into a new data structure (&#8220;rendering&#8221;).</p>
<p>This is even true for plain Haskell functions (pattern matching handles the &#8220;parsing&#8221; step, rendering is either done by the identity (in the trivial case) or &#8220;show&#8221;).  However, we can use an algebraic/category theoretic concept (&#8220;the monad&#8221;) to encapsulate the folding and unfolding of a data structure into another.</p>
<p>The monad defines a &#8220;bind&#8221; operator &gt;&gt;=, which takes a monad element and a function on the monad element&#8217;s underlying type back to the monad.  The monad element is unfolded (as defined by &gt;&gt;=), and f is applied to refold it, perhaps in terms of a different kind of data structure.</p>
<p>Of course, a parser is automatically a state machine and lots of other &#8220;equivalent&#8221; things, and so by changing the emphasis of interpretation, one can construct them all using the same simple Haskell notation.</p>
<p>From a different point of view, a programming language&#8217;s &#8220;object system&#8221; is a specific monad operating on a tree of object-oriented classes to seek methods.  &#8220;Generalized object systems&#8221; can be built, and the monads are them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Giving up on Ruby on Rails for Python and Django by Joshua</title>
		<link>http://ahamsandwich.wordpress.com/2008/02/24/giving-up-on-ruby-on-rails-for-python-and-django/#comment-149</link>
		<dc:creator>Joshua</dc:creator>
		<pubDate>Fri, 24 Apr 2009 07:35:04 +0000</pubDate>
		<guid isPermaLink="false">http://ahamsandwich.wordpress.com/?p=43#comment-149</guid>
		<description>I must agree with you. Django is superb and do alot of dirty work. And most of all, I really appreciate how django developers are really humble and open to be schooled.</description>
		<content:encoded><![CDATA[<p>I must agree with you. Django is superb and do alot of dirty work. And most of all, I really appreciate how django developers are really humble and open to be schooled.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Monads! (and Why Monad Tutorials Are All Awful) by Tahir</title>
		<link>http://ahamsandwich.wordpress.com/2007/07/26/monads-and-why-monad-tutorials-are-all-awful/#comment-132</link>
		<dc:creator>Tahir</dc:creator>
		<pubDate>Sun, 18 Jan 2009 21:11:17 +0000</pubDate>
		<guid isPermaLink="false">http://ahamsandwich.wordpress.com/2007/07/26/monads-and-why-monad-tutorials-are-all-awful/#comment-132</guid>
		<description>@ Eric Kow,

There was a month a long time ago that I spent almost all my free time trying to understand monads, and I read quite a few tutorials and found none of them helpful.  I saw yours but then because it was about space suits I thought it would be a load of bollocks.  

A few months passed and then I tried again, and this time I looked at your tutorial and I managed to understand it in two days.  It is my opinion that your tutorial is perhaps the best on the internet but could be improved because it does require a bit of exposure to monads.  

-Tahir</description>
		<content:encoded><![CDATA[<p>@ Eric Kow,</p>
<p>There was a month a long time ago that I spent almost all my free time trying to understand monads, and I read quite a few tutorials and found none of them helpful.  I saw yours but then because it was about space suits I thought it would be a load of bollocks.  </p>
<p>A few months passed and then I tried again, and this time I looked at your tutorial and I managed to understand it in two days.  It is my opinion that your tutorial is perhaps the best on the internet but could be improved because it does require a bit of exposure to monads.  </p>
<p>-Tahir</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Giving up on Ruby on Rails for Python and Django by Ricardo A. Salgado</title>
		<link>http://ahamsandwich.wordpress.com/2008/02/24/giving-up-on-ruby-on-rails-for-python-and-django/#comment-128</link>
		<dc:creator>Ricardo A. Salgado</dc:creator>
		<pubDate>Wed, 17 Dec 2008 01:59:33 +0000</pubDate>
		<guid isPermaLink="false">http://ahamsandwich.wordpress.com/?p=43#comment-128</guid>
		<description>Another issue i found in rails running on Windows XP is that version 2.x does not generate complete code from tables using the &quot;script generate/scaffold SomeModel&quot;, but prior versions do.</description>
		<content:encoded><![CDATA[<p>Another issue i found in rails running on Windows XP is that version 2.x does not generate complete code from tables using the &#8220;script generate/scaffold SomeModel&#8221;, but prior versions do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Problems with C and C++ Separate Compilation by csgordon</title>
		<link>http://ahamsandwich.wordpress.com/2008/11/11/problems-with-c-and-c-separate-compilation/#comment-127</link>
		<dc:creator>csgordon</dc:creator>
		<pubDate>Fri, 21 Nov 2008 07:56:52 +0000</pubDate>
		<guid isPermaLink="false">http://ahamsandwich.wordpress.com/?p=62#comment-127</guid>
		<description>You&#039;re right, that sort of approach to APIs can certainly handle it, but that&#039;s not the solution you want.  It essentially means that every library or component, every *object file* is responsible for managing its own memory, and for providing a handle-base API for structures whose definitions it owns.  Between libraries, that&#039;s reasonable, though it adds a lot of boilerplate engineering overhead.  For separate object files within the same component, it seems like overkill.

The prefixing workaround to get de facto namespaces (which are basically syntactic sugar for prefixing; look at the symbol names compilers generate) and the automated tools for tracking dependencies by reading source also work.  I&#039;m not trying to say that these things are insurmountable; they absolutely can be managed and mitigated.  But these are problems which don&#039;t need to exist, shouldn&#039;t require workarounds and aren&#039;t present in some other languages.</description>
		<content:encoded><![CDATA[<p>You&#8217;re right, that sort of approach to APIs can certainly handle it, but that&#8217;s not the solution you want.  It essentially means that every library or component, every *object file* is responsible for managing its own memory, and for providing a handle-base API for structures whose definitions it owns.  Between libraries, that&#8217;s reasonable, though it adds a lot of boilerplate engineering overhead.  For separate object files within the same component, it seems like overkill.</p>
<p>The prefixing workaround to get de facto namespaces (which are basically syntactic sugar for prefixing; look at the symbol names compilers generate) and the automated tools for tracking dependencies by reading source also work.  I&#8217;m not trying to say that these things are insurmountable; they absolutely can be managed and mitigated.  But these are problems which don&#8217;t need to exist, shouldn&#8217;t require workarounds and aren&#8217;t present in some other languages.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Problems with C and C++ Separate Compilation by Dave Pacheco</title>
		<link>http://ahamsandwich.wordpress.com/2008/11/11/problems-with-c-and-c-separate-compilation/#comment-126</link>
		<dc:creator>Dave Pacheco</dc:creator>
		<pubDate>Thu, 20 Nov 2008 06:27:40 +0000</pubDate>
		<guid isPermaLink="false">http://ahamsandwich.wordpress.com/?p=62#comment-126</guid>
		<description>N makes a good point: many of these problems can be solved through careful API design. Accessor routines for user-visible data and/or stable structures allocated and freed with API calls make structure incompatibility less of an issue. You can also version API&#039;s in such a way that binary incompatibilities lead to quick init-time failures rather than arbitrary data corruption. OpenSolaris does this all over the place - see fmd_hdl_register, for one:
http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_api.c#fmd_hdl_register

C also has namespaces - in the form of identifier prefixes. :) It&#039;s the same thing, except unenforced and more explicit (the latter of which is a good thing).

Mark, I can&#039;t think of any language that doesn&#039;t allow developers to use relative paths for importing external modules. Such languages necessarily require a &quot;path&quot; of places where those modules might be located. This includes C, Java, Perl, Python, Ruby, .... What&#039;s the alternative?</description>
		<content:encoded><![CDATA[<p>N makes a good point: many of these problems can be solved through careful API design. Accessor routines for user-visible data and/or stable structures allocated and freed with API calls make structure incompatibility less of an issue. You can also version API&#8217;s in such a way that binary incompatibilities lead to quick init-time failures rather than arbitrary data corruption. OpenSolaris does this all over the place &#8211; see fmd_hdl_register, for one:<br />
<a href="http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_api.c#fmd_hdl_register" rel="nofollow">http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_api.c#fmd_hdl_register</a></p>
<p>C also has namespaces &#8211; in the form of identifier prefixes. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  It&#8217;s the same thing, except unenforced and more explicit (the latter of which is a good thing).</p>
<p>Mark, I can&#8217;t think of any language that doesn&#8217;t allow developers to use relative paths for importing external modules. Such languages necessarily require a &#8220;path&#8221; of places where those modules might be located. This includes C, Java, Perl, Python, Ruby, &#8230;. What&#8217;s the alternative?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Problems with C and C++ Separate Compilation by Ben</title>
		<link>http://ahamsandwich.wordpress.com/2008/11/11/problems-with-c-and-c-separate-compilation/#comment-125</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Wed, 19 Nov 2008 07:03:09 +0000</pubDate>
		<guid isPermaLink="false">http://ahamsandwich.wordpress.com/?p=62#comment-125</guid>
		<description>The tool &#039;makeheaders&#039; might alleviate some of your problems,  though I haven&#039;t used it myself: http://www.hwaci.com/sw/mkhdr/</description>
		<content:encoded><![CDATA[<p>The tool &#8216;makeheaders&#8217; might alleviate some of your problems,  though I haven&#8217;t used it myself: <a href="http://www.hwaci.com/sw/mkhdr/" rel="nofollow">http://www.hwaci.com/sw/mkhdr/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Problems with C and C++ Separate Compilation by mark</title>
		<link>http://ahamsandwich.wordpress.com/2008/11/11/problems-with-c-and-c-separate-compilation/#comment-124</link>
		<dc:creator>mark</dc:creator>
		<pubDate>Wed, 19 Nov 2008 06:10:43 +0000</pubDate>
		<guid isPermaLink="false">http://ahamsandwich.wordpress.com/?p=62#comment-124</guid>
		<description>GNU autotools? The ugly and horrible macro language that people try to replace with scons or cmake since quite some time by now?

The problem is the language itself. I think namespaces should be introduced for header files as well. It is silly to require .h files to be put at specific paths rather than have it &quot;register&quot; somewhere (on a traditional system it is &quot;registered&quot; by being put at a specific place on a hdd, but this model is suboptimal imho)</description>
		<content:encoded><![CDATA[<p>GNU autotools? The ugly and horrible macro language that people try to replace with scons or cmake since quite some time by now?</p>
<p>The problem is the language itself. I think namespaces should be introduced for header files as well. It is silly to require .h files to be put at specific paths rather than have it &#8220;register&#8221; somewhere (on a traditional system it is &#8220;registered&#8221; by being put at a specific place on a hdd, but this model is suboptimal imho)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Problems with C and C++ Separate Compilation by N</title>
		<link>http://ahamsandwich.wordpress.com/2008/11/11/problems-with-c-and-c-separate-compilation/#comment-123</link>
		<dc:creator>N</dc:creator>
		<pubDate>Wed, 19 Nov 2008 05:07:37 +0000</pubDate>
		<guid isPermaLink="false">http://ahamsandwich.wordpress.com/?p=62#comment-123</guid>
		<description>This is why well designed C and C++ libraries make use of opaque pointers to data structures. It avoids the problem of having to deal with changing data layouts in your client code. As long as you work with API functions to modify opaque data in your client code, you don&#039;t need to worry about changes to the internal layout and structure of the opaque data.

&gt; It’s possible to work around this problem with a build system if you track every header file dependency explicitly.

Try GNU autotools or SCons.</description>
		<content:encoded><![CDATA[<p>This is why well designed C and C++ libraries make use of opaque pointers to data structures. It avoids the problem of having to deal with changing data layouts in your client code. As long as you work with API functions to modify opaque data in your client code, you don&#8217;t need to worry about changes to the internal layout and structure of the opaque data.</p>
<p>&gt; It’s possible to work around this problem with a build system if you track every header file dependency explicitly.</p>
<p>Try GNU autotools or SCons.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
