\documentclass[12pt]{article}
\usepackage{fullpage,amsmath,amssymb}

%\setlength{\voffset}{1 in}

\setlength{\parskip}{1 ex}
\setlength{\parindent}{0 ex}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{center}
\textbf{Summary of Haskell classes}
\end{center}

For more detail see section~6 of the Haskell 98 Language and Libraries
Revised Report.


1. \textsl{Input-output}

\texttt{%
Show\\
\ \ \textrm{-- has \texttt{show} function that converts value to string}
}

\texttt{%
Read\\
\ \ \textrm{-- has \texttt{read} function that converts string to value}
}

2. \textsl{equality and order}

\texttt{%
Eq\\
\ \ \textrm{-- has concept of equality\\
\ \ -- has \texttt{==} and \texttt{/=} functions}
}

\texttt{%
Ord\\
\ \ \textrm{-- extends \texttt{Eq}\\
\ \ -- has concept of order\\
\ \ -- has \texttt{<, <=, >, >=} and \texttt{compare} functions}
}

3. \textsl{numerical classes}

\texttt{%
Num \textrm{(for ``numeric'')\\
\ \ -- extends \texttt{Eq, Show}\\
\ \ -- includes the types \texttt{Int, Integer, Float, Double}\\
\ \ -- has concept of arithmetic operations\\
\ \ -- has \texttt{+, -, *, abs,} and \texttt{fromInteger} functions}
}

%\texttt{%
%Real \textrm{\\
%\ \ -- extends \texttt{Num}\\
%\ \ -- includes the types \texttt{Int, Integer, Float, Double}\\
%\ \ -- has \texttt{toRational} function}
%}

\texttt{%
Integral \textrm{\\
%\ \ -- extends \texttt{Real}\\
\ \ -- includes the types \texttt{Int, Integer}\\
\ \ -- has concept of remainder\\
\ \ -- has \texttt{quot, rem, div, mod} and \texttt{toInteger} functions}
}

\texttt{%
Fractional \textrm{\\
\ \ -- extends \texttt{Num}\\
\ \ -- includes the types \texttt{Float, Double}\\
\ \ -- has concept of division\\
\ \ -- has \texttt{/, recip,} and \texttt{fromRational} functions}
}

\texttt{%
Floating \textrm{\\
\ \ -- extends \texttt{Fractional}\\
\ \ -- includes the types \texttt{Float, Double}\\
\ \ -- has trig functions, exponentials and logarithms, etc.\\
\ \ -- has \texttt{exp, log, sqrt, sin, cos, ..., asin, ..., sinh, ..., asinh, ...}}}

\newpage

4. \textsl{classes from category theory}

\texttt{%
Monad \textrm{\\
%\ \ -- extends \texttt{Fractional}\\
\ \ -- includes the types \texttt{IO, Maybe}\\
\ \ -- a very general kind of type that includes many common design
patterns of Haskell}}
%\ \ -- has \texttt{exp, log, sqrt, sin, cos, ..., asin, ..., sinh, ..., asinh, ...}}}

\texttt{%
MonadPlus \textrm{\\
%\ \ -- extends \texttt{Fractional}\\
\ \ -- includes the types \texttt{IO, Maybe}\\
\ \ -- has a bit of additional structure beyond the basic \texttt{Monad}
class}}
%\ \ -- has \texttt{exp, log, sqrt, sin, cos, ..., asin, ..., sinh, ..., asinh, ...}}}

\texttt{%
Functor \textrm{\\
%\ \ -- extends \texttt{Fractional}\\
\ \ -- has concept of \texttt{map}\\
\ \ -- includes types \texttt{[a], Maybe}, trees and other data structures\\
\ \ -- has a function \texttt{fmap ::\ Functor a => (b -> c) -> a b -> a c}\\
\ \ -- \texttt{fmap} should satisfy \texttt{fmap( f . g ) = fmap f . fmap g}
}}
%\ \ -- has \texttt{exp, log, sqrt, sin, cos, ..., asin, ..., sinh, ..., asinh, ...}}}



5. \textsl{miscellaneous}

\texttt{%
Enum \textrm{(for ``enumeration'')\\
\ \ -- includes many common types\\
\ \ -- has concepts of predecessor and successor\\
\ \ -- has \texttt{pred} and \texttt{succ} functions}
}

\texttt{%
Bounded \textrm{\\
\ \ -- includes many common types\\
\ \ -- has concepts of predecessor and successor\\
\ \ -- has \texttt{maxBound} and \texttt{minBound} functions}\\
> maxBound :: Int\\
2147483647\\
> minBound :: Int\\
-2147483648\\
> maxBound :: Integer\\
ERROR - Cannot infer instance\\
*** Instance   : Bounded Integer\\
*** Expression : maxBound\\
}

\end{document}

