All basic datatypes (like Int
, String
, Eq a => [a]
) from Prelude except for functions and IO
have instances of Eq
. If a type instantiates Eq
it means that we know how to compare two values for value or structural equality.
> 3 == 2
False
> 3 == 3
True
(==) :: Eq a => a -> a -> Boolean
or (/=) :: Eq a => a -> a -> Boolean
(if only one is implemented, the other defaults to the negation of the defined one)(==) :: Eq a => a -> a -> Boolean
(/=) :: Eq a => a -> a -> Boolean
None