3 ms·
Haskell only allows arithmetic operators on like types, so you cannot add an Int to a Word32, subtract an Int16 from an Int64, or compare an Integer with an Int
by tromp 5y ago
Haskell only allows arithmetic operators on like types,
so you cannot add an Int to a Word32, subtract an Int16 from an Int64,
or compare an Integer with an Int.
Operators are defined in typeclass Num, so the type of e.g. addition is
(+) :: Num a => a -> a -> a
while comparisons are define in typeclasses Eq and Ord, with types like
(/=) :: Eq a => a -> a -> Bool
(<=) :: Ord a => a -> a -> Bool