<br><br>
<div class="gmail_quote">2009/4/7 Michael Mossey <span dir="ltr">&lt;<a href="mailto:mpm@alumni.caltech.edu">mpm@alumni.caltech.edu</a>&gt;</span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">I&#39;m coming from the OO world and trying to adapt.<br></blockquote>
<div> </div>
<div>me too :-)</div>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>For that matter, I don&#39;t know what the term is for a &quot;StaffItem-type LayoutItem&quot;. The type is clearly LayoutItem. &quot;StaffItem&quot; is the constructor. How do you refer to the concept of a LayoutItem constructed via a StaffItem?<br>
<br>Again, StaffItem and TextItem resemble derived classes in OO.<br></blockquote>
<div> </div>
<div>To me, they are more close to C union : a data type than can alternatively have different structures,</div>
<div>In your example, LayoutItem is a type name, while StaffItem and TextItem are constructor, that is functions.</div>
<div>Saying that a function specializes a type is a bit of a stretch, I think ...</div>
<div> </div>
<div>Nevertheless, they can sometime be used to accomplish the same goal : where in OO you define an abstact class and then</div>
<div>specialize with concrete classes to model a classification, in haskell you can define a data type with alternate constructors.</div>
<div> </div>
<div>I think that data types with alternate constructores are called algebraic data types in haskellese, but I&#39;m not sure of that ...</div>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><span id=""></span><br>Any clarification welcome.<br>-Mike<br></blockquote>
<div> </div>
<div>Ciao</div>
<div>-----</div>
<div>FB</div></div>