A sample revised prelude for numeric classes
Marcin 'Qrczak' Kowalczyk
qrczak@knm.org.pl
12 Feb 2001 14:12:02 GMT
Mon, 12 Feb 2001 12:04:39 +0100 (CET), Marcin 'Qrczak' Kowalczyk <mk167280@zodiac.mimuw.edu.pl> pisze:
> This is my bet.
I changed my mind:
class Eq a => PartialOrd a where -- or Ord
(<), (>), (<=), (>=) :: a -> a -> Bool
-- Minimal definition: (<) or (<=).
-- For partial order (<=) is required.
-- For total order (<) is recommended for efficiency.
a < b = a <= b && a /= b
a > b = b < a
a <= b = not (b < a)
a >= b = b <= a
--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTĘPCZA
QRCZAK