Update README.md and commandline description

pull/132/head
Lennart Spitzner 2018-03-25 16:06:36 +02:00
parent 3b20d0275e
commit 8cabd08477
2 changed files with 9 additions and 8 deletions

View File

@ -8,13 +8,12 @@ haskell source code formatter
This project's goals roughly are to: This project's goals roughly are to:
- Always retain the semantics of the source being transformed; - Always retain the semantics of the source being transformed;
- Be idempotent (this also directly ensures that only valid haskell is - Be idempotent;
produced);
- Support the full GHC-haskell syntax including syntactic extensions - Support the full GHC-haskell syntax including syntactic extensions
(but excluding `-XCPP` which is too hard); (but excluding `-XCPP` which is too hard);
- Retain newlines and comments unmodified; - Retain newlines and comments unmodified;
- Be clever about using the available horizontal space while not overflowing - Be clever about using the available horizontal space while not overflowing
it if it cannot be avoided; the column maximum if it cannot be avoided;
- Be clever about aligning things horizontally (this can be turned off - Be clever about aligning things horizontally (this can be turned off
completely however); completely however);
- Have linear complexity in the size of the input. - Have linear complexity in the size of the input.
@ -27,8 +26,9 @@ size of the input (although the constant factor is not small). See
But brittany is not finished yet, and there are some open issues that yet But brittany is not finished yet, and there are some open issues that yet
require fixing: require fixing:
- **only type-signatures and function/value bindings** are processed; - **only the module header (imports/exports), type-signatures and
other module elements (data-decls, classes, instances, imports/exports etc.) function/value bindings** are processed;
other module elements (data-decls, classes, instances, etc.)
are not transformed in any way; this extends to e.g. **bindings inside class are not transformed in any way; this extends to e.g. **bindings inside class
instance definitions** - they **won't be touched** (yet). instance definitions** - they **won't be touched** (yet).
- By using `ghc-exactprint` as the parser, brittany supports full GHC - By using `ghc-exactprint` as the parser, brittany supports full GHC
@ -47,7 +47,7 @@ require fixing:
You can [paste haskell code over here](https://hexagoxel.de/brittany/) You can [paste haskell code over here](https://hexagoxel.de/brittany/)
to test how it gets formatted by brittany. (Rg. privacy: the server does to test how it gets formatted by brittany. (Rg. privacy: the server does
log the size of the input, but _not_ the full requests.) log the size of the input, but _not_ the full input/output of requests.)
# Other usage notes # Other usage notes

View File

@ -63,7 +63,8 @@ helpDoc = PP.vcat $ List.intersperse
(PP.text "") (PP.text "")
[ parDocW [ parDocW
[ "Reformats one or more haskell modules." [ "Reformats one or more haskell modules."
, "Currently affects only type signatures and function bindings;" , "Currently affects only the module head (imports/exports), type"
, "signatures and function bindings;"
, "everything else is left unmodified." , "everything else is left unmodified."
, "Based on ghc-exactprint, thus (theoretically) supporting all" , "Based on ghc-exactprint, thus (theoretically) supporting all"
, "that ghc does." , "that ghc does."
@ -71,7 +72,7 @@ helpDoc = PP.vcat $ List.intersperse
, parDoc $ "Example invocations:" , parDoc $ "Example invocations:"
, PP.hang (PP.text "") 2 $ PP.vcat , PP.hang (PP.text "") 2 $ PP.vcat
[ PP.text "brittany" [ PP.text "brittany"
, PP.hang (PP.text " ") 2 $ PP.text "read from stdin, output to stdout" , PP.nest 2 $ PP.text "read from stdin, output to stdout"
] ]
, PP.hang (PP.text "") 2 $ PP.vcat , PP.hang (PP.text "") 2 $ PP.vcat
[ PP.text "brittany --indent=4 --write-mode=inplace *.hs" [ PP.text "brittany --indent=4 --write-mode=inplace *.hs"