hsclass Bounded a where
minBound, maxBound :: a
hsinstance Bounded Bool where
minBound = False
maxBound = True
hsdata Bearing = North | East | South | West deriving (Bounded)
hsdata Bearing = North | East | South | West
instance Bounded Bearing where
minBound = North
maxBound = West
North
が上限になり、最後の West
が下限になる