<?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: The Magic Dot</title>
	<atom:link href="http://blog.willdonnelly.net/2009/08/24/the-magic-dot/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.willdonnelly.net/2009/08/24/the-magic-dot/</link>
	<description>Coding, Mostly</description>
	<lastBuildDate>Sun, 29 Aug 2010 20:08:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Nick Zivkovic</title>
		<link>http://blog.willdonnelly.net/2009/08/24/the-magic-dot/comment-page-1/#comment-64</link>
		<dc:creator>Nick Zivkovic</dc:creator>
		<pubDate>Thu, 03 Sep 2009 21:45:26 +0000</pubDate>
		<guid isPermaLink="false">http://willdonnelly.wordpress.com/?p=279#comment-64</guid>
		<description>Ah. Ok. It sounded like you were wrongly convinced that the two were identical (which they are not. `fmap` merely has a &#039;function&#039; instance, as you said earlier), and I was just trying clear up the misconception I perceived, wrongly. Also, a nice thing about `fmap` in applicative is that it has instances for monads where
&lt;code&gt;
f `fmap` xs == xs &gt;&gt;= return.f
&lt;/code&gt;

If you haven&#039;t already, check out the Control.Applicative library. It is truly a thing of beauty.</description>
		<content:encoded><![CDATA[<p>Ah. Ok. It sounded like you were wrongly convinced that the two were identical (which they are not. `fmap` merely has a &#8216;function&#8217; instance, as you said earlier), and I was just trying clear up the misconception I perceived, wrongly. Also, a nice thing about `fmap` in applicative is that it has instances for monads where</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">f `fmap` xs == xs &amp;gt;&amp;gt;= return.f</div></div>
<p>If you haven&#8217;t already, check out the Control.Applicative library. It is truly a thing of beauty.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Will Donnelly</title>
		<link>http://blog.willdonnelly.net/2009/08/24/the-magic-dot/comment-page-1/#comment-63</link>
		<dc:creator>Will Donnelly</dc:creator>
		<pubDate>Wed, 02 Sep 2009 17:28:46 +0000</pubDate>
		<guid isPermaLink="false">http://willdonnelly.wordpress.com/?p=279#comment-63</guid>
		<description>I think I understand what you are saying. I worded the post badly. What I meant to convey was that &quot;in the case of functions, fmap is equivalent to the composition operation&quot;. I suppose I should fix the wording in the original post.

My point was that since it is perfectly valid to have &lt;code&gt;instance Functor ((-&gt;) r) where fmap = (.)&lt;/code&gt; in the &lt;a href=&quot;http://haskell.org/ghc/docs/latest/html/libraries/base/src/Control-Monad-Instances.html&quot; rel=&quot;nofollow&quot;&gt;Control.Monad.Instances&lt;/a&gt; module, regular function composition can be viewed as simply being &lt;code&gt;fmap&lt;/code&gt; as it applies to functions. And once that conceptual jump was made, I thought it would be interesting to see what happens if &lt;code&gt;(.)&lt;/code&gt; is redefined to always mean &lt;code&gt;fmap&lt;/code&gt;.</description>
		<content:encoded><![CDATA[<p>I think I understand what you are saying. I worded the post badly. What I meant to convey was that &#8220;in the case of functions, fmap is equivalent to the composition operation&#8221;. I suppose I should fix the wording in the original post.</p>
<p>My point was that since it is perfectly valid to have</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">instance Functor ((-&amp;gt;) r) where fmap = (.)</div></div>
<p>in the <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/src/Control-Monad-Instances.html" rel="nofollow">Control.Monad.Instances</a> module, regular function composition can be viewed as simply being</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">fmap</div></div>
<p>as it applies to functions. And once that conceptual jump was made, I thought it would be interesting to see what happens if</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">(.)</div></div>
<p>is redefined to always mean</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">fmap</div></div>
<p>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nick</title>
		<link>http://blog.willdonnelly.net/2009/08/24/the-magic-dot/comment-page-1/#comment-62</link>
		<dc:creator>nick</dc:creator>
		<pubDate>Wed, 02 Sep 2009 14:53:04 +0000</pubDate>
		<guid isPermaLink="false">http://willdonnelly.wordpress.com/?p=279#comment-62</guid>
		<description>because I suck at html, here is the link to the operator that gets eaten:
http://hackage.haskell.org/packages/archive/base/latest/doc/html/Control-Applicative.html#v:%3C$%3E</description>
		<content:encoded><![CDATA[<p>because I suck at html, here is the link to the operator that gets eaten:<br />
<a href="http://hackage.haskell.org/packages/archive/base/latest/doc/html/Control-Applicative.html#v:%3C$%3E" rel="nofollow">http://hackage.haskell.org/packages/archive/base/latest/doc/html/Control-Applicative.html#v:%3C$%3E</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nick</title>
		<link>http://blog.willdonnelly.net/2009/08/24/the-magic-dot/comment-page-1/#comment-61</link>
		<dc:creator>nick</dc:creator>
		<pubDate>Wed, 02 Sep 2009 14:52:20 +0000</pubDate>
		<guid isPermaLink="false">http://willdonnelly.wordpress.com/?p=279#comment-61</guid>
		<description>html hates my code ...
&lt;pre&gt;
() :: Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b

instead of () :: Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>html hates my code &#8230;</p>
<pre>
() :: Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b

instead of () :: Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: nick</title>
		<link>http://blog.willdonnelly.net/2009/08/24/the-magic-dot/comment-page-1/#comment-60</link>
		<dc:creator>nick</dc:creator>
		<pubDate>Wed, 02 Sep 2009 14:50:56 +0000</pubDate>
		<guid isPermaLink="false">http://willdonnelly.wordpress.com/?p=279#comment-60</guid>
		<description>sorry, for the second signature should be:
() :: Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b

instead of () :: Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b</description>
		<content:encoded><![CDATA[<p>sorry, for the second signature should be:<br />
() :: Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b</p>
<p>instead of () :: Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nick</title>
		<link>http://blog.willdonnelly.net/2009/08/24/the-magic-dot/comment-page-1/#comment-59</link>
		<dc:creator>nick</dc:creator>
		<pubDate>Wed, 02 Sep 2009 14:50:16 +0000</pubDate>
		<guid isPermaLink="false">http://willdonnelly.wordpress.com/?p=279#comment-59</guid>
		<description>Actually, not quite. The dot operator acts over two functions, and the second function&#039;s argument.
It&#039;s definition is
(.) :: (b-&gt;c) -&gt; (a-&gt;b) -&gt; a -&gt; c
a . b x = a (b x)
Notice, how &#039;.&#039; takes two /functions/ and the second function&#039;s argument as arguments. It can&#039;t take a function and a value. So something like a.b.x is not equal to the above. It is invalid, unless x is a function in point-free form.
fmap is often abbreviated as  infix operator.
It doesn&#039;t take two functions. It takes one function and one functor (i.e. a list). It then lifts the function into the functor class and applies it over the functor. Here is the signature:
() :: Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b

As you can see  is a little more general than &#039;.&#039; and acts only on instances of the functor typeclass. I would show you the fill definition, but I think you should head over to hoogle or hayoo, and look up the  operator, and the Control.Applicative module for a better understanding of this. If anything,  is more closely related to the $ operator than the . operator.

Hope this is helpful, on your haskell journey.</description>
		<content:encoded><![CDATA[<p>Actually, not quite. The dot operator acts over two functions, and the second function&#8217;s argument.<br />
It&#8217;s definition is<br />
(.) :: (b-&gt;c) -&gt; (a-&gt;b) -&gt; a -&gt; c<br />
a . b x = a (b x)<br />
Notice, how &#8216;.&#8217; takes two /functions/ and the second function&#8217;s argument as arguments. It can&#8217;t take a function and a value. So something like a.b.x is not equal to the above. It is invalid, unless x is a function in point-free form.<br />
fmap is often abbreviated as  infix operator.<br />
It doesn&#8217;t take two functions. It takes one function and one functor (i.e. a list). It then lifts the function into the functor class and applies it over the functor. Here is the signature:<br />
() :: Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b</p>
<p>As you can see  is a little more general than &#8216;.&#8217; and acts only on instances of the functor typeclass. I would show you the fill definition, but I think you should head over to hoogle or hayoo, and look up the  operator, and the Control.Applicative module for a better understanding of this. If anything,  is more closely related to the $ operator than the . operator.</p>
<p>Hope this is helpful, on your haskell journey.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
