<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rss [<!ENTITY % HTMLlat1 PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">]>
<rss version="0.92" xml:base="http://lambda-the-ultimate.org">
<channel>
 <title>Lambda the Ultimate - Comments</title>
 <link>http://lambda-the-ultimate.org</link>
 <description>Comments</description>
 <language>en</language>
<item>
 <title>IIRC some old versions of</title>
 <link>http://lambda-the-ultimate.org/node/2908#comment-42999</link>
 <description>&lt;i&gt;IIRC some old versions of Lisp had a (comment &quot;string&quot;) expression which meant the same as () ie nil but was a comment kept in the AST.&lt;/i&gt;

Well, Emacs Lisp and Python have documentation strings, e.g.:

From &lt;a href=&quot;http://www.gnu.org/software/emacs/elisp/html_node/Defining-Functions.html#Defining-Functions&quot;&gt;the GNU Emacs Lisp Reference Manual&lt;/a&gt;:

&lt;pre&gt;
  (defun capitalize-backwards ()
            &quot;Upcase the last letter of a word.&quot;
            (interactive)
            (backward-word 1)
            (forward-word 1)
            (backward-char 1)
            (capitalize-word 1))
               =&gt; capitalize-backwards
&lt;/pre&gt;

You can then access the documenation string at runtime by using &lt;code&gt;(documentation &#039;&lt;i&gt;function&lt;/i&gt;)&lt;/code&gt; in Emacs Lisp or &lt;code&gt;print &lt;i&gt;function&lt;/i&gt;.__doc__&lt;/code&gt; in Python.</description>
 <pubDate>Fri, 25 Jul 2008 01:06:06 -0400</pubDate>
 <author>Alexandre Richer</author>
 <category>What to do about comments?</category>
</item>
<item>
 <title>And arguably...</title>
 <link>http://lambda-the-ultimate.org/node/2699#comment-42998</link>
 <description>And arguably, static languages would be improved if they more commonly allowed the recognition that all of these nil values are in some sense the same. And this is exactly the kind of thing that generic programming is all about.</description>
 <pubDate>Thu, 24 Jul 2008 23:26:45 -0400</pubDate>
 <author>Matt Hellige</author>
 <category>Is null needed?</category>
</item>
<item>
 <title>Apologies to Philippa if I&#039;m off base here, but...</title>
 <link>http://lambda-the-ultimate.org/node/2911#comment-42997</link>
 <description>I think the idea is that *? is a kind variable.  Consider the kind of Set.  It&#039;s not * -&gt; *, but EQ -&gt; *, where EQ is the subkind of types that implement equality.  As a variable I think it might be better to give it a name, so I&#039;ll use *A (imagining *B, *C, etc):

&lt;code&gt;&lt;pre&gt;
class Functor (f :: *A -&gt; *) where
	fmap :: ((a :: *A) -&gt; (b :: *A)) -&gt; f a -&gt; f b
&lt;/code&gt;&lt;/pre&gt;

The kinds of types a and b in the signature of fmap should probably be inferred from the use of f, so the signature of fmap could be the usual one.  

This feels like a can of worms, but I think Philippa&#039;s suggestion to restrict the construction of Sets to the appropriate kind of type sounds like &quot;the right way&quot; to proceed.

</description>
 <pubDate>Thu, 24 Jul 2008 23:06:04 -0400</pubDate>
 <author>Matt M</author>
 <category>Type classes and type generator restrictions</category>
</item>
<item>
 <title>Compiling bitC</title>
 <link>http://lambda-the-ultimate.org/node/2902#comment-42996</link>
 <description>I just got what I think is your latest release via rsync (I don&#039;t have Hg) It needed a couple dependencies I didn&#039;t have that the configure script didn&#039;t tell me about.  They were the ici stuff (uchar.h) and the Boehm gc package.  Also I had to symlink x86_64 to the i386 directory to get it to find mkclosure.c.  Compiled alright after that.  This is on an AMD64 of course.</description>
 <pubDate>Thu, 24 Jul 2008 23:03:16 -0400</pubDate>
 <author>Gregory Propf</author>
 <category>Systems programming in languages other than C?</category>
</item>
<item>
 <title>yes, essential like 0</title>
 <link>http://lambda-the-ultimate.org/node/2699#comment-42995</link>
 <description>&lt;p&gt;Nil-like values are essential like 0 because we like to define data structures inductively.   &quot;A list is the empty list or...&quot;, &quot;A natural number is 0 or ...&quot;, etc.   It&#039;s just handy to have around.&lt;/p&gt;
&lt;p&gt;The question is, do you want just one?  or many?&lt;/p&gt;
&lt;p&gt;The statically typed languages generally say &quot;many&quot;: you explicitly define a new one for each new type.&lt;/p&gt;
&lt;p&gt;Dynamic languages, for some reason, mostly fixate on having &quot;one true nil&quot; so that a nil list is EQ? to a nil tree.   (Scheme is a mild exception.  It somehow settled on having &quot;two true nils&quot; (&quot;()&quot; and &quot;#f&quot;) which divide among themselves the  properties of a &quot;one true nil&quot;.&lt;/p&gt;
&lt;p&gt;The &quot;win&quot; of &quot;one [or two] true nil[s]&quot; in a dynamic language is that it allows easier abstraction of patterns of induction.   For example, one could write a common-lisp function &quot;MAP-SEQUENCE&quot; that works on all sequence types using generic functions to access elements and build the result -- using &quot;nil&quot; to stand for the &quot;end of sequence&quot; in all cases.&lt;/p&gt;
&lt;p&gt;The &quot;lose&quot; is that a limitation to only one or two true nils gets in the way of composing data types.   For example, suppose that I have an associative data structure (say, a hash table).  I wish to define that values stored in the table are either lists (possibly empty) or values (possibly nil) of a given record type.   If I store a non-nil value in the hash table, the type (list or record) is preserved.  If I store a nil value, the table doesn&#039;t know if I stored a nil record or a nil list.&lt;/p&gt;
&lt;p&gt;Arguably, dynamic languages would be improved if they more commonly allowed the creation of (in scheme terms) multiple NIL? objects none of which are EQ? to any others.   With the generic NIL? one could still abstract patterns of induction.   With multiple, non-EQ? nils, I&#039;d have an easier time composing data structures.&lt;/p&gt;
&lt;p&gt;-t&lt;/p&gt;
</description>
 <pubDate>Thu, 24 Jul 2008 20:24:02 -0400</pubDate>
 <author>Thomas Lord</author>
 <category>Is null needed?</category>
</item>
<item>
 <title>how hard can it be, really?</title>
 <link>http://lambda-the-ultimate.org/node/2908#comment-42994</link>
 <description>&lt;p&gt;CPP emits &quot;#&quot; directives to report filenames and line numbers properly.   C compilers already deal with that and already decorate the AST with that information.  They typically keep track of columns, as well.&lt;/p&gt;
&lt;p&gt;To fully handle preserving comments and other pre-processor information, all that a typical parser needs to do is build an index that maps file/line/column positions to a number of datums:  the extents of the previous, following, and enclosing comments (if any);  the &quot;include stack&quot;, and the &quot;macro expansion stack&quot;.   A &quot;positition&quot; as a compiler might emit it in an error message is then &quot;file X, line Y, column Z, as expanded by the macro definition at file A, line B, column C, as expanded by [....], as included from [....]&quot;.&lt;/p&gt;
&lt;p&gt;In other words, ASTs *already* contain (as node attributes) file / line / column information -- and that is completely sufficient to index a record of &quot;what CPP did&quot;.   It shouldn&#039;t &quot;hair up&quot; parsers or lexers, much at all.&lt;/p&gt;
&lt;p&gt;A separate question is the idea of defining new languages in which comments are constrained as to their location and are explicitly attached to a specific AST node (e.g., a comment attached to a function definition or attached to the declaration of one of the parameters to that function).
&lt;p&gt;-t&lt;/p&gt;
</description>
 <pubDate>Thu, 24 Jul 2008 19:53:04 -0400</pubDate>
 <author>Thomas Lord</author>
 <category>What to do about comments?</category>
</item>
<item>
 <title>Too Strong</title>
 <link>http://lambda-the-ultimate.org/node/2909#comment-42993</link>
 <description>&lt;i&gt;A side effecting procedure cannot be reordered without breaking the programmer&#039;s intent&lt;/i&gt;

This is a bit too strong--it assumes that every order expressed in the syntax is the result of the programmer&#039;s intent. But linear syntax means the programmer has no choice but to state things in a particular order, whether that order is part of his intent or not. He ought to have a way to say that.

In fact, I&#039;d say the terminology reinforces your point of view: a &quot;side&quot; effect ought to be one that can be reordered or discarded without consequence. One that cannot ought to be called a &quot;primary&quot; effect. When printf() writes to stdout, that&#039;s a primary effect. When log() does, that&#039;s a side effect.

</description>
 <pubDate>Thu, 24 Jul 2008 19:07:21 -0400</pubDate>
 <author>marshall</author>
 <category>FP in D 2.0</category>
</item>
<item>
 <title>Mizar, Isar and proofless text</title>
 <link>http://lambda-the-ultimate.org/node/2910#comment-42992</link>
 <description>It seems to me that proofless text is a language for expressing definitions and assertions and does not cover proofs. The &quot;Practical Set Theory&quot; article talks about definitions only. I would not say that it is a representation of mathematical reasoning that can be verified by a machine. Mizar and Isabelle&#039;s Isar (and I guess Ontic) are formal proof languages that allow to write and verify definitions and theorems, where a theorem is an assertion with the accompanying proof.
The human readable rendering of PST is impressive and it would be interesting to see PST expanded to cover proofs as well.</description>
 <pubDate>Thu, 24 Jul 2008 18:58:07 -0400</pubDate>
 <author>slawekk</author>
 <category>Practical Set Theory</category>
</item>
<item>
 <title>Yup.</title>
 <link>http://lambda-the-ultimate.org/node/2911#comment-42991</link>
 <description>Yup.</description>
 <pubDate>Thu, 24 Jul 2008 18:13:36 -0400</pubDate>
 <author>Douglas McClean</author>
 <category>Type classes and type generator restrictions</category>
</item>
<item>
 <title>No place to put context</title>
 <link>http://lambda-the-ultimate.org/node/2911#comment-42990</link>
 <description>Ah, so you want something like this to work...
&lt;blockquote&gt;
&lt;pre&gt;
instance Functor Set where
  fmap :: (Ord a, Ord b) =&gt; (a -&gt; b) -&gt; (Set a) -&gt; (Set b)
  fmap = S.map
&lt;/pre&gt;
&lt;blockquote&gt;</description>
 <pubDate>Thu, 24 Jul 2008 18:00:50 -0400</pubDate>
 <author>Greg Buchholz</author>
 <category>Type classes and type generator restrictions</category>
</item>
<item>
 <title>Ah, indeed.  So, under the</title>
 <link>http://lambda-the-ultimate.org/node/2699#comment-42989</link>
 <description>Ah, indeed.  So, under the hood at machine level, you&#039;d have a regular pointer (which the compiler guarantees will always point somewhere valid, insofar as it can, and doesn&#039;t provide the option of &quot;nullifying&quot;), and then the option type is the same representation but might also have a value that represents &quot;there isn&#039;t a pointer-to-something stored here&quot;?  And, of course, one can query the latter so see if there&#039;s a pointer-to-something there or not.  That makes a lot of sense to me.
</description>
 <pubDate>Thu, 24 Jul 2008 16:45:25 -0400</pubDate>
 <author>Brooks Moses</author>
 <category>Is null needed?</category>
</item>
<item>
 <title>(Possible) Differences from Haskell</title>
 <link>http://lambda-the-ultimate.org/node/2911#comment-42988</link>
 <description>My problem, in Haskell-speak, is that I would like to unify the definition of Prelude.fmap with that of Data.Set.map, and in so doing to make (Functor Data.Set) a valid instance.

&lt;pre&gt;
*Main&gt; Prelude.fmap (+) theSet

&amp;lt;interactive&amp;gt;:1:0:
    No instance for (Functor Set)
      arising from use of `fmap&#039; at &lt;interactive&gt;:1:0-22
    Possible fix: add an instance declaration for (Functor Set)
    In the expression: fmap (+) theSet
    In the definition of `it&#039;: it = fmap (+) theSet
&lt;/pre&gt;

Data.Set doesn&#039;t define this instance because (as I understand it) it isn&#039;t possible, because there isn&#039;t a way to carry the constraint that making a set requires equality (or in the case of Data.Set, ordering) along with the type of fmap.</description>
 <pubDate>Thu, 24 Jul 2008 16:35:13 -0400</pubDate>
 <author>Douglas McClean</author>
 <category>Type classes and type generator restrictions</category>
</item>
<item>
 <title>Different from Haskell?</title>
 <link>http://lambda-the-ultimate.org/node/2911#comment-42987</link>
 <description>  I&#039;m not sure I understand the question.  Here&#039;s an example Haskell program:

&lt;blockquote&gt;
&lt;pre&gt;
import Data.Set as S

theSet = S.insert 1 (S.insert 2 (S.insert 3 S.empty))
 
foo = S.map (+) theSet
&lt;/pre&gt;
&lt;/blockquote&gt;

...that fails with the following compiler error message in GHC...

&lt;blockquote&gt;
&lt;pre&gt;
setfun.hs:5:6:
    No instance for (Ord (a -&gt; a))
      arising from use of `map&#039; at setfun.hs:5:6-21
    Possible fix: add an instance declaration for (Ord (a -&gt; a))
    In the expression: map (+) theSet
    In the definition of `foo&#039;: foo = map (+) theSet
Failed, modules loaded: none.
&lt;/pre&gt;
&lt;/blockquote&gt;

...what differences from Haskell are you looking for?
</description>
 <pubDate>Thu, 24 Jul 2008 16:23:11 -0400</pubDate>
 <author>Greg Buchholz</author>
 <category>Type classes and type generator restrictions</category>
</item>
<item>
 <title>FlapJax</title>
 <link>http://lambda-the-ultimate.org/node/2893#comment-42986</link>
 <description>You can do something like what you want with &lt;a href=&quot;http://www.flapjax-lang.org&quot;&gt;FlapJax&lt;/a&gt;, which gives you a functional reactive environment in JavaScript. Since it&#039;s wrapped up inside of a web page, you can easily do a kind of &quot;literate spreadsheet programming&quot;. 

You&#039;d do your programming with the FlapJax core, and use its DOM library to actually show the results of the computation.
</description>
 <pubDate>Thu, 24 Jul 2008 14:52:12 -0400</pubDate>
 <author>rossjudson</author>
 <category>In search for a programming language to replace spreadsheets.</category>
</item>
<item>
 <title>Just when I thought I was getting somewhere</title>
 <link>http://lambda-the-ultimate.org/node/2911#comment-42985</link>
 <description>I&#039;m fairly sure I am missing something. The proposed *? kind seems strange, since nothing has that kind. Or are you saying that it decorates the arrow, like * -&gt;? *        ?

If I understand the definition properly, at the moment I only have rank-2 types, because the product type generator and the function arrow are the highest kinded things I&#039;ve decided to care about yet.

Under this idea, what would the type of the map function end up being?

</description>
 <pubDate>Thu, 24 Jul 2008 13:51:31 -0400</pubDate>
 <author>Douglas McClean</author>
 <category>Type classes and type generator restrictions</category>
</item>
</channel>
</rss>
