[Haskell-cafe] Existential quantification of config data types
cpdurham at gmail.com
Mon Apr 18 18:45:51 UTC 2016
I'm running into a weird problem i've never had before.
I want to define a datatype like:
data Network = forall a. Layer a => Network [a]
for which I have things that implement Layer, like
data TypicalLayer = ...
instance Layer TypicalLayer where ...
with this, I want to be able to load a Network from a config file where
Network can consist of different data types all implementing Layer.
Is there a nice way to do this without making a data type that combines all
of my layer types, something like:
data LayerType = TypicalLayerType TypicalLayer | AnotherLayerType
Thanks for the help!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe