From 1d15451a4ed6c8a4548a5e81b3e6255fd59b8090 Mon Sep 17 00:00:00 2001 From: Mike Zuser <mikezuser@gmail.com> Date: Wed, 20 Mar 2019 09:57:59 -0400 Subject: [PATCH] add derived Eq and Ord instances for FixedSegment These already exist for Located (Segment Closed v n), which FixedSegment v n is isomorphic to, but adding the instances avoids having to do the conversion. The Eq instance is useful to prevent trivial cases of running segmentSegment on overlaping segments. --- src/Diagrams/Segment.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Diagrams/Segment.hs b/src/Diagrams/Segment.hs index 752d6a31..c18b5a93 100644 --- a/src/Diagrams/Segment.hs +++ b/src/Diagrams/Segment.hs @@ -371,7 +371,7 @@ instance (Metric v, OrderedField n) -- the absolute locations of the vertices and control points. data FixedSegment v n = FLinear (Point v n) (Point v n) | FCubic (Point v n) (Point v n) (Point v n) (Point v n) - deriving Show + deriving (Eq, Ord, Show) type instance V (FixedSegment v n) = v type instance N (FixedSegment v n) = n