
11 Oct
2014
11 Oct
'14
9:02 a.m.
data Cycle = Cycle { name :: String, size :: Double } deriving (Eq, Show) instance Ord Cycle where (<) a b = (<) (size a) (size b) -- problem statement! … How can I specify that, on the right-hand side of the problem statement, I refer to (<) :: Double -> Double -> Bool instead of (<) :: Cycle -> Cycle -> Bool? Is there another way to state that "Cycle is an instance of Ord based on size"?