<p>Dear all, I wrote the following types:</p>
<p>> class Transformation t where <br />> (<+>) :: t -> SPLModel -> InstanceModel -> InstanceModel</p>
<p>> data Configuration = forall t . Transformation t => Configuration (FeatureExpression, [t])<br />> type ConfigurationKnowledge = [Configuration]</p>
<p> </p>
<p>I tried to write a function that retrieves the list of transformations of a configuration. Bellow a code snip of such a function.</p>
<p>> transformations ck fc = concat [snd c | (Configuration c) <- ck, eval fc (fst c)]</p>
<p>However, compiling this I got:</p>
<p>--- <br />Inferred type is less polymorphic than expected<br /> Quantified type variable `t' escapes<br /> When checking an existential match that binds<br /> c :: (FeatureModel.Types.FeatureExpression, [t])<br /> The pattern(s) have type(s): Configuration<br /> The body has type: [t]<br /> In a stmt of a list comprehension: (Configuration c) <- ck<br /> In the first argument of `concat', namely<br /> `[snd c | (Configuration c) <- ck, eval fc (fst c)]'</p>
<p>---</p>
<p> </p>
<p>How can I fix this problem?</p>
<p>Thanks,</p>
<p>Rodrigo.</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>