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