Mar 20, 2018 - 12:29 AM
shapeToPicture :: Shape -> Picture
shapeToPicture (Line p1 p2) = polyline [p1, p2]
If you add more constructors for Shape, you would need to add more equations for shapeToPicture that convert those kinds of shapes, as well.
I don't see any reason to define a myLine function as you've done. The constructor, Line, is already a perfectly good function for creating Shapes of that form.
Mar 20, 2018 - 04:14 AM