<?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: Some thoughts on teaching FP</title>
	<atom:link href="http://existentialtype.wordpress.com/2011/04/17/some-advice-on-teaching-fp/feed/" rel="self" type="application/rss+xml" />
	<link>http://existentialtype.wordpress.com/2011/04/17/some-advice-on-teaching-fp/</link>
	<description>Abstract types are existential types.</description>
	<lastBuildDate>Tue, 29 Jan 2013 15:10:50 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Abstract Type</title>
		<link>http://existentialtype.wordpress.com/2011/04/17/some-advice-on-teaching-fp/#comment-759</link>
		<dc:creator><![CDATA[Abstract Type]]></dc:creator>
		<pubDate>Mon, 18 Apr 2011 20:56:35 +0000</pubDate>
		<guid isPermaLink="false">http://existentialtype.wordpress.com/?p=185#comment-759</guid>
		<description><![CDATA[You are free to use opaque ascription, which provides the kind of private declarations you seem to want, but for teaching beginners I find it more trouble than it is worth.  We have had zero problems with this, either practically or conceptually; we had a lot of problems using the methods you favor (as did you, apparently).  It just does not scale.]]></description>
		<content:encoded><![CDATA[<p>You are free to use opaque ascription, which provides the kind of private declarations you seem to want, but for teaching beginners I find it more trouble than it is worth.  We have had zero problems with this, either practically or conceptually; we had a lot of problems using the methods you favor (as did you, apparently).  It just does not scale.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dsannella</title>
		<link>http://existentialtype.wordpress.com/2011/04/17/some-advice-on-teaching-fp/#comment-758</link>
		<dc:creator><![CDATA[dsannella]]></dc:creator>
		<pubDate>Mon, 18 Apr 2011 20:10:37 +0000</pubDate>
		<guid isPermaLink="false">http://existentialtype.wordpress.com/?p=185#comment-758</guid>
		<description><![CDATA[&lt;cite&gt;
&quot;In a departure from our previous approach, we have decided against using opaque ascription (sealing) as a means of enforcing abstraction. ... The alternative, which has worked very well for us, is to eschew opaque ascription, and instead rely on the datatype mechanism to make types abstract.&quot;
&lt;/cite&gt;

That works provided you always use datatypes, and always hide their constructors.  So for instance

&lt;blockquote&gt;
datatype age = mkage of int
fun birthday(mkage n) = mkage(n+1)
&lt;/blockquote&gt;

in a structure, with a signature including &lt;code&gt;type age&lt;/code&gt; (not &lt;code&gt;eqtype&lt;/code&gt;) and not including the constructor &lt;code&gt;mkage&lt;/code&gt;. I&#039;m not sure that&#039;s really better than using opaque ascription - it seems just about as elegant as the relationship between Integer and int in Java. And you also eschew the explanation of functors as abstracted - in the sense of lambda abstraction, not data abstraction - versions of structures: the relationship between S and T in

&lt;blockquote&gt;
structure S:&gt;SIG = ...
structure T = ... S ...
&lt;/blockquote&gt;

is like the relationship between S and T in

&lt;blockquote&gt;
functor T(X:SIG) = ... X ...
... T(S) ...
&lt;/blockquote&gt;

See my comment on &quot;Modules Matter Most&quot; - I still think there has to be a better way. And it seems to me that the way you are doing things - which you suggest is a better way in practice - amounts to explicitly &lt;i&gt;hiding&lt;/i&gt; the identity of the types that you want to be abstract, rather than explicitly &lt;i&gt;revealing&lt;/i&gt; the identity of the types (like &lt;code&gt;Key.t&lt;/code&gt; in your &lt;code&gt;IntMapping&lt;/code&gt; example) that you want to expose. Maybe what is missing is just a more elegant language construct to do that? Dare I suggest Java-style &lt;code&gt;private&lt;/code&gt;?]]></description>
		<content:encoded><![CDATA[<p><cite><br />
&#8220;In a departure from our previous approach, we have decided against using opaque ascription (sealing) as a means of enforcing abstraction. &#8230; The alternative, which has worked very well for us, is to eschew opaque ascription, and instead rely on the datatype mechanism to make types abstract.&#8221;<br />
</cite></p>
<p>That works provided you always use datatypes, and always hide their constructors.  So for instance</p>
<blockquote><p>
datatype age = mkage of int<br />
fun birthday(mkage n) = mkage(n+1)
</p></blockquote>
<p>in a structure, with a signature including <code>type age</code> (not <code>eqtype</code>) and not including the constructor <code>mkage</code>. I&#8217;m not sure that&#8217;s really better than using opaque ascription &#8211; it seems just about as elegant as the relationship between Integer and int in Java. And you also eschew the explanation of functors as abstracted &#8211; in the sense of lambda abstraction, not data abstraction &#8211; versions of structures: the relationship between S and T in</p>
<blockquote><p>
structure S:&gt;SIG = &#8230;<br />
structure T = &#8230; S &#8230;
</p></blockquote>
<p>is like the relationship between S and T in</p>
<blockquote><p>
functor T(X:SIG) = &#8230; X &#8230;<br />
&#8230; T(S) &#8230;
</p></blockquote>
<p>See my comment on &#8220;Modules Matter Most&#8221; &#8211; I still think there has to be a better way. And it seems to me that the way you are doing things &#8211; which you suggest is a better way in practice &#8211; amounts to explicitly <i>hiding</i> the identity of the types that you want to be abstract, rather than explicitly <i>revealing</i> the identity of the types (like <code>Key.t</code> in your <code>IntMapping</code> example) that you want to expose. Maybe what is missing is just a more elegant language construct to do that? Dare I suggest Java-style <code>private</code>?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Martens</title>
		<link>http://existentialtype.wordpress.com/2011/04/17/some-advice-on-teaching-fp/#comment-757</link>
		<dc:creator><![CDATA[Chris Martens]]></dc:creator>
		<pubDate>Mon, 18 Apr 2011 19:14:48 +0000</pubDate>
		<guid isPermaLink="false">http://existentialtype.wordpress.com/?p=185#comment-757</guid>
		<description><![CDATA[Yeah, I wanted to comment correcting &quot;gender equity&quot; to &quot;privilege equity&quot;. Also, I did come in to college with a couple years of &quot;bad&quot; programming experience, but I definitely felt more *comfortable* in my FP class where the environment was about learning something together, not competing as to who already knows the most.

What&#039;s confusing is that the FP community still seems to be less privilege-balanced as a field than other subfields of CS, and I personally knew a lot more women in undergrad who preferred C hacking to ML. I wish I knew why.]]></description>
		<content:encoded><![CDATA[<p>Yeah, I wanted to comment correcting &#8220;gender equity&#8221; to &#8220;privilege equity&#8221;. Also, I did come in to college with a couple years of &#8220;bad&#8221; programming experience, but I definitely felt more *comfortable* in my FP class where the environment was about learning something together, not competing as to who already knows the most.</p>
<p>What&#8217;s confusing is that the FP community still seems to be less privilege-balanced as a field than other subfields of CS, and I personally knew a lot more women in undergrad who preferred C hacking to ML. I wish I knew why.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abstract Type</title>
		<link>http://existentialtype.wordpress.com/2011/04/17/some-advice-on-teaching-fp/#comment-756</link>
		<dc:creator><![CDATA[Abstract Type]]></dc:creator>
		<pubDate>Mon, 18 Apr 2011 17:54:47 +0000</pubDate>
		<guid isPermaLink="false">http://existentialtype.wordpress.com/?p=185#comment-756</guid>
		<description><![CDATA[Point taken.]]></description>
		<content:encoded><![CDATA[<p>Point taken.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: csfreshman</title>
		<link>http://existentialtype.wordpress.com/2011/04/17/some-advice-on-teaching-fp/#comment-755</link>
		<dc:creator><![CDATA[csfreshman]]></dc:creator>
		<pubDate>Mon, 18 Apr 2011 17:45:04 +0000</pubDate>
		<guid isPermaLink="false">http://existentialtype.wordpress.com/?p=185#comment-755</guid>
		<description><![CDATA[As a Freshmen in a different college I very much like the style of teaching you are using.

&lt;blockquote&gt;&quot;Related to this, avoid if-then-else entirely, and instead use only case analysis for branching, even when the value to be discriminated is a Boolean.&quot; is something I will be using in my own programs&lt;/blockquote&gt;
I will be using this in my own programs for now on. I think it makes sense and makes it easier to reason about my code than if-then-elses

&lt;blockquote&gt;
Students with prior “programming experience” are, if anything, at a disadvantage, because they think they know things that are either wrong or inapplicable. 
&lt;/blockquote&gt;
You should have said: Students with &lt;b&gt;poor&lt;/b&gt; prior “&lt;b&gt;imperative&lt;/b&gt; programming experience” are, if anything, at a disadvantage, because they think they know things that are either wrong or inapplicable.]]></description>
		<content:encoded><![CDATA[<p>As a Freshmen in a different college I very much like the style of teaching you are using.</p>
<blockquote><p>&#8220;Related to this, avoid if-then-else entirely, and instead use only case analysis for branching, even when the value to be discriminated is a Boolean.&#8221; is something I will be using in my own programs</p></blockquote>
<p>I will be using this in my own programs for now on. I think it makes sense and makes it easier to reason about my code than if-then-elses</p>
<blockquote><p>
Students with prior “programming experience” are, if anything, at a disadvantage, because they think they know things that are either wrong or inapplicable.
</p></blockquote>
<p>You should have said: Students with <b>poor</b> prior “<b>imperative</b> programming experience” are, if anything, at a disadvantage, because they think they know things that are either wrong or inapplicable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abstract Type</title>
		<link>http://existentialtype.wordpress.com/2011/04/17/some-advice-on-teaching-fp/#comment-754</link>
		<dc:creator><![CDATA[Abstract Type]]></dc:creator>
		<pubDate>Mon, 18 Apr 2011 15:13:29 +0000</pubDate>
		<guid isPermaLink="false">http://existentialtype.wordpress.com/?p=185#comment-754</guid>
		<description><![CDATA[By not teaching equational reasoning, but instead focusing on the operational semantics.  So, for example, to prove something about a function of type int-&gt;int, we consider all possible numerals as inputs.  There is no need to consider anything else.]]></description>
		<content:encoded><![CDATA[<p>By not teaching equational reasoning, but instead focusing on the operational semantics.  So, for example, to prove something about a function of type int-&gt;int, we consider all possible numerals as inputs.  There is no need to consider anything else.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: glorkspangle</title>
		<link>http://existentialtype.wordpress.com/2011/04/17/some-advice-on-teaching-fp/#comment-751</link>
		<dc:creator><![CDATA[glorkspangle]]></dc:creator>
		<pubDate>Mon, 18 Apr 2011 10:21:23 +0000</pubDate>
		<guid isPermaLink="false">http://existentialtype.wordpress.com/?p=185#comment-751</guid>
		<description><![CDATA[You have &quot;structure INT_MAPPING = MAPPING where ...&quot;.  I think this is a typo for &quot;signature ...&quot;.]]></description>
		<content:encoded><![CDATA[<p>You have &#8220;structure INT_MAPPING = MAPPING where &#8230;&#8221;.  I think this is a typo for &#8220;signature &#8230;&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian Andres Klode</title>
		<link>http://existentialtype.wordpress.com/2011/04/17/some-advice-on-teaching-fp/#comment-750</link>
		<dc:creator><![CDATA[Julian Andres Klode]]></dc:creator>
		<pubDate>Mon, 18 Apr 2011 08:09:47 +0000</pubDate>
		<guid isPermaLink="false">http://existentialtype.wordpress.com/?p=185#comment-750</guid>
		<description><![CDATA[I am yet to start studying, but have seen a lot of languages and styles already, and in my opinion, functional programming is vastly superior to other styles. I&#039;m almost writing no functional code, but that is due to the fact that functional languages are not that well integrated into Linux systems in order to allow me to do what I want to do.

Here are my basic rules:

&lt;pre&gt;
* global state must be constant
* program by contract, verify invariants
* recursion is better than iteration
* correctness is more important than performance
* documentation is more important than features
&lt;/pre&gt;

The biggest advantage of a functional program is that the solution of the problem is basically the problem itself. For example, in Python, getting an array of the names of all persons in an array of persons in a functional form would be:

 names = [person.name for person in persons]

This is much shorter and more understandable than the imperative version:

 names = []
 for person in persons:
   names.append(person.name)

If person.name were knowingly pure, we could now easily run the first example in parallel. We can&#039;t do this for the second version as we loose the notion of transforming one array to another one, but only have an iteration for which we do something in every step.

It&#039;s like saying &quot;start the laptop and login&quot; vs. &quot;open the laptop lid, press the round button, once the login screen is there enter your name in the first box and your password in the second box, then click login.&quot; - in the first one you know what the goal is and could do it in multiple ways (you could enter the password before the username), in the second one you only know one way of doing it, preventing any further optimization by magic entities.

Functional programming is superior because we think about the problem, and not about a specific algorithm to solve it.]]></description>
		<content:encoded><![CDATA[<p>I am yet to start studying, but have seen a lot of languages and styles already, and in my opinion, functional programming is vastly superior to other styles. I&#8217;m almost writing no functional code, but that is due to the fact that functional languages are not that well integrated into Linux systems in order to allow me to do what I want to do.</p>
<p>Here are my basic rules:</p>
<pre>
* global state must be constant
* program by contract, verify invariants
* recursion is better than iteration
* correctness is more important than performance
* documentation is more important than features
</pre>
<p>The biggest advantage of a functional program is that the solution of the problem is basically the problem itself. For example, in Python, getting an array of the names of all persons in an array of persons in a functional form would be:</p>
<p> names = [person.name for person in persons]</p>
<p>This is much shorter and more understandable than the imperative version:</p>
<p> names = []<br />
 for person in persons:<br />
   names.append(person.name)</p>
<p>If person.name were knowingly pure, we could now easily run the first example in parallel. We can&#8217;t do this for the second version as we loose the notion of transforming one array to another one, but only have an iteration for which we do something in every step.</p>
<p>It&#8217;s like saying &#8220;start the laptop and login&#8221; vs. &#8220;open the laptop lid, press the round button, once the login screen is there enter your name in the first box and your password in the second box, then click login.&#8221; &#8211; in the first one you know what the goal is and could do it in multiple ways (you could enter the password before the username), in the second one you only know one way of doing it, preventing any further optimization by magic entities.</p>
<p>Functional programming is superior because we think about the problem, and not about a specific algorithm to solve it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andrejbauer</title>
		<link>http://existentialtype.wordpress.com/2011/04/17/some-advice-on-teaching-fp/#comment-749</link>
		<dc:creator><![CDATA[andrejbauer]]></dc:creator>
		<pubDate>Mon, 18 Apr 2011 07:53:08 +0000</pubDate>
		<guid isPermaLink="false">http://existentialtype.wordpress.com/?p=185#comment-749</guid>
		<description><![CDATA[How do you cope with the fact that in the presence of divergent programs beta-rule is an inequality rather than an equality? It seems to me that you need to make a clear distinction between an expression and its value very early on, so that you can explain substitution rules correctly. Do students really understand the difference between an expression and its value? The brightest philosophers didn&#039;t until the 20th century.]]></description>
		<content:encoded><![CDATA[<p>How do you cope with the fact that in the presence of divergent programs beta-rule is an inequality rather than an equality? It seems to me that you need to make a clear distinction between an expression and its value very early on, so that you can explain substitution rules correctly. Do students really understand the difference between an expression and its value? The brightest philosophers didn&#8217;t until the 20th century.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abstract Type</title>
		<link>http://existentialtype.wordpress.com/2011/04/17/some-advice-on-teaching-fp/#comment-748</link>
		<dc:creator><![CDATA[Abstract Type]]></dc:creator>
		<pubDate>Mon, 18 Apr 2011 04:30:52 +0000</pubDate>
		<guid isPermaLink="false">http://existentialtype.wordpress.com/?p=185#comment-748</guid>
		<description><![CDATA[What you said!  Thanks!]]></description>
		<content:encoded><![CDATA[<p>What you said!  Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
