<div dir="ltr">Hi,<div><br></div><div>I'm running into a weird problem i've never had before.</div><div><br></div><div>I want to define a datatype like:</div><div><br></div><div>data Network = forall a. Layer a => Network [a]</div><div><br></div><div>for which I have things that implement Layer, like</div><div><br></div><div>data TypicalLayer = ...</div><div><br></div><div>instance Layer TypicalLayer where ...</div><div><br></div><div>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.</div><div><br></div><div>Is there a nice way to do this without making a data type that combines all of my layer types, something like:</div><div><br></div><div>data LayerType = TypicalLayerType TypicalLayer | AnotherLayerType AnotherLayer ...</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>deriving (Show,Read)</div><div><br></div></blockquote></div></blockquote><div>Thanks for the help!</div><div><br></div><div>Charlie Durham</div></div>