<p>Thanks Luke.</p>
<p>In fact I, will have different implementations of the Transformation type. Something like:</p>
<p>data SelectScenarios = SelectScenarios {</p>
<p>scIds :: [Id]</p>
<p>}</p>
<p> </p>
<p>And then I should be able to make SelectScenarios a kind of Transformation. So I think that I really need a class. What do you think about it?</p>
<p>instance Transformation SelectScenario where</p>
<p>(<+>) ....</p>
<p> </p>
<p>Regards,</p>
<p>Rodrigo.</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>Em 01/12/2009 19:39, <strong><span>Luke Palmer < lrpalmer@gmail.com ></span></strong> escreveu:</p>
<blockquote style="border-left: 2px solid #6868cc; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br />On Tue, Dec 1, 2009 at 11:21 AM, David Menendez wrote:<br />> On Tue, Dec 1, 2009 at 1:00 PM, rodrigo.bonifacio<br />> wrote:<br />>> Dear all, I wrote the following types:<br />>><br />>>> class Transformation t where<br />>>> (<+>) :: t -> SPLModel -> InstanceModel -> InstanceModel<br />>><br />>>> data Configuration = forall t . Transformation t => Configuration<br />>>> (FeatureExpression, [t])<br />>>> type ConfigurationKnowledge = [Configuration]<br /><br />I would suggest doing away with the class in a case like this.<br /><br />data Transformation = Transformation {<br /> (<+>) :: SPLModel -> InstanceModel -> InstanceModel<br /> }<br /><br />data Configuration = Configuration FeatureExpression [Transformation]<br /><br />I suspect that it was OO heritage that l
ed you to want a class here?<br />Forget that! :-)<br /><br />Luke<br /><br /></blockquote>