Suppose I have the following:
class Shape a where draw a :: a -> IO () data Rectangle = Rectangle Int Int instance Shape Rectangle where draw (Recta
Consider using a single type instead of separate types and a typeclass.
data Shape = Rectangle Int Int | Circle Int Int draw (Rectangle length width) = ... draw (Circle center radius) = ... shapes = [Circle 5 10, Circle 20 30, Rectangle 10 15]