generated at
Bounded型クラス
上限と下限を持つ
e.g. Int(固定調整数)


hs
class Bounded a where minBound, maxBound :: a



hs
instance Bounded Bool where minBound = False maxBound = True


derivingしたときは、宣言順になるらしい
hs
data Bearing = North | East | South | West deriving (Bounded)
以下と同じ
hs
data Bearing = North | East | South | West instance Bounded Bearing where minBound = North maxBound = West
最初に宣言した North が上限になり、最後の West が下限になる
ほんま?