Skip to content

Commit

Permalink
add derived Eq and Ord instances for FixedSegment
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Mike Zuser committed Mar 20, 2019
1 parent b6e4837 commit 1d15451
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Diagrams/Segment.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1d15451

Please sign in to comment.