Re: [Haskell-cafe] Existencial Types

2009-12-03 Thread rodrigo.bonifacio
Dear Luke, thanks for your answers If SelectScecario is used for other purposes, then give an explicit cast function Sure, as I mentioned, we have different transformations and it would be worth to filter a list of transformations by a particular type or even apply the list of

Re: [Haskell-cafe] Existencial Types

2009-12-02 Thread Ryan Ingram
On Tue, Dec 1, 2009 at 4:44 PM, Luke Palmer lrpal...@gmail.com wrote: Existential types only buy you power when the quantified variable appears more than once on the right hand side, for example:  forall a. Num a = (a,a).  But even those can usually be factored out into more direct

[Haskell-cafe] Existencial Types

2009-12-01 Thread rodrigo.bonifacio
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

Re: [Haskell-cafe] Existencial Types

2009-12-01 Thread David Menendez
On Tue, Dec 1, 2009 at 1:00 PM, rodrigo.bonifacio rodrigo.bonifa...@uol.com.br wrote: Dear all, I wrote the following  types: class Transformation t where   (+) :: t - SPLModel  - InstanceModel - InstanceModel data Configuration = forall t . Transformation t = Configuration

Re: [Haskell-cafe] Existencial Types

2009-12-01 Thread Luke Palmer
On Tue, Dec 1, 2009 at 11:21 AM, David Menendez d...@zednenem.com wrote: On Tue, Dec 1, 2009 at 1:00 PM, rodrigo.bonifacio rodrigo.bonifa...@uol.com.br wrote: Dear all, I wrote the following  types: class Transformation t where   (+) :: t - SPLModel  - InstanceModel - InstanceModel data

Re: [Haskell-cafe] Existencial Types

2009-12-01 Thread rodrigo.bonifacio
Thanks Luke. In fact I, will have different implementations of the Transformation type. Something like: data SelectScenarios = SelectScenarios { scIds :: [Id] }   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

Re: [Haskell-cafe] Existencial Types

2009-12-01 Thread Ryan Ingram
newtype Transformation = Transformation { (+) :: SPLModel - InstanceModel - InstanceModel } data SelectScenarios = SelectScenarios { scIds :: [Id] } scenarioTransform scenario = Transformation $ \spl inst - something testScenario = SelectScenarios [] test = scenarioTransform testScenario

Re: [Haskell-cafe] Existencial Types

2009-12-01 Thread Luke Palmer
On Tue, Dec 1, 2009 at 4:21 PM, rodrigo.bonifacio rodrigo.bonifa...@uol.com.br wrote: Thanks Luke. In fact I, will have different implementations of the Transformation type. Something like: data SelectScenarios = SelectScenarios { scIds :: [Id] } What is this different type buying you?