@@ -242,6 +242,33 @@ instance Ord Bits64 where
242242 else if l > r then GT
243243 else EQ
244244
245+-- ------------------------------------------------------------- [ Bounded ]
246+
247+-- | Names the upper and lower elements of a type. Ord is not a superclass of
248+-- Bounded since types that are not totally ordered may also have upper and
249+-- lower bounds.
250+class Bounded b where
251+ -- | The lower bound for the type
252+ minBound : b
253+ -- | The upper bound for the type
254+ maxBound : b
255+
256+instance Bounded () where
257+ minBound = ()
258+ maxBound = ()
259+
260+instance Bounded Bits16 where
261+ minBound = 0x0
262+ maxBound = 0xffff
263+
264+instance Bounded Bits32 where
265+ minBound = 0x0
266+ maxBound = 0xffffffff
267+
268+instance Bounded Bits64 where
269+ minBound = 0x0
270+ maxBound = 0xffffffffffffffff
271+
245272
246273-- ------------------------------------------------------------- [ Fractionals ]
247274