\begin{slide}{Pretty-Printing (I)}


John Hughes's and Simon Peyton Jones's Pretty Printer Combinators


Based on 
\emph{The Design of a Pretty-printing Library} 
in \emph{Advanced Functional Programming}, 
Johan Jeuring and Erik Meijer (eds), LNCS 925 


\begin{small}
\url{http://hackage.haskell.org/packages/archive/pretty/1.0.1.0/doc/html/Text-PrettyPrint-HughesPJ.html}
\end{small}

\end{slide}

\begin{slide}{Pretty-Printing (II)}


  \begin{itemize}\itemsep 1pt
  \item 
\verb|data Doc| abstrakter Dokumententyp,
  repräsentiert Textblöcke
\item Konstruktoren:
\begin{verbatim}
text :: String -> Doc
\end{verbatim}
\item
  Kombinatoren:
\begin{verbatim}
vcat       :: [ Doc ] -> Doc -- vertikal
hcat, hsep :: [ Doc ] -> Doc -- horizontal
\end{verbatim}
\item  
Ausgabe: \verb|render :: Doc -> String|
  \end{itemize}

\end{slide}

