On Sun, Nov 8, 2009 at 6:21 AM, Deniz Dogan &lt;<a href="mailto:deniz.a.m.dogan@gmail.com">deniz.a.m.dogan@gmail.com</a>&gt; wrote:<br>&gt; What point are you trying to make by distinguishing JSON from<br>&gt; JavaScript? JSON is a subset of JavaScript, they share the same type<br>
&gt; system. &quot;Null can be only one value.&quot; This doesn&#39;t make sense to me,<br>&gt; since as you say null is not a type, but a value.<br>&gt;<br>&gt; --<br>&gt; Deniz Dogan<br>&gt;<br><br>It seems I underestimated the typedness of null in JavaScript :) I checked the ECMAScript specification, and it does refer to a &quot;null
type&quot;.. so titto was right.[1] My opinion is that JSON&#39;s &#39;type system&#39; should be analyzed orthogonal to JavaScript&#39;s regardless. If JSON is a subset of JavaScript, it is primarily a syntactic one. When I said &quot;Null can be only one value&quot;, implying that null is a type, I was referring to JSON&#39;s null, not JavaScript&#39;s null. In JSON, null *is* definitely a unit type. When considering mappings between Haskell and JSON in the case of (), we should see that () is a unit type in Haskell, null is a unit type in JSON (regardless of its role in JavaScript), and maybe try to associate them.<br>
<br>—Matt<br><br>[1] I was misled by the fact that typeof null = &#39;object&#39;. The logic behind this, I think, is that null is meant to be bound to a variable that would otherwise
be a reference to an actual object value. Many have criticized this result, e.g. Douglas Crockford (<a href="http://javascript.crockford.com/remedial.html">http://javascript.crockford.com/remedial.html</a>)<br>