interface Eq a where
(==) : a -> a -> Bool
(/=) : a -> a -> Bool
Equality interface. Two methods: (==) and (/=). Default: (/=) is defined from not and (==), so implementations only need to provide (==).
import nécessaire.interface Eq a where
(==) : a -> a -> Bool
(/=) : a -> a -> Bool
Equality interface. Two methods: (==) and (/=). Default: (/=) is defined from not and (==), so implementations only need to provide (==).
data Ordering
= LT
| EQ
| GT
Ordering is the result type of compare (see Ord below).
LTthe left operand is smaller
EQboth are equal
GTthe left operand is greater