[Haskell] Set of an Unordered Data Type with a given ordering
- by Ingdas
I'm trying to put this data type in a Haskell Set, but I don't want to give it a general instance of Ord. So I want to give the set an ordering on y-coördinate but without instance Ord Vector. Is this possible?
data Vector = V
{ x :: Double
, y :: Double
} deriving (Eq)