<?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 Lane&#039;s Blog</title>
	<atom:link href="http://blog.downstairspeople.org/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.downstairspeople.org</link>
	<description>A blog of fleshlings and robots.</description>
	<lastBuildDate>Wed, 25 Jan 2012 12:18:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>Comment on The One Function per Typeclass Rule by Edward Z. Yang</title>
		<link>http://blog.downstairspeople.org/2011/03/16/type-coercion-in-haskell/#comment-129</link>
		<dc:creator><![CDATA[Edward Z. Yang]]></dc:creator>
		<pubDate>Wed, 25 Jan 2012 12:18:41 +0000</pubDate>
		<guid isPermaLink="false">http://clanehin.wordpress.com/?p=293#comment-129</guid>
		<description><![CDATA[Another thing you have to be quite careful about is the coherency of the laws of a type class. For example, I&#039;ve recently been arguing that it doesn&#039;t make too much sense to split up an asynchronous exception type class into three components, because the semantics of exceptions don&#039;t really make sense unless you have all the components.

With constraint kinds, one-function-per-class should become more pleasant to work with, however.]]></description>
		<content:encoded><![CDATA[<p>Another thing you have to be quite careful about is the coherency of the laws of a type class. For example, I&#8217;ve recently been arguing that it doesn&#8217;t make too much sense to split up an asynchronous exception type class into three components, because the semantics of exceptions don&#8217;t really make sense unless you have all the components.</p>
<p>With constraint kinds, one-function-per-class should become more pleasant to work with, however.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A Brutal Introduction to Arrows by Per Persson</title>
		<link>http://blog.downstairspeople.org/2010/06/14/a-brutal-introduction-to-arrows/#comment-106</link>
		<dc:creator><![CDATA[Per Persson]]></dc:creator>
		<pubDate>Sun, 11 Sep 2011 08:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.downstairspeople.org/?p=141#comment-106</guid>
		<description><![CDATA[My reaction to this example was: So what, this could certainly be done with monads. When I tried to do it, however, I met problems with implementing &gt;&gt;= for the wrapped IO monad. So I suppose that it can&#039;t be done with monads.]]></description>
		<content:encoded><![CDATA[<p>My reaction to this example was: So what, this could certainly be done with monads. When I tried to do it, however, I met problems with implementing &gt;&gt;= for the wrapped IO monad. So I suppose that it can&#8217;t be done with monads.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The One Function per Typeclass Rule by Dan Doel</title>
		<link>http://blog.downstairspeople.org/2011/03/16/type-coercion-in-haskell/#comment-84</link>
		<dc:creator><![CDATA[Dan Doel]]></dc:creator>
		<pubDate>Wed, 16 Mar 2011 18:52:14 +0000</pubDate>
		<guid isPermaLink="false">http://clanehin.wordpress.com/?p=293#comment-84</guid>
		<description><![CDATA[There&#039;s at least one big exception to this being a good rule: classes with somehow mutually definable methods. For instance, Ord
&lt;code&gt;
class Ord a where
    compare :: a -&gt; a -&gt; Ordering
    ( a -&gt; Bool
   ...
&lt;/code&gt;
It actually has a lot of methods, and sensibly so, because any one of several works as the default (although, the defaulting facilities could be buffed as well: let me specify all possible defaults, with implementations in terms of each, instead of working out an implicit graph with one or two possible nodes like now).

Another I want is:
&lt;code&gt;
class ... =&gt; Monad m where
    (&gt;&gt;=) :: m a -&gt; (a -&gt; m b) -&gt; m b
    join :: m (m a) -&gt; m a
&lt;/code&gt;
I should be able to pick which I want to define. Or both if I want. And allowing me to override some more specific combinators isn&#039;t a bad idea either, like the new Functor:
&lt;code&gt;
class Functor f where
    fmap :: (a -&gt; b) -&gt; f a -&gt; f b
    ( f b -&gt; f a
&lt;/code&gt;
Applicative and Monad are likely to have similar possible, &quot;this could be significantly more efficient for some implementations,&quot; methods. People seem averse to this sort of thing (and often suggest RULEs instead, which are unportable), but I don&#039;t really see the problem with indulging a bit (you can obviously go overboard).

As an additional aside: I&#039;m not sure we can blame the &#039;various kinds of failure&#039; mess on multiple methods specifically. It&#039;s a combination of factors.

1. fail exists for dubious reasons that don&#039;t have to do with a separate class. Failure was specifically intended to be possible for every Monad in H98.
2. Alternative exists separately from MonadPlus because the latter predates Applicative, but there&#039;s no reason to require all MonadPlusses to be a Monad. So it&#039;s a hierarchical (and legacy code) issue.
3. Monoid exists apart from the others (at least) because you cannot write a constraint like (forall a. Monoid (m a)). So it&#039;s a type system issue.

Anyhow, I don&#039;t see anything wrong with one-function-per-class as a basic guideline, but I wouldn&#039;t want it to be enforced by the language for instance (like it used to be in Clean).]]></description>
		<content:encoded><![CDATA[<p>There&#8217;s at least one big exception to this being a good rule: classes with somehow mutually definable methods. For instance, Ord<br />
<code><br />
class Ord a where<br />
    compare :: a -&gt; a -&gt; Ordering<br />
    ( a -&gt; Bool<br />
   ...<br />
</code><br />
It actually has a lot of methods, and sensibly so, because any one of several works as the default (although, the defaulting facilities could be buffed as well: let me specify all possible defaults, with implementations in terms of each, instead of working out an implicit graph with one or two possible nodes like now).</p>
<p>Another I want is:<br />
<code><br />
class ... =&gt; Monad m where<br />
    (&gt;&gt;=) :: m a -&gt; (a -&gt; m b) -&gt; m b<br />
    join :: m (m a) -&gt; m a<br />
</code><br />
I should be able to pick which I want to define. Or both if I want. And allowing me to override some more specific combinators isn&#8217;t a bad idea either, like the new Functor:<br />
<code><br />
class Functor f where<br />
    fmap :: (a -&gt; b) -&gt; f a -&gt; f b<br />
    ( f b -&gt; f a<br />
</code><br />
Applicative and Monad are likely to have similar possible, &#8220;this could be significantly more efficient for some implementations,&#8221; methods. People seem averse to this sort of thing (and often suggest RULEs instead, which are unportable), but I don&#8217;t really see the problem with indulging a bit (you can obviously go overboard).</p>
<p>As an additional aside: I&#8217;m not sure we can blame the &#8216;various kinds of failure&#8217; mess on multiple methods specifically. It&#8217;s a combination of factors.</p>
<p>1. fail exists for dubious reasons that don&#8217;t have to do with a separate class. Failure was specifically intended to be possible for every Monad in H98.<br />
2. Alternative exists separately from MonadPlus because the latter predates Applicative, but there&#8217;s no reason to require all MonadPlusses to be a Monad. So it&#8217;s a hierarchical (and legacy code) issue.<br />
3. Monoid exists apart from the others (at least) because you cannot write a constraint like (forall a. Monoid (m a)). So it&#8217;s a type system issue.</p>
<p>Anyhow, I don&#8217;t see anything wrong with one-function-per-class as a basic guideline, but I wouldn&#8217;t want it to be enforced by the language for instance (like it used to be in Clean).</p>
]]></content:encoded>
	</item>
</channel>
</rss>

