
Hi. I've got two data structures, Star and Asteroid (eventually I'll make more) that both belong to the following type classes: Locatable, and Animation. I wanted to do something like so in part of the code: code: -------- let stars = ... in -- of type [Star] let asteroids = ... in -- of type [Asteroid] let visibleObjects = do visibleObject <- (stars ++ asteroids) ... -- prep each object for graphics system -- using funcs from both type classes ... -- feed visibleObjects to graphics system -------- However, this does not work because the two lists are not automatically downgraded when joined together by (++). The compiler complains about "asteroids" not being of type [Star]. What is the simplest way to do what I am trying to do? I tried this, but I think my syntax is off: code: -------- let visibleObjects = do visibleObject <- ((stars :: [(Locatable a, Animation a) => a) ++ (asteroids :: [(Locatable a, Animation a) => a) ) -------- Compiler complains about "Illegal polymorphic or qualified type". -- frigidcode.com indicium.us