From f46fcc135d7985c8c95025e21f0aa5a1d09fe16f Mon Sep 17 00:00:00 2001 From: Lennart Spitzner Date: Wed, 8 Nov 2017 21:54:32 +0100 Subject: [PATCH] Update doc/HCAR entry --- doc/hcar/Brittany.tex | 55 ++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 32 deletions(-) diff --git a/doc/hcar/Brittany.tex b/doc/hcar/Brittany.tex index 5c6760d..f181b2f 100644 --- a/doc/hcar/Brittany.tex +++ b/doc/hcar/Brittany.tex @@ -1,6 +1,6 @@ -% Brittany-LE.tex -\begin{hcarentry}[new]{Brittany} -\report{Lennart Spitzner}%11/16 +% Brittany-LB.tex +\begin{hcarentry}[updated]{Brittany} +\report{Lennart Spitzner}%11/17 \status{work in progress} \makeheader @@ -11,44 +11,35 @@ haskell-src-exts such as hindent or haskell-formatter. The goals of the project are to: \begin{compactitem} -\item - support the full ghc-haskell syntax including syntactic extensions; -\item - retain newlines and comments unmodified (to the degree possible when code - around them gets reformatted); -\item - be clever about using horizontal space while not overflowing it if it cannot - be avoided; -\item - have linear complexity in the size of the input text / the number of +\item support the full ghc-haskell syntax including syntactic extensions; +\item retain newlines and comments unmodified (to the degree possible when + code around them gets reformatted); +\item be clever about using horizontal space while not overflowing it if it + cannot be avoided; +\item have linear complexity in the size of the input text / the number of syntactic nodes in the input. -\item - support horizontal alignments (e.g. different equations/pattern matches in - the some function's definition). +\item support horizontal alignments (e.g. different equations/pattern matches + in the some function's definition). \end{compactitem} -In contrast to other formatters brittany internally works in two steps: Firstly -transforming the syntax tree into a document tree representation, similar to -the document representation in general-purpose pretty-printers such as the -\emph{pretty} package, but much more specialized for the specific purpose of -handling a Haskell source code document. Secondly this document representation -is transformed into the output text document. This approach allows to handle -many different syntactic constructs in a uniform way, making it possible -to attain the above goals with a manageable amount of work. +In contrast to other formatters brittany internally works in two steps: +Firstly transforming the syntax tree into a document tree representation, +similar to the document representation in general-purpose pretty-printers such +as the \emph{pretty} package, but much more specialized for the specific +purpose of handling a Haskell source code document. Secondly this document +representation is transformed into the output text document. This approach +allows to handle many different syntactic constructs in a uniform way, making +it possible to attain the above goals with a manageable amount of work. Brittany is work in progress; currently only type signatures and function bindings are transformed, and not all syntactic constructs are supported. -Nonetheless Brittany is safe to try/use as there are checks in place to -ensure that the output is syntactically valid. +Nonetheless Brittany is safe to try/use as there are checks in place to ensure +that the output is syntactically valid. -Brittany requires ghc-8, and is not released on hackage yet; for a description -of how to build it see the repository README. +Brittany requires ghc-8.*, and is available on Hackage and on Stackage. \FurtherReading -{\small \begin{compactitem} - \item - \url{https://github.com/lspitzner/brittany} + \item \url{https://github.com/lspitzner/brittany} \end{compactitem} -} \end{hcarentry}