Classes Flashcards
Eq
equality types:
types whose values can be compared for equality
Ord
ordered types: class contains types of the Eq whose values are totally ordered
Show
showable types :
types whose values can be converted into strings
Read
readable types:
dual to Show, contains types whose values can be converted from strings
Num
numeric types have values which are numbers
Integral
contains instances of the numeric class Num whose values are integer and support integer division and integer remainder
Fractional
contains instances of the numeric class Num whose values are not Integral and support fractional division and remainder
What are the Eq methods?
(==) :: a -> a -> Bool
(/=) :: a -> a -> Bool
What are the Ord methods?
( a-> Bool (<=) :: a-> a-> Bool (>) :: a-> a-> Bool (>=) :: a-> a-> Bool min :: a-> a-> a max :: a-> a-> a
What are the Show methods?
show :: a-> String
What are the Read methods?
read :: String -> a
What are the Num methods?
(+) :: a -> a -> a (-) :: a -> a -> a (*) :: a -> a -> a negate :: a -> a abs :: a -> a signum:: a -> a
What are the Integral methods?
div :: a-> a-> a
mod :: a-> a-> a
What are the Fractional methods?
(/) :: a -> a-> a
recip :: a -> a