<?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 on: Preserving or flattening list structure&#8230; an exploration of monad/functor laws</title>
	<atom:link href="http://blog.patch-tag.com/2009/10/06/preserving-or-flattening-list-structure-an-exploration-of-monadfunctor-laws/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.patch-tag.com/2009/10/06/preserving-or-flattening-list-structure-an-exploration-of-monadfunctor-laws/</link>
	<description>give your code a home</description>
	<lastBuildDate>Fri, 13 Jul 2012 17:30:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Gene Arthur</title>
		<link>http://blog.patch-tag.com/2009/10/06/preserving-or-flattening-list-structure-an-exploration-of-monadfunctor-laws/#comment-75</link>
		<dc:creator><![CDATA[Gene Arthur]]></dc:creator>
		<pubDate>Thu, 29 Oct 2009 17:53:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.patch-tag.com/?p=173#comment-75</guid>
		<description><![CDATA[Hi, found the examples to be interesting.. and correct in that you were limiting them to List functors only.  That is just the kind of &quot;play&quot; that works in getting some concepts in your head.  In some of the examples if the &quot;map&quot; is changed to &quot;fmap&quot; they pretty seem to be at first reading to most likely be applicable to the more general case of any functor an not just list.  When I started trying to get my head around applicative functors, lists are what I used for my explorations, and then added in the Maybe Monad/Functor.  Enjoyed your post a lot.. and it contained the first mention of &quot;join&quot; I had seen in a long time, and the use of bind being applied the way you did as just another function,.. was very intuiative.  Would like to see this type of post more often.. thought provocation through example!
cheers,
gene]]></description>
		<content:encoded><![CDATA[<p>Hi, found the examples to be interesting.. and correct in that you were limiting them to List functors only.  That is just the kind of &#8220;play&#8221; that works in getting some concepts in your head.  In some of the examples if the &#8220;map&#8221; is changed to &#8220;fmap&#8221; they pretty seem to be at first reading to most likely be applicable to the more general case of any functor an not just list.  When I started trying to get my head around applicative functors, lists are what I used for my explorations, and then added in the Maybe Monad/Functor.  Enjoyed your post a lot.. and it contained the first mention of &#8220;join&#8221; I had seen in a long time, and the use of bind being applied the way you did as just another function,.. was very intuiative.  Would like to see this type of post more often.. thought provocation through example!<br />
cheers,<br />
gene</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Creighton</title>
		<link>http://blog.patch-tag.com/2009/10/06/preserving-or-flattening-list-structure-an-exploration-of-monadfunctor-laws/#comment-54</link>
		<dc:creator><![CDATA[Creighton]]></dc:creator>
		<pubDate>Wed, 07 Oct 2009 18:02:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.patch-tag.com/?p=173#comment-54</guid>
		<description><![CDATA[So the connection between bind and join isn&#039;t quite explicit here - join is the multiplication of the monad, a monad being a very specific example of a monoid in a category.

bind is actually the composition in the Kleisli category of the monad, where the Kleisli category has all the normal objects as its objects but an arrow &quot;f : a -&gt; b&quot; is really of the form &quot;f : a -&gt; m b&quot; in the base category.]]></description>
		<content:encoded><![CDATA[<p>So the connection between bind and join isn&#8217;t quite explicit here &#8211; join is the multiplication of the monad, a monad being a very specific example of a monoid in a category.</p>
<p>bind is actually the composition in the Kleisli category of the monad, where the Kleisli category has all the normal objects as its objects but an arrow &#8220;f : a -&gt; b&#8221; is really of the form &#8220;f : a -&gt; m b&#8221; in the base category.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wren ng thornton</title>
		<link>http://blog.patch-tag.com/2009/10/06/preserving-or-flattening-list-structure-an-exploration-of-monadfunctor-laws/#comment-53</link>
		<dc:creator><![CDATA[wren ng thornton]]></dc:creator>
		<pubDate>Wed, 07 Oct 2009 02:21:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.patch-tag.com/?p=173#comment-53</guid>
		<description><![CDATA[Just to be clear about it, the join/bind definitions can go in either direction:

    (=&lt;&lt;) f = join . fmap f

    join = (=&lt;&lt;) id

The real thing that&#039;s interesting about it is that given one of these definitions the other one comes for free. That is, we don&#039;t have to make up any functions, we can just use the id we get for free from being in a category and the fmap we get for free from the monad being a functor.

If you start playing around with the interactions between monads and other functors (e.g. doing a monadic foldr), you&#039;ll see why it&#039;s special to get things for free. For example, there&#039;s no way to write a general monadic fold. In order to write it we&#039;d need to have a new law:

    distribute :: (Functor f, Monad m) =&gt; f (m a) -&gt; m (f a)

But we can&#039;t define this law in general (i.e. polymorphic in f and m). We can, however, define restricted versions of it for particular pairs of f and m. For some f we can even define it for any m (see the sequence and sequenceA methods of the Traversable class in Data.Traversable).]]></description>
		<content:encoded><![CDATA[<p>Just to be clear about it, the join/bind definitions can go in either direction:</p>
<p>    (=&lt;&lt;) f = join . fmap f</p>
<p>    join = (=&lt;&lt;) id</p>
<p>The real thing that&#8217;s interesting about it is that given one of these definitions the other one comes for free. That is, we don&#8217;t have to make up any functions, we can just use the id we get for free from being in a category and the fmap we get for free from the monad being a functor.</p>
<p>If you start playing around with the interactions between monads and other functors (e.g. doing a monadic foldr), you&#8217;ll see why it&#8217;s special to get things for free. For example, there&#8217;s no way to write a general monadic fold. In order to write it we&#8217;d need to have a new law:</p>
<p>    distribute :: (Functor f, Monad m) =&gt; f (m a) -&gt; m (f a)</p>
<p>But we can&#8217;t define this law in general (i.e. polymorphic in f and m). We can, however, define restricted versions of it for particular pairs of f and m. For some f we can even define it for any m (see the sequence and sequenceA methods of the Traversable class in Data.Traversable).</p>
]]></content:encoded>
	</item>
</channel>
</rss>
