packages feed

ormolu 0.2.0.0 → 0.9.0.0

raw patch · 615 files changed

This diff is very large; some files are shown as “too large to diff”. Download the raw patch for the complete diff.

Files

CHANGELOG.md view
@@ -1,3 +1,610 @@+## Ormolu 0.9.0.0++* Comments are now attached to the syntax tree by position, before anything+  is printed, rather than by a cursor advanced as the printer walks the+  tree. Which element owns a comment no longer depends on the order in which+  the printer happens to visit things, so comments stop escaping the+  construct they were written in when Ormolu sorts or regroups it: a comment+  inside an import list stays there, a comment after a quasi-quote stops+  floating to the bottom of the file, and a comment attached to an import+  travels with that import when the imports are sorted. [Issue+  1074](https://github.com/tweag/ormolu/issues/1074) and [issue+  1076](https://github.com/tweag/ormolu/issues/1076).++* Haddock comments are now printed as they were written instead of being+  rebuilt from the documentation string GHC parsed out of them. A `{- | …+  -}` stays a block comment rather than becoming `--` lines, an empty `-- |`+  is no longer dropped, and a `{- *** … -}` section heading keeps its+  meaning. [Issue 641](https://github.com/tweag/ormolu/issues/641), [issue+  822](https://github.com/tweag/ormolu/issues/822), and [issue+  1159](https://github.com/tweag/ormolu/issues/1159).++  Ormolu still puts a space after a Haddock's trigger, re-indents a block+  Haddock to line up with the code it documents, and rewrites a trailing `--+  ^ X` as a leading `-- | X` when it moves the comment in front of what it+  documents.++* Backslashes are no longer added to lines in the middle of a comment block,+  where Haddock does not look for a trigger anyway. [Issue+  1131](https://github.com/tweag/ormolu/issues/1131).++* A comment written on its own line in front of an operator no longer+  strands the operator at the start of the next line. In a `do` block that+  changed what the code meant, because `$` at the beginning of a line is+  read as a new statement rather than as a continuation of the previous one.+  [Issue 1028](https://github.com/tweag/ormolu/issues/1028).++* A comment written after `=`, `->`, or a lambda arrow now stays on that+  line instead of being pushed onto the next one, and the result is+  idempotent. `f x = -- note` no longer becomes an `=` stranded on a line of+  its own. [Issue 786](https://github.com/tweag/ormolu/issues/786), [issue+  810](https://github.com/tweag/ormolu/issues/810), and [issue+  936](https://github.com/tweag/ormolu/issues/936).++* Layout decisions now take comments into account. A comment that falls+  inside a construct can no longer be squeezed into a single-line rendering+  of it.++* A comment block that trails a line of code and continues below it no+  longer drops to the start of the line, which could put the rest of the+  block outside the construct it was written in.++* A construct that brackets its contents is no longer put on one line when+  something inside it is documented with a `-- |` Haddock. Such a Haddock+  takes whole lines, so it used to swallow the closing bracket: a documented+  `deriving` clause came out as `deriving (-- | B`, and a documented field+  of a short record as `{-- | …`, which did not even parse. [Issue+  752](https://github.com/tweag/ormolu/issues/752) and [issue+  1164](https://github.com/tweag/ormolu/issues/1164).++  A `{- | … -}` Haddock is self-delimiting and does not force anything, so+  a declaration documented that way is left as it was written rather than+  being broken up: `data A = A {- | a number -} Int Bool` stays on one line+  where it used to be spread over five.++* Only pragmas in the file header are hoisted to the top of the module now.+  A `LANGUAGE` or `OPTIONS_GHC` pragma written after the first import or+  declaration stays where it is, and no longer drags the comments above it+  to the top of the file. GHC reads the header and stops, so such a pragma+  never affected compilation; moving it was giving it an effect it did not+  have. [Issue 1168](https://github.com/tweag/ormolu/issues/1168).++* A comment above a `{-# LANGUAGE A, B #-}` pragma is no longer duplicated+  when the pragma is split into one per extension; it stays with the first.+  [Issue 787](https://github.com/tweag/ormolu/issues/787).++* Ormolu now checks that the comments of the output correspond to the+  comments of the input—none dropped, duplicated, invented, or reordered—and+  refuses to format when they do not. This runs alongside the existing check+  that the AST is unchanged, is disabled by `--unsafe`, and costs nothing+  extra: the printer already records where it put each comment.++## Ormolu 0.8.2.0++* Overhaul how operator fixity information is collected. In addition to the+  Hoogle database, Ormolu now parses the sources of a curated set of important+  packages directly, which yields more accurate and complete fixity data than+  before. In particular it recovers fixities for operators re-exported through+  umbrella modules (e.g. `Servant.API`, `Control.Lens`) that recent Hoogle+  databases no longer record. As a result, formatting of operator chains is+  improved out of the box, and users should expect some operator-heavy code to+  be laid out differently (and more correctly) than in previous releases.++* Improve the layout of chains of `infixr 0` operators (`$`, `seq`, `?:`, and+  the like). Such operators are only laid out in the trailing "staircase" style+  when it is warranted: either the chain consists of a single operator, or its+  final operand is a hanging construct (a `do` block, lambda, `case`, etc.). A+  chain of several such operators that ends in an ordinary expression is now+  laid out with the operators in the leading position instead of an+  ever-deepening pyramid. [Issue+  1151](https://github.com/tweag/ormolu/issues/1151).++* Do not crash when a parent directory cannot be read due to insufficient+  permissions while searching for configuration files; the search for+  configuration files is stopped at that point instead. [Issue+  1212](https://github.com/tweag/ormolu/issues/1212).++* Preserve blank lines between blocks in layout contexts (`where`, `do`,+  `let`) when the preceding block ends with a trailing comment. [Issue+  1132](https://github.com/tweag/ormolu/issues/1132).++* Fix printing of single line export lists with inlined Haddock comments.+  [Issue 1051](https://github.com/tweag/ormolu/issues/1051).++* Fix preservation of the position of comments around the `where` keyword.+  [Issue 784](https://github.com/tweag/ormolu/issues/784).++* Do not sort `Prelude` to the end of the import list when the+  `NoImplicitPrelude` extension is enabled; instead sort it like any other+  import. [Issue 1189](https://github.com/tweag/ormolu/issues/1189).++## Ormolu 0.8.1.1++* Add missing braces for case expressions in single‑line do blocks. [Issue+  1180](https://github.com/tweag/ormolu/issues/1180).++* Fix the import grouping logic in the presence of imports with explicit+  levels. [Issue 1192](https://github.com/tweag/ormolu/issues/1192).++## Ormolu 0.8.1.0++* Fix printing of guards on pattern binds. [Issue+  1178](https://github.com/tweag/ormolu/issues/1178).++* Switched to `ghc-lib-parser-9.14`, with the following new syntactic features:+   * GHC proposal [#493](https://github.com/ghc-proposals/ghc-proposals/blob/e2c683698323cec3e33625369ae2b5f585387c70/proposals/0493-specialise-expressions.rst): expressions in SPECIALISE pragmas+   * Multiline strings in foreign import declarations.+   * `ExplicitNamespaces` supports the `data` namespace specifier in import and export lists, replacing `pattern`.+   * `LinearTypes` adds new syntax to support non-linear record fields.+   * `RequiredTypeArguments` allows visible forall in GADT syntax.++* Updated to `Cabal-syntax-3.16`.++* Correctly format string literals containing the `\^\` escape sequence. [Issue+  1165](https://github.com/tweag/ormolu/issues/1165).++* Correctly preserve consecutive blank lines in multiline strings. [Issue+  1194](https://github.com/tweag/ormolu/issues/1194).++* Fix printing of multi-line or-patterns inside as-patterns. [Issue+  1183](https://github.com/tweag/ormolu/issues/1183).++* Fix an issue where or-patterns would be indented twice. [Issue+  1188](https://github.com/tweag/ormolu/issues/1188).++* Add support for `ExplicitLevelImports`. [Issue+  1192](https://github.com/tweag/ormolu/issues/1192).++## Ormolu 0.8.0.2++* Fix a performance regression introduced in 0.8.0.0. [Issue+  1176](https://github.com/tweag/ormolu/issues/1176).++## Ormolu 0.8.0.1++* Correctly format edge cases where fully collapsing string gaps changes the+  string represented by a string literal. [Issue+  1160](https://github.com/tweag/ormolu/issues/1160).++* Fix false positives in AST diffing in fixity declarations with implicit+  fixity, such as `infix +`. [Issue+  1166](https://github.com/tweag/ormolu/issues/1166).++* Make multiline function signatures in RequiredTypeArguments consistent with+  types [PR 1170](https://github.com/tweag/ormolu/pull/1170).++* Correctly format single-line `MultiWayIf`s. [Issue+  1171](https://github.com/tweag/ormolu/issues/1171).++## Ormolu 0.8.0.0++* Format multiple files in parallel. [Issue+  1128](https://github.com/tweag/ormolu/issues/1128).++* Fractional precedences are now allowed in `.ormolu` files for more precise+  control over formatting of complex operator chains. [Issue+  1106](https://github.com/tweag/ormolu/issues/1106).++* Correctly format type applications of `QuasiQuotes`. [Issue+  1134](https://github.com/tweag/ormolu/issues/1134).++* Correctly format multi-line parentheses in arrow `do` blocks. [Issue+  1144](https://github.com/tweag/ormolu/issues/1144).++* Switched to `ghc-lib-parser-9.12`, with the following new syntactic features:+   * GHC proposal [#522](https://github.com/ghc-proposals/ghc-proposals/blob/c9401f037cb22d1661931b2ec621925101052997/proposals/0522-or-patterns.rst): `OrPatterns` (enabled by default)+   * GHC proposal [#569](https://github.com/ghc-proposals/ghc-proposals/blob/c9401f037cb22d1661931b2ec621925101052997/proposals/0569-multiline-strings.rst): `MultilineStrings` (disabled by default)+   * GHC proposal [#409](https://github.com/ghc-proposals/ghc-proposals/blob/f79438cf8dbfcd90187f7af3a380515ffe45dbdc/proposals/0409-exportable-named-default.rst): `NamedDefaults` (enabled by default)+   * GHC proposal [#281](https://github.com/ghc-proposals/ghc-proposals/blob/c9401f037cb22d1661931b2ec621925101052997/proposals/0281-visible-forall.rst): accept more types in terms: `forall` quantifications, constraint arrows `=>`, type arrows `->` (enabled by default)+   * Part of GHC proposal [#425](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0425-decl-invis-binders.rst): wildcard binders (enabled by default)++* Correctly format non-promoted type-level tuples with `NoListTuplePuns`. [Issue+  1146](https://github.com/tweag/ormolu/issues/1146).++* Updated to `Cabal-syntax-3.14`. [Issue+  1152](https://github.com/tweag/ormolu/issues/1152).++## Ormolu 0.7.7.0++* Use single-line layout for parens around single-line content. [Issue+  1120](https://github.com/tweag/ormolu/issues/1120).++* Allow function arguments to be on the same line even if the full type+  (with constraints and foralls) are on multiple lines. [PR+  1125](https://github.com/tweag/ormolu/pull/1125).++## Ormolu 0.7.6.0++* Fix Haddock comments on infix constructors. [Issue+  758](https://github.com/tweag/ormolu/issues/758).++* Don't require a trailing newline in `.ormolu` files. [Issue+  1122](https://github.com/tweag/ormolu/issues/1122).++* Remove unnecessary indentation from list comprehensions. [Issue+  966](https://github.com/tweag/ormolu/issues/966).++## Ormolu 0.7.5.0++* Switched to `ghc-lib-parser-9.10`, with the following new syntactic features/behaviors:+  * GHC proposal [#575](https://github.com/ghc-proposals/ghc-proposals/blob/10290a668608d608c3f6c6010be265cf7a02e1fc/proposals/0575-deprecated-instances.rst): deprecated instances.+  * GHC proposal [#281](https://github.com/ghc-proposals/ghc-proposals/blob/10290a668608d608c3f6c6010be265cf7a02e1fc/proposals/0281-visible-forall.rst): visible forall in types of terms.+    Enabled by `RequiredTypeArguments` (enabled by default).+  * `LinearTypes`: `let` and `where` bindings can now be linear, in particular have multiplicity annotations.+  * Using `forall` as an identifier is now a parse error.+  * GHC proposal [#65](https://github.com/ghc-proposals/ghc-proposals/blob/10290a668608d608c3f6c6010be265cf7a02e1fc/proposals/0065-type-infix.rst): namespacing fixity declarations for type names and WARNING/DEPRECATED pragmas.+  * `TypeAbstractions` now supports `@`-binders in lambdas and function equations.+  * Support for the `GHC2024` language.++* Updated to `Cabal-syntax-3.12`.++## Ormolu 0.7.4.0++* Don't error when the `JavaScriptFFI` language pragma is present. [Issue+  1087](https://github.com/tweag/ormolu/issues/1087).+* Improve comment placement in if-then-else blocks. [Issue+  998](https://github.com/tweag/ormolu/issues/998).+* Now command line options for fixity overrides and module re-exports+  overwrite information from `.ormolu` files. [Issue+  1030](https://github.com/tweag/ormolu/issues/1030).+* Respect newlines in data declarations in more cases. [Issue+  1077](https://github.com/tweag/ormolu/issues/1077) and [issue+  947](https://github.com/tweag/ormolu/issues/947).+* The `-d / --debug` command line option now makes Ormolu print out debug+  information regarding operator fixity inference. [Issue+  1060](https://github.com/tweag/ormolu/issues/1060).++## Ormolu 0.7.3.0++* Switched to `ghc-lib-parser-9.8`, with the following new syntactic features:+  * `ExtendedLiterals`: `123#Int8` is a literal of type `Int8#`. (disabled by+    default)+  * `TypeAbstractions`: `@k`-binders in data type declarations (enabled by+    default)+  * GHC proposal [#134](https://github.com/ghc-proposals/ghc-proposals/blob/0b652bd70258e354dfe4a05940182007596f8bf7/proposals/0134-deprecating-exports-proposal.rst): deprecating/warning about exports+  * GHC proposal [#541](https://github.com/ghc-proposals/ghc-proposals/blob/0b652bd70258e354dfe4a05940182007596f8bf7/proposals/0541-warning-pragmas-with-categories.rst): warning categories++## Ormolu 0.7.2.0++* Preserve necessary braces for final function arguments. [Issue+  1044](https://github.com/tweag/ormolu/issues/1044).++* Put `"this"` `PackageImports` at the end. [Issue+  1048](https://github.com/tweag/ormolu/issues/1048).++* Format parenthesized operators starting with a `#` correctly in the presence+  of `UnboxedSums`. [Issue 1062](https://github.com/tweag/ormolu/issues/1062).++* Fix false positives in AST diffing related to empty Haddock comments in data+  declarations. [Issue 1065](https://github.com/tweag/ormolu/issues/1065).++## Ormolu 0.7.1.0++* Include `base` fixity information when formatting a Haskell file that's+  not mentioned in an existing cabal file. [Issue+  1032](https://github.com/tweag/ormolu/issues/1032)++* Update `displayException` for `OrmoluException` to pretty print the+  exception. [PR 1031](https://github.com/tweag/ormolu/pull/1031).++* Ormolu is now aware of more common module re-exports by default.++* Support explicit mention of target package name in module re-exports. Even+  if the exported package is not specified as a direct dependency of the+  component being formatted it will still be taken into account correctly.+  [Issue 1037](https://github.com/tweag/ormolu/issues/1037).++* Ormolu no longer fails when CPP directly follows the import section (a+  regression introduced in 0.7.0.0). [Issue+  1040](https://github.com/tweag/ormolu/issues/1040).++## Ormolu 0.7.0.0++* Inference of operator fixity information is now more precise and takes+  into account the import section of the module being formatted. [Issue+  892](https://github.com/tweag/ormolu/issues/892) and [issue+  929](https://github.com/tweag/ormolu/issues/929).++* Ormolu can now be made aware of module re-exports through either special+  declarations in `.ormolu` files (see the readme for a description of the+  syntax), or on the command line with the `--reexport`/`-r` option. [Issue+  1017](https://github.com/tweag/ormolu/issues/1017).++* Ormolu now looks for `.ormolu` files independently of `.cabal` files. This+  means that it is now possible to have one `.ormolu` file for multiple+  Cabal packages. [Issue 1019](https://github.com/tweag/ormolu/issues/1019).++* Consistently format `do` blocks/`case`s/`MultiWayIf`s with 4 spaces if and+  only if they occur as the applicand. [Issue+  1002](https://github.com/tweag/ormolu/issues/1002) and [issue+  730](https://github.com/tweag/ormolu/issues/730).++* Support the (deprecated) `DatatypeContexts` extension to avoid surprises.+  [Issue 1012](https://github.com/tweag/ormolu/issues/1012).++* Don't let comments escape from empty export lists. [Issue+  906](https://github.com/tweag/ormolu/issues/906).++* Format `\cases` with multiple patterns across multiple lines correctly. [Issue+  1025](https://github.com/tweag/ormolu/issues/1025).++## Ormolu 0.6.0.1++* Fix false positives in AST diffing related to `UnicodeSyntax`. [PR+  1009](https://github.com/tweag/ormolu/pull/1009).++## Ormolu 0.6.0.0++* Haddocks attached to arguments of a data constructor are now formatted in+  the pipe style (rather than the caret style), consistent with everything+  else. As a consequence, now Ormolu's output will be deemed invalid by the+  Haddock shipped with GHC <9.0. [Issue+  844](https://github.com/tweag/ormolu/issues/844) and [issue+  828](https://github.com/tweag/ormolu/issues/828).++* Insert space before char literals in ticked promoted constructs when+  necessary. [Issue 1000](https://github.com/tweag/ormolu/issues/1000).++* Switched to `ghc-lib-parser-9.6`:+  * Extended `OverloadedLabels`: `#Foo`, `#3`, `#"Hello there"`.++    Also, it is now disabled by default, as it causes e.g. `a#b` to be parsed+    differently.+  * New extension: `TypeData`, enabled by default.+  * Parse errors now include error codes, cf. https://errors.haskell.org.++* Updated to `Cabal-syntax-3.10`.++* Now whenever Ormolu fails to parse a `.cabal` file it also explains why.+  [PR 999](https://github.com/tweag/ormolu/pull/999).++## Ormolu 0.5.3.0++* Stop making empty `let`s move comments. [Issue+  917](https://github.com/tweag/ormolu/issues/917).++* Now `.ormolu` fixity override files can use both LF and CRLF line endings.+  [PR 969](https://github.com/tweag/ormolu/pull/969).++* Normalize parentheses around constraints. [Issue+  264](https://github.com/tweag/ormolu/issues/264).++* The `ormolu` function now consumes `Text` instead of `String` due to an+  internal refactoring.++* Exposed a more complete public API in the `Ormolu` module. The API is+  supposed to be stable and change according to+  [PVP](https://pvp.haskell.org/).++* Now warnings regarding Ormolu not being able to find `.cabal` files or+  finding such files but them not mentioning the source file in question are+  only displayed when `--debug` is used. Printing the warnings by default+  seems to have been confusing, see e.g. [Issue+  971](https://github.com/tweag/ormolu/issues/971) and [issue+  924](https://github.com/tweag/ormolu/issues/924).++## Ormolu 0.5.2.0++* Eliminated the `fixity-th` Cabal flag because it caused issues on GHC 9.4 as+  well as on aarch64. See [issue+  941](https://github.com/tweag/ormolu/issues/941) and [issue+  927](https://github.com/tweag/ormolu/issues/927).++* Now operators without explicitly specified fixity default to left+  associativity and highest precedence. [Issue+  907](https://github.com/tweag/ormolu/issues/907).++## Ormolu 0.5.1.0++* Imports are now sorted by package qualifier, if one is present.+  [Issue 905](https://github.com/tweag/ormolu/issues/905).++* Extension packs like `GHC2021` and `Haskell2010` are now bumped to the top of+  the list of language pragmas. [Issue+  922](https://github.com/tweag/ormolu/issues/922).++* Fix formatting of `SCC` pragmas in `do` blocks. [Issue+  925](https://github.com/tweag/ormolu/issues/925).++* Support type applications in patterns. [Issue+  930](https://github.com/tweag/ormolu/issues/930).++* Handle `UnicodeSyntax` variants more consistently. [Issue+  934](https://github.com/tweag/ormolu/issues/934).++* Fix an inconsistency in formatting of types in GADT declarations in+  certain cases. [PR 932](https://github.com/tweag/ormolu/pull/932).++* Switched to `ghc-lib-parser-9.4`, which brings support for the following new+  syntactic features:+  * `\cases` via `LambdaCase`+  * `OPAQUE` pragmas+  * Unboxed sum type constructors like `(# | #)`.++* Updated to `Cabal-syntax-3.8`, supporting `cabal-version: 3.8`.++## Ormolu 0.5.0.1++* Fix a bug in the diff printing functionality. [Issue+  886](https://github.com/tweag/ormolu/issues/886).++* Indent closing bracket for list comprehensions in `do` blocks.+  [Issue 893](https://github.com/tweag/ormolu/issues/893).++* Fix `hs-source-dirs: .` resulting in failing to find a `.cabal` file for a+  Haskell source file. [Issue 909](https://github.com/tweag/ormolu/issues/909).++* Comments in closed type family declarations are now indented correctly.+  [Issue 913](https://github.com/tweag/ormolu/issues/913).++* Cache `.cabal` file parsing and processing when given multiple input files in+  the same project. This results in dramatic speedups on projects which have+  both huge `.cabal` files and a large number of individual modules. [Issue+  897](https://github.com/tweag/ormolu/issues/897).++## Ormolu 0.5.0.0++* Changed the way operator fixities and precedences are inferred.+  * Ormolu now tries to locate `.cabal` files of source files by default and+    in addition to default extensions it also infers the list of+    dependencies.+  * Ormolu comes equipped with extensive knowledge of all packages on+    Hackage and operators that those packages define. Knowing the names of+    the dependencies it can select the right fixity and precedence info from+    its knowledge base.+  * You can ask Ormolu not to look for `.cabal` files by using the+    `--no-cabal` switch.+  * Dependencies can be selected manually by using the `-p / --package`+    option (can be repeated many times).+  * The default heuristic algorithm will still try to guess the right+    fixities and precedence.+  * Fixity overrides can be provided by the user in the familiar Haskell+    notation (e.g. `infixr 9 .`, one declaration per line). They are loaded+    by default from the `.ormolu` file that is expected to be in the same+    directory as the `.cabal` file of a given source file. However, if+    `--no-cabal` is supplied, the `.ormolu` file will not be looked for either.+    Fixity declarations can be also provided by using the `-f / --fixity`+    command line option, which see.+  * This resolves the following issues: [Issue+    826](https://github.com/tweag/ormolu/issues/826), [Issue+    785](https://github.com/tweag/ormolu/issues/785), [Issue+    690](https://github.com/tweag/ormolu/issues/690), [Issue+    825](https://github.com/tweag/ormolu/issues/825).++* Invalid haddock comments are formatted in a more consistent way. Leading+  haddock triggers (`|`, `^`) in an invalid haddock comment block are now+  escaped with a backslash `\`. [Issue+  816](https://github.com/tweag/ormolu/issues/816).++* Type synonyms and families are now formatted correctly when the equals sign+  is preceded by a comment. [Issue 829](+  https://github.com/tweag/ormolu/issues/829).++* Bidirectional pattern synonyms are formatted nicer in certain cases.+  [Issue 843](https://github.com/tweag/ormolu/issues/843).++* Magic comments (like `{- ORMOLU_DISABLED -}`) now allow arbitrary+  succeeding text. This fixes use cases like [Issue+  856](https://github.com/tweag/ormolu/issues/856).++* Remove discrepancies between unboxed types and terms. [Issue 856+  ](https://github.com/tweag/ormolu/issues/856).+  * Unboxed sum types are now formatted with a space before each `|`.+  * Unboxed unit tuples on type and value levels are formatted as `(# #)`.++* Errors caused by AST differences now print before/after diffs.+  [Issue 877](https://github.com/tweag/ormolu/issues/877).++* Improved formatting of data declarations in the case of single-constructor+  record with a Haddock. [Issue+  881](https://github.com/tweag/ormolu/issues/881).++## Ormolu 0.4.0.0++* When a guard is located on its own line, the body associated with this+  guard is indented by one extra level, so that it can easily be+  distinguished from the guard predicate or pattern. [Issue+  806](https://github.com/tweag/ormolu/issues/806).++* Now a space is forced after `--` in line comments. [Issue+  808](https://github.com/tweag/ormolu/issues/808).++* Allow formatting Backpack signature files (`.hsig`). The switch between+  regular module mode and signature mode is based on the file extension by+  default, but can be overridden with the `-t / --source-type` command line+  option. [Issue 600](https://github.com/tweag/ormolu/issues/600).++* Blank Haddock comments are now eliminated. This also fixes issues with+  differing ASTs in some special cases. [Issue+  726](https://github.com/tweag/ormolu/issues/726).++* Rewrite rules that are never active are now formatted correctly.+  [Issue 823](https://github.com/tweag/ormolu/issues/823).++* Promoted infix data constructors are now formatted correctly. [Issue 768](+  https://github.com/tweag/ormolu/issues/768).++* Switched to `ghc-lib-parser-9.2`.+  [Issue 794](https://github.com/tweag/ormolu/issues/794).+   * Support for the new syntax-related language extensions:+     `OverloadedRecordDot` and `OverloadedRecordUpdate`+     (disabled by default).+     [Issue 709](https://github.com/tweag/ormolu/issues/709).+   * Removed support for `record-dot-preprocessor`. For the getter syntax,+     consider using `OverloadedRecordDot` instead. [Issue+     659](https://github.com/tweag/ormolu/issues/659). [Issue+     705](https://github.com/tweag/ormolu/issues/705).+   * Support for the `GHC2021` language.++## Ormolu 0.3.1.0++* Allow check mode when working with stdin input. [Issue 634](+  https://github.com/tweag/ormolu/issues/634).++* Now guards are printed on a new line if at least one guard is multiline or+  if all guards together occupy more than one line. The body of each guard+  is also indented one level deeper in that case. [Issue+  712](https://github.com/tweag/ormolu/issues/712).++* Invalid Haddock comments are no longer silently deleted, but rather converted+  into regular comments. [Issue 474](https://github.com/tweag/ormolu/issues/474).++## Ormolu 0.3.0.1++* Improvements to `.cabal` file handling:+   * When looking for a `.cabal` file, directories were previously+     erroneously also considered. [Issue 781](+     https://github.com/tweag/ormolu/issues/781).+   * We now print a note if Ormolu was told to consider+     `.cabal` files, but no suitable one could be found.+   * Handle an empty `hs-source-dirs` correctly.+   * Also consider modules which are only conditionally listed+     in the `.cabal` file.++* The special handling of CPP is now only applied if CPP is+  actually enabled. [Issue 782](https://github.com/tweag/ormolu/issues/782).++* The left hand side of the `:` operator now uses braces if+  necessary. [Issue 780](https://github.com/tweag/ormolu/issues/780).++## Ormolu 0.3.0.0++* Data declarations with multiline kind signatures are now formatted+  correctly. [Issue 749](https://github.com/tweag/ormolu/issues/749).++* Infix arrow command formations are formatted like usual operators.+  This fixes [Issue 748](https://github.com/tweag/ormolu/issues/748).++* `do` arrow commands are formatted more flexibly. Fixes [Issue+  753](https://github.com/tweag/ormolu/issues/753).++* Source code is always read and written using UTF8 and ignoring the native+  line ending conventions. [Issue+  717](https://github.com/tweag/ormolu/issues/717).++* Opt-in support to respect default-extensions and default-language+  from .cabal files. [Issue 517](https://github.com/tweag/ormolu/issues/517).++* Empty case expressions are now rendered with braces. [Issue+  765](https://github.com/tweag/ormolu/issues/765).++* Omit braces on repeated application of `do` blocks. [Issue+  735](https://github.com/tweag/ormolu/issues/735).++* Improved handling of disabled regions. [PR 773](+  https://github.com/tweag/ormolu/pull/773).+   * Disabled regions are now exactly preserved, in particular+     empty lines and trailing spaces. [Issue+     673](https://github.com/tweag/ormolu/issues/673).+   * Strings like `-}` can now be present in disabled regions.+     [Issue 708](https://github.com/tweag/ormolu/issues/708).++  This means that using CPP or magic comments in certain ways which+  were only supported as a side effect previously (like in+  [Issue 601](https://github.com/tweag/ormolu/issues/601))+  will now result in formatting failures. Also see [Issue 774](+  https://github.com/tweag/ormolu/issues/774).+ ## Ormolu 0.2.0.0  * Now standalone kind signatures are grouped with type synonyms. [Issue@@ -54,7 +661,7 @@   Previously, if an extension was disabled via the CLI, it could not be   re-enabled per file. -* `LexicalNegation` is no longer enabled by default. Also, spaces after+* `NegativeLiterals` is no longer enabled by default. Also, spaces after   negation via `-` are removed where possible. [Issue   694](https://github.com/tweag/ormolu/issues/694). @@ -64,9 +671,10 @@ * Added support for left-to-right arrow application. [Issue   737](https://github.com/tweag/ormolu/issues/737). -* Now `--mode check` fails on missing trailing blank lines.+* Now `--mode check` fails on missing trailing blank lines. [Issue+  743](https://github.com/tweag/ormolu/issues/743). -* Fixed indentation of arrow forms in do blocks. [Issue+* Fix indentation of arrow forms in do blocks. [Issue   739](https://github.com/tweag/ormolu/issues/739).  ## Ormolu 0.1.4.1@@ -79,7 +687,7 @@ * Added support for monad comprehensions. [Issue   665](https://github.com/tweag/ormolu/issues/665). -* Fixed a bug when a space was inserted in front of promoted types even when+* Fix a bug when a space was inserted in front of promoted types even when   it wasn't strictly necessary. [Issue   668](https://github.com/tweag/ormolu/issues/668). @@ -89,7 +697,7 @@  ## Ormolu 0.1.3.1 -* Fixed a problem with multiline record updates using the record dot+* Fix a problem with multiline record updates using the record dot   preprocessor. [Issue 658](https://github.com/tweag/ormolu/issues/658).  ## Ormolu 0.1.3.0@@ -105,7 +713,7 @@  ## Ormolu 0.1.2.0 -* Fixed the bug when comments in different styles got glued together after+* Fix the bug when comments in different styles got glued together after   formatting. [Issue 589](https://github.com/tweag/ormolu/issues/589).  * Added `-i` as a shortcut for `--mode inplace`. [Issue@@ -130,48 +738,48 @@ * Improved sorting of operators in imports. [Issue   602](https://github.com/tweag/ormolu/issues/602). -* Fixed a bug related to trailing space in multiline comments in certain+* Fix a bug related to trailing space in multiline comments in certain   cases. [Issue 603](https://github.com/tweag/ormolu/issues/602).  * Added support for formatting linked lists with `(:)` as line terminator.   [Issue 478](https://github.com/tweag/ormolu/issues/478). -* Fixed rendering of function arguments in multiline layout. [Issue+* Fix rendering of function arguments in multiline layout. [Issue   609](https://github.com/tweag/ormolu/issues/609).  * Blank lines between definitions in `let` and `while` bindings are now   preserved. [Issue 554](https://github.com/tweag/ormolu/issues/554). -* Fixed the bug when type applications stuck to the `$` of TH splices that+* Fix the bug when type applications stuck to the `$` of TH splices that   followed them. [Issue 613](https://github.com/tweag/ormolu/issues/613).  * Improved region formatting so that indented fragments—such as definitions   inside of `where` clauses—can be formatted. [Issue   572](https://github.com/tweag/ormolu/issues/572). -* Fixed the bug related to the de-association of pragma comments. [Issue+* Fix the bug related to the de-association of pragma comments. [Issue   619](https://github.com/tweag/ormolu/issues/619).  ## Ormolu 0.1.0.0 -* Fixed rendering of type signatures concerning several identifiers. [Issue+* Fix rendering of type signatures concerning several identifiers. [Issue   566](https://github.com/tweag/ormolu/issues/566). -* Fixed an idempotence issue with inline comments in tuples and parentheses.+* Fix an idempotence issue with inline comments in tuples and parentheses.   [Issue 450](https://github.com/tweag/ormolu/issues/450). -* Fixed an idempotence issue when certain comments were picked up as+* Fix an idempotence issue when certain comments were picked up as   “continuation” of a series of comments [Issue   449](https://github.com/tweag/ormolu/issues/449). -* Fixed an idempotence issue related to different indentation levels in a+* Fix an idempotence issue related to different indentation levels in a   comment series. [Issue 512](https://github.com/tweag/ormolu/issues/512). -* Fixed an idempotence issue related to comments which may happen to be+* Fix an idempotence issue related to comments which may happen to be   separated from the elements they are attached to by the equality sign.   [Issue 340](https://github.com/tweag/ormolu/issues/340). -* Fixed an idempotence issue with type synonym and data declarations where+* Fix an idempotence issue with type synonym and data declarations where   the type has a Haddock. [Issue   578](https://github.com/tweag/ormolu/issues/578). @@ -179,17 +787,17 @@   multiple blank lines in a row. [Issue   518](https://github.com/tweag/ormolu/issues/518). -* Fixed rendering of comments around if expressions. [Issue+* Fix rendering of comments around if expressions. [Issue   458](https://github.com/tweag/ormolu/issues/458).  * Unnamed fields of data constructors are now documented using the `-- ^`   syntax. [Issue 445](https://github.com/tweag/ormolu/issues/445) and [Issue   428](https://github.com/tweag/ormolu/issues/428). -* Fixed non-idempotent transformation of partly documented data definition.+* Fix non-idempotent transformation of partly documented data definition.   [Issue 590](https://github.com/tweag/ormolu/issues/590). -* Fixed an idempotence issue related to operators. [Issue+* Fix an idempotence issue related to operators. [Issue   522](https://github.com/tweag/ormolu/issues/522).  * Renamed the `--check-idempotency` flag to `--check-idempotence`.@@ -216,7 +824,7 @@   select a region to format. [Issue   516](https://github.com/tweag/ormolu/issues/516). -* Fixed rendering of module headers in the presence of preceding comments or+* Fix rendering of module headers in the presence of preceding comments or   Haddocks. [Issue 561](https://github.com/tweag/ormolu/issues/561).  ## Ormolu 0.0.4.0@@ -237,7 +845,7 @@   now put on its own line. [Issue   509](https://github.com/tweag/ormolu/issues/509). -* Fixed the bug pertaining to rendering of arrow notation with multiline+* Fix the bug pertaining to rendering of arrow notation with multiline   expressions. [Issue 513](https://github.com/tweag/ormolu/issues/513).  * Made rendering of data type definitions, value-level applications, and@@ -255,15 +863,15 @@  ## Ormolu 0.0.3.1 -* Fixed rendering of record updates with the record dot preprocessor syntax+* Fix rendering of record updates with the record dot preprocessor syntax   [Issue 498](https://github.com/tweag/ormolu/issues/498).  ## Ormolu 0.0.3.0 -* Fixed an issue related to unnecessary use of curly braces. [Issue+* Fix an issue related to unnecessary use of curly braces. [Issue   473](https://github.com/tweag/ormolu/issues/473). -* Fixed the issue with formatting multi-way if when it happens to be a+* Fix the issue with formatting multi-way if when it happens to be a   function applied to arguments [Issue   488](https://github.com/tweag/ormolu/issues/488). This changed the way   multi-line if is formatted in general.@@ -275,7 +883,7 @@   potentially-hanging consturctions in the presence of comments. [Issue   447](https://github.com/tweag/ormolu/issues/447). -* Fixed indentation in presence of type applications. [Issue+* Fix indentation in presence of type applications. [Issue   493](https://github.com/tweag/ormolu/issues/493).  * Class and instance declarations now do not have a blank line after@@ -293,20 +901,20 @@ * Now unrecognized GHC options passed with `--ghc-opt` cause Ormolu to fail   (exit code 7). -* Fixed formatting of result type in closed type families. See [issue+* Fix formatting of result type in closed type families. See [issue   420](https://github.com/tweag/ormolu/issues/420). -* Fixed a minor inconsistency between formatting of normal and foreign type+* Fix a minor inconsistency between formatting of normal and foreign type   signatures. See [issue 408](https://github.com/tweag/ormolu/issues/408). -* Fixed a bug when comment before module header with Haddock was moved+* Fix a bug when comment before module header with Haddock was moved   inside the export list. See [issue   430](https://github.com/tweag/ormolu/issues/430).  * Empty `forall`s are now correctly preserved. See [issue   429](https://github.com/tweag/ormolu/issues/429). -* Fixed [issue 446](https://github.com/tweag/ormolu/issues/446), which+* Fix [issue 446](https://github.com/tweag/ormolu/issues/446), which   involved braces and operators.  * When there are comments between preceding Haddock (pipe-style) and its@@ -326,7 +934,7 @@ * Sorting language pragmas cannot not change meaning of the input program   anymore. [Issue 404](https://github.com/tweag/ormolu/issues/404). -* Fixed formatting of applications where function is a complex expression.+* Fix formatting of applications where function is a complex expression.   [Issue 444](https://github.com/tweag/ormolu/issues/444).  ## Ormolu 0.0.1.0
CONTRIBUTING.md view
@@ -1,64 +1,52 @@ # Contributing -Issues (bugs, feature requests or otherwise feedback) may be reported in-[the GitHub issue tracker for this project][issues]. Pull requests are also+Issues (bugs, feature requests, or other feedback) may be reported in [the+GitHub issue tracker for this project][issues]. Pull requests are also welcome.  When contributing to this repository, please first discuss the change you wish to make via an issue, unless it's entirely trivial (typo fixes, etc.). If there is already an issue that describes the change you have in mind,-comment on it indicating that you're going to work on that. This way we can-avoid the situation when several people work on the same thing.+comment on it to indicate that you're going to work on it. This way we can+avoid situations where several people work on the same thing. -Please make sure that all non-trivial changes are described in commit+Please make sure that all non-trivial changes are described in the commit messages and PR descriptions. -## What to hack on?--* [Fixing bugs][bugs]. This is the main focus right now.--### Testing+## Testing -Testing has been taken good care of and now it amounts to just adding-examples under `data/examples`. Each example is a pair of files:-`<example-name>.hs` for input and `<example-name>-out.hs` for corresponding-expected output.+Testing is well taken care of, so it usually amounts to just adding examples+under `data/examples`. Each example is a pair of files: `<example-name>.hs`+for the input and `<example-name>-out.hs` for the corresponding expected+output. -Testing is performed as following:+Testing is performed as follows: -* Given snippet of source code is parsed and pretty-printed.-* The result of printing is parsed back again and the AST is compared to the-  AST obtained from the original file. They should match.-* The output of printer is checked against the expected output.-* Idempotence property is verified: formatting already formatted code+* The given snippet of source code is parsed and pretty-printed.+* The result of printing is parsed again, and its AST is compared to the AST+  obtained from the original file. The two should match.+* The output of the printer is checked against the expected output.+* The idempotence property is verified: formatting already formatted code   results in exactly the same output. -Examples can be organized in sub-directories, see the existing ones for+Examples can be organized into sub-directories; see the existing ones for inspiration. -Please note that we try to keep individual files at most 25 lines long-because otherwise it's hard to figure out want went wrong when a test fails.--## CI--We use Circle CI. Some outside contributors may have problems, as in, CI-won't run for PRs opened from forks with “unauthorized” errors. In that case-the best we can do is to add you as a contributor or to restart your build-manually.+Please note that we try to keep individual files at most 25 lines long,+because otherwise it's hard to figure out what went wrong when a test fails. -If you have been added as a contributor but the builds still do not start,-try clicking+To regenerate outputs that have changed, you can set the+`ORMOLU_REGENERATE_EXAMPLES` environment variable before running tests. -```-User settings -> Account integrations -> Refresh permissions-```+## Formatting -in Circle CI app.+ - Use the `nix run .#format` script to format Ormolu with the current+   version of Ormolu. -## Formatting+ - Additional formatters are configured via a pre-commit hook, which is+   installed automatically when you enter the Nix shell. You can also run it+   via `pre-commit run` or `pre-commit run -a`. -Use `format.sh` script to format Ormolu with current version of Ormolu. If-Ormolu is not formatted like this, the CI will fail.+If Ormolu is not formatted this way, CI will fail. -[issues]: https://github.com/tweag/ormolu/issues-[bugs]: https://github.com/tweag/ormolu/issues?q=is%3Aissue+is%3Aopen+label%3Abug+[issues]: https://github.com/mrkkrp/ormolu/issues
DESIGN.md view
@@ -19,10 +19,10 @@     * [Why not contribute to/fork Hindent or Brittany?](#why-not-contribute-tofork-hindent-or-brittany) * [Examples](#examples) -This document describes design of a new formatter for Haskell source code.+This document describes the design of a new formatter for Haskell source code. It also includes recommendations for future implementers. -We set for the following goals (mostly taken from+We set the following goals (mostly taken from [brittany](https://github.com/lspitzner/brittany)): * Preserve the meaning of the formatted functions when no CPP is used; * Make reasonable use of screen space;@@ -38,12 +38,12 @@ ### Brittany  [Brittany][brittany] builds on top of [`ghc-exactprint`][ghc-exactprint]—a-library that uses parser of GHC itself for parsing and thus it guarantees-that at least parsing phase is bug-free (which is admittedly the cause of-majority of bugs in other projects, see below).+library that uses the parser of GHC itself for parsing and thus it guarantees+that at least the parsing phase is bug-free (which is admittedly the cause of+the majority of bugs in other projects, see below). -After parsing, Haskell AST and a collection of annotations are available.-The annotations are there because Haskell AST doesn't provide enough+After parsing, the Haskell AST and a collection of annotations are available.+The annotations are there because the Haskell AST doesn't provide enough information to reconstruct source code (for example it doesn't include comments). The AST and the annotations are converted into a `BriDoc` value. A `BriDoc` value is a document representation like the `Doc` from the@@ -65,13 +65,13 @@ of which fit in linear space. So care is necessary to keep memory bounded. -The compexities of the `BriDoc` structure, together with the lack of+The complexities of the `BriDoc` structure, together with the lack of documentation, make Brittany at least challenging to maintain.  ### Hindent  [Hindent][hindent] uses [`haskell-src-exts`][haskell-src-exts] for parsing-like all older projects. `haskell-src-exts` does not use parser of GHC+like all older projects. `haskell-src-exts` does not use the parser of GHC itself, and is a source of endless parsing bugs. `Hindent` is affected by these upstream issues as well as Stylish Haskell and Haskell formatter (see below). This already makes all these projects unusable with some valid@@ -83,13 +83,13 @@ that the 70-80% of what the code does is a printing traversal.  Hindent code is easier to read and debug. Pretty-printing functions are-very straightforward. If there is a bug (in pretty-printer, not in parser+very straightforward. If there is a bug (in the pretty-printer, not in the parser which Hindent cannot control), it's easy to fix AFAIU.  Hindent is also notable for its ability to handle CPP and inputs that do not-constitute complete modules. It splits input stream into so-called “code+constitute complete modules. It splits the input stream into so-called “code blocks” recognizing CPP macros and then only pretty-prints “normal code”-without touching CPP directives. After that CPP is inserted between+without touching CPP directives. After that, CPP is inserted between pretty-printed blocks of source code. The approach fails when CPP breaks code in such a way that separate blocks do not form valid Haskell expressions, see@@ -98,22 +98,22 @@ Looking at the bug tracker there are many bugs. Part of them is because of the use of `haskell-src-exts`, the other part is because the maintainer doesn't care (anymore?) and doesn't fix them. Well it's as simple as that,-with any sort of commercial backing the bugs in pretty printer would be-fixed long time ago.+with any sort of commercial backing the bugs in the pretty printer would+have been fixed a long time ago.  ### Stylish Haskell  [Stylish Haskell][stylish-haskell] also uses `haskell-src-exts` and suffers from the same upstream problems. I haven't studied the transformations it performs, but it looks like it transforms the parsed source code partially-by manipulating AST and partially by manipulating raw text (e.g. to drop-trailing whitspace from each line). CPP Macros are just filtered out+by manipulating the AST and partially by manipulating raw text (e.g. to drop+trailing whitespace from each line). CPP macros are just filtered out silently as a preprocessing step before feeding the code to `haskell-src-exts`. -Stylish Haskell is not so invasive as the other formatters and most reported+Stylish Haskell is not as invasive as the other formatters and most reported bugs are about parsing issues and CPP. As I understand it, people mostly use-it to screw their import lists.+it to sort their import lists.  ### Haskell formatter @@ -147,7 +147,7 @@  There are the following challenges when formatting a module with CPP: -* GHC parser won't accept anything but a valid, complete module. Therefore,+* The GHC parser won't accept anything but a valid, complete module. Therefore,   formatting the Haskell code between CPP directives is not an option.  * Ignoring the CPP directives and formatting the Haskell code can change@@ -225,8 +225,8 @@ directives, constraining how directives can be inserted in Haskell code to avoid changing the meaning by reformatting. But this would introduce additional complexity, and the problem would-need to be solved repeteadly for every tool out there which wants-to parse Haskell modules. If CPP is replaced with some language+need to be solved repeatedly for every tool out there which wants+to parse Haskell modules. If CPP is replaced by some language extension or mechanism to do conditional compilation, all tools will benefit from it. @@ -313,7 +313,7 @@ might be used in multiple projects, and we prefer to have it formatted the same in all of them. -See this [this+See [this post][hindent-5-blog] by Chris Done (the author of Hindent) which says that as long as the default style is conventional and good it doesn't really matter how code gets formatted. Consistency is more important.@@ -323,10 +323,10 @@ Some language extensions affect how parsing is done. We are going to deal with those in two ways: -* When language pragmas are present in source file, we must parse them+* When language pragmas are present in the source file, we must parse them   before we run the main parser (I guess) and they should determine how the   main parsing will be done.-* There also should be configuration file that may enable other language+* There should also be a configuration file that may enable other language   extensions to be used on all files. * Later we could try to locate Cabal files and fetch the list of extensions   that are enabled by default from there.@@ -337,11 +337,11 @@ pretty-printing code and new issues are discovered. For each Haskell module that we want to test, we perform the following steps: -1. Given input snippet of source code parse it and pretty print it.-2. Parse the result of pretty-printing again and make sure that AST is the-   same as AST of original snippet module span positions. We could make+1. Given an input snippet of source code, parse it and pretty print it.+2. Parse the result of pretty-printing again and make sure that the AST is the+   same as the AST of the original snippet module span positions. We could make    this part of a self-check in the formatter.-3. Check the output against expected output. Thus all tests should include+3. Check the output against the expected output. Thus all tests should include    two files: input and expected output. 4. Check that running the formatter on the output produces the same output    again (the transformation is idempotent).@@ -366,7 +366,7 @@ * An option to specify location of config file. * Options to specify parameters that come from config files on command line   instead (currently this is just dynamic options enabled by default, such-  as langauge extensions).+  as language extensions).  ### Why not contribute to/fork HIndent or Brittany? @@ -386,8 +386,8 @@ Forking or contributing to Hindent is not an option because if we replace `haskell-src-exts` with `ghc` (or `ghc-exact-print`) then we'll have to work with a different AST type and all the code in Hindent will become-incompatible and there won't be much code to be re-used in that case. It is-also possible that we'll find a nicer way to write pretty-printer.+incompatible and there won't be much code to be reused in that case. It is+also possible that we'll find a nicer way to write the pretty-printer.  ## Examples 
LICENSE.md view
@@ -1,4 +1,4 @@-Copyright © 2018–present Tweag I/O+Copyright © 2018–2026 Tweag I/O, 2026–present Mark Karpov  All rights reserved. @@ -12,7 +12,7 @@   notice, this list of conditions and the following disclaimer in the   documentation and/or other materials provided with the distribution. -* Neither the name Tweag I/O nor the names of contributors may be used to+* Neither the names Tweag I/O and Mark Karpov nor the names of contributors may be used to   endorse or promote products derived from this software without specific   prior written permission. 
README.md view
@@ -4,108 +4,125 @@ [![Hackage](https://img.shields.io/hackage/v/ormolu.svg?style=flat)](https://hackage.haskell.org/package/ormolu) [![Stackage Nightly](http://stackage.org/package/ormolu/badge/nightly)](http://stackage.org/nightly/package/ormolu) [![Stackage LTS](http://stackage.org/package/ormolu/badge/lts)](http://stackage.org/lts/package/ormolu)-[![Build status](https://badge.buildkite.com/8e3b0951f3652b77e1c422b361904136a539b0522029156354.svg?branch=master)](https://buildkite.com/tweag-1/ormolu)+[![CI](https://github.com/mrkkrp/ormolu/actions/workflows/ci.yml/badge.svg)](https://github.com/mrkkrp/ormolu/actions/workflows/ci.yml) -* [Building and installation](#building-and-installation)-    * [Arch Linux](#arch-linux)+*Ormolu gratefully acknowledges the support and contributions of+[Tweag][tweag] during the period 2019–2026.*++* [Installation](#installation)+* [Building from source](#building-from-source) * [Usage](#usage)+    * [Ormolu Live](#ormolu-live)     * [Editor integration](#editor-integration)-    * [GitHub actions](#github-actions)+    * [Haskell Language Server](#haskell-language-server)+    * [GitHub Actions](#github-actions)+    * [Language extensions, dependencies, and fixities](#language-extensions-dependencies-and-fixities)     * [Magic comments](#magic-comments)+    * [Regions](#regions)     * [Exit codes](#exit-codes)+    * [Using as a library](#using-as-a-library)+* [Troubleshooting](#troubleshooting)+    * [Operators are being formatted weirdly!](#operators-are-being-formatted-weirdly) * [Limitations](#limitations) * [Running on Hackage](#running-on-hackage)+* [Forks and modifications](#forks-and-modifications) * [Contributing](#contributing) * [License](#license)  Ormolu is a formatter for Haskell source code. The project was created with the following goals in mind: -* Using GHC's own parser to avoid parsing problems caused by+* Use GHC's own parser to avoid the parsing problems caused by   [`haskell-src-exts`][haskell-src-exts].-* Let some whitespace be programmable. The layout of the input influences-  the layout choices in the output. This means that the choices between-  single-line/multi-line layouts in certain situations are made by the user,-  not by an algorithm. This makes the implementation simpler and leaves some-  control to the user while still guaranteeing that the formatted code is-  stylistically consistent.-* Writing code in such a way so it's easy to modify and maintain.-* Implementing one “true” formatting style which admits no configuration.-* The formatting style aims to result in minimal diffs.+* Make some whitespace programmable. The layout of the input influences the+  layout choices in the output, so the choice between single-line and+  multi-line layouts is made by the user rather than by an algorithm. This+  keeps the implementation simpler and leaves some control to the user while+  still guaranteeing that the formatted code is stylistically consistent.+* Implement one “true” formatting style that admits no configuration.+* Produce minimal diffs. * Choose a style compatible with modern dialects of Haskell. As new Haskell-  extensions enter broad use, we may change the style to accommodate them.-* Idempotence: formatting already formatted code doesn't change it.-* Be well-tested and robust so that the formatter can be used in large+  extensions enter broad use, we may adjust the style to accommodate them.+* Guarantee idempotence: formatting already formatted code doesn't change it.+* Stay well-tested and robust, so that the formatter can be used in large   projects. -## Building and installation+Try it out in your browser at <https://ormolu-live.markkarpov.com>!+See [Ormolu Live](#ormolu-live) for more info. -The easiest way to build the project is with Nix:+## Installation +The [release page][releases] has binaries for Linux, macOS, and Windows.++You can also install Ormolu with `cabal` or `stack`:+ ```console-$ nix-build -A ormolu+$ cabal install ormolu+$ stack install ormolu ``` -Or with `cabal-install` from the Nix shell:+Ormolu is also included in several package repositories. For example, on Arch+Linux you can use [the package on AUR][aur]:  ```console-$ nix-shell --run "cabal new-build"+$ yay -S ormolu ``` -Alternatively, `stack` could be used with a `stack.yaml` file as follows.+## Building from source +The easiest way to build the project is with Nix:+ ```console-$ cat stack.yaml-resolver: lts-16.0-packages:-- '.'+$ nix build+``` +Make sure to accept the offered Nix binary caches, otherwise building may+take a very long time. The flake declares the relevant caches (the IOG cache+and the project's own `ormolu.cachix.org`, which is populated by CI) via its+`nixConfig`, but Nix uses them only if you allow it to. The simplest way is+to pass `--accept-flake-config`:++```console+$ nix build --accept-flake-config+```++To avoid repeating the flag, add the following to your Nix configuration+(`/etc/nix/nix.conf`, or `nix.settings` on NixOS):++```+extra-substituters = https://cache.iog.io https://ormolu.cachix.org+extra-trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= ormolu.cachix.org-1:0L9Y4A+6dGpvfGtaeaq5w44pgX0AVRivKMfi2fiOzYE=+```++Alternatively, you can use `stack`:++```console $ stack build # to build $ stack install # to install ``` -To use Ormolu directly from GitHub with Nix, this snippet may come in handy:+To use Ormolu directly from GitHub with Nix flakes, this snippet may come in+handy:  ```nix-# This overlay adds Ormolu straight from GitHub.-self: super:--let source = super.fetchFromGitHub {-      owner = "tweag";-      repo = "ormolu";-      rev = "de279d80122b287374d4ed87c7b630db1f157642"; # update as necessary-      sha256 = "0qrxfk62ww6b60ha9sqcgl4nb2n5fhf66a65wszjngwkybwlzmrv"; # same-    };-    ormolu = import source { pkgs = self; };-in {-  haskell = super.haskell // {-    packages = super.haskell.packages // {-      "${ormolu.ormoluCompiler}" = super.haskell.packages.${ormolu.ormoluCompiler}.override {-        overrides = ormolu.ormoluOverlay;-      };-    };+{+  inputs.ormolu.url = "github:mrkkrp/ormolu";+  outputs = { ormolu, ... }: {+    # use ormolu.packages.${system}.default here   }; } ``` -### Arch Linux--To install Ormolu on Arch Linux, one can use [the package on AUR][aur]:--```console-yay -S ormolu-```- ## Usage -The following will print the formatted output to the standard output.+The following prints the formatted output to the standard output:  ```console $ ormolu Module.hs ```  Add `--mode inplace` to replace the contents of the input file with the-formatted output.+formatted output:  ```console $ ormolu --mode inplace Module.hs@@ -123,12 +140,27 @@ $ ormolu --mode inplace $(git ls-files '*.hs') ``` -To check if files are are already formatted (useful on CI):+To check whether files are already formatted (useful on CI):  ```console $ ormolu --mode check $(find . -name '*.hs') ``` +#### :zap: Beware git's `core.autocrlf` on Windows :zap:+Ormolu's output always uses LF line endings. In particular,+`ormolu --mode check` will fail if its input is correctly formatted+*except* that it has CRLF line endings. This situation can happen on Windows+when checking out a git repository without having set [`core.autocrlf`](+https://www.git-scm.com/docs/git-config#Documentation/git-config.txt-coreautocrlf)+to `false`.++### Ormolu Live++On every new commit to `master`, [Ormolu Live](./ormolu-live) is deployed to+https://ormolu-live.markkarpov.com. Older versions are available at+https://COMMITHASH--ormolu.netlify.app, where `COMMITHASH` is the hash of the+commit you want.+ ### Editor integration  We know of the following editor integrations:@@ -137,11 +169,79 @@ * [VS Code][vs-code-plugin] * Vim: [neoformat][neoformat], [vim-ormolu][vim-ormolu] -### GitHub actions+### Haskell Language Server -[`ormolu-action`][ormolu-action] is the recommended way to ensure that a-project is formatted with Ormolu.+[Haskell Language Server](https://haskell-language-server.readthedocs.io)+has built-in support for using Ormolu as a formatter. +### GitHub Actions++[`run-ormolu`][run-ormolu] is the recommended way to ensure that a project+stays formatted with Ormolu.++### Language extensions, dependencies, and fixities++Ormolu automatically locates the Cabal file that corresponds to a given+source file. Cabal files are used to extract both default extensions and+dependencies. Default extensions directly affect the behavior of the GHC+parser, while dependencies are used to determine the fixities of operators+that appear in the source code. Fixities can also be overridden via an+`.ormolu` file, which should be located higher in the file system hierarchy+than the source file being formatted. When the input comes from stdin, you+can pass `--stdin-input-file` to tell Ormolu which location to use as the+starting point when searching for `.cabal` and `.ormolu` files.++Here is an example of an `.ormolu` file:++```haskell+infixr 9  .+infixr 5  +++infixl 4  <$+infixl 1  >>, >>=+infixr 1  =<<+infixr 0  $, $!+infixl 4 <*>, <*, *>, <**>++infixr 3 >~<+infixr 3.3 |~|+infixr 3.7 <~>+```++It uses exactly the same syntax as ordinary Haskell fixity declarations,+which makes it easier for Haskellers to edit and maintain. Since Ormolu+0.7.8.0, fractional precedences are supported for more precise control over+the formatting of complex operator chains.++As of Ormolu 0.7.0.0, `.ormolu` files can also contain instructions about+module re-exports that Ormolu should be aware of. This can be useful because+Ormolu cannot know about every possible module re-export in the ecosystem,+and only a few of them actually matter for fixity deduction. In 99% of cases+you won't have to do anything, especially since the most common re-exports+are already built into Ormolu. (You are welcome to open PRs to make Ormolu+aware of more re-exports by default.) However, when the fixity of an operator+is not inferred correctly, making Ormolu aware of a re-export may help. Here+is an example:++```haskell+module Control.Lens exports Control.Lens.At+module Control.Lens exports "lens" Control.Lens.Lens+```++Module re-export declarations can be mixed freely with fixity overrides, as+long as each declaration is on its own line. As of Ormolu 0.7.1.0 explicit+package names are allowed in re-export declarations (see the example above).++Finally, all of the above-mentioned parameters can be controlled from the+command line:++* Language extensions can be specified with the `-o` or `--ghc-opt` flag.+* Dependencies can be specified with the `-p` or `--package` flag.+* Fixities can be specified with the `-f` or `--fixity` flag.+* Re-exports can be specified with the `-r` or `--reexport` flag.++Searching for `.cabal` and `.ormolu` files can be disabled by passing+`--no-cabal` and `--no-dot-ormolu` respectively.+ ### Magic comments  Ormolu understands two magic comments:@@ -156,13 +256,22 @@ {- ORMOLU_ENABLE -} ``` -This allows us to disable formatting selectively for code between these-markers or disable it for the entire file. To achieve the latter, just put-`{- ORMOLU_DISABLE -}` at the very top. Note that for Ormolu to work the-source code must still be parseable even when the disabled regions are-omitted. Because of that the magic comments cannot be placed arbitrarily,-but rather must enclose independent top-level definitions.+These let you disable formatting selectively for the code between the two+markers, or for the entire file. To disable formatting for the whole file,+just put `{- ORMOLU_DISABLE -}` at the very top. Note that the fragments+where Ormolu is enabled must be parseable on their own. Because of this, the+magic comments cannot be placed arbitrarily; they must enclose independent+top-level definitions. +### Regions++You can ask Ormolu to format a region of the input and leave the rest+unformatted by passing the `--start-line` and `--end-line` command line+options. `--start-line` defaults to the beginning of the file, and+`--end-line` defaults to the end.++Note that the selected region needs to be parseable Haskell code on its own.+ ### Exit codes  Exit code | Meaning@@ -175,51 +284,99 @@ 5         | AST of original and formatted code differs 6         | Formatting is not idempotent 7         | Unrecognized GHC options+8         | Cabal file parsing failed+9         | Missing input file path when using stdin input and accounting for .cabal files+10        | Parse error while parsing fixity overrides+11        | Comments of original and formatted code differ 100       | In checking mode: unformatted files-101       | Inplace and check modes do not work with stdin+101       | Inplace mode does not work with stdin 102       | Other issue (with multiple input files) +### Using as a library++The `ormolu` package can also be used as a dependency from other Haskell+programs. For this purpose, only the top-level `Ormolu` module should be+considered stable. It follows the [PVP](https://pvp.haskell.org/) starting+from version 0.5.3.0. Rely on other modules at your own risk.++## Troubleshooting++### Operators are being formatted weirdly!++This can happen when Ormolu doesn't know or can't determine the fixity of an+operator.++* If this is a custom operator, see the instructions in the [Language+  extensions, dependencies, and+  fixities](#language-extensions-dependencies-and-fixities) section to+  specify the correct fixities in a `.ormolu` file.++* If this is a third-party operator (e.g. from `base` or some other package+  on Hackage), Ormolu probably doesn't recognize that the operator is the+  same as the third-party one.++  Some possible reasons for this:++    * You have a custom Prelude that re-exports things from the standard+      Prelude.+    * You have `-XNoImplicitPrelude` turned on.++  If either of these applies, make sure to specify the re-exports correctly+  in a `.ormolu` file.++You can see how Ormolu decides the fixity of operators by using `--debug`.+ ## Limitations  * CPP support is experimental. CPP is virtually impossible to handle-  correctly, so we process them as a sort of unchangeable snippets. This-  works only in simple cases when CPP conditionals surround top-level-  declarations. See the [CPP][design-cpp] section in the design notes for a+  correctly, so Ormolu treats CPP sections as unchangeable snippets. This+  works only in simple cases, where CPP conditionals surround top-level+  declarations. See the [CPP][design-cpp] section of the design notes for a   discussion of the dangers.-* Input modules should be parsable by Haddock, which is a bit stricter-  criterion than just being valid Haskell modules.  ## Running on Hackage -It's possible to try Ormolu on arbitrary packages from Hackage. For that-execute (from the root of the cloned repo):+You can try Ormolu on arbitrary packages from Hackage. To do so, run the+following from the root of the cloned repo:  ```console-$ nix-build -A hackage.<package>+$ nix build .#hackage.<package> ``` -Then inspect `result/log.txt` for possible problems. The derivation will-also contain formatted `.hs` files for inspection and original inputs with-`.hs-original` extension (those are with CPP dropped, exactly what is fed-into Ormolu).+Then inspect `result/log.txt` for possible problems. The derivation also+contains the formatted `.hs` files for inspection, along with the original+inputs under the `.hs-original` extension (these have CPP dropped and are+exactly what is fed into Ormolu). +## Forks and modifications++We know of the following actively maintained forks:++* [Fourmolu][fourmolu], which uses 4-space indentation and allows arbitrary+  configuration.+ ## Contributing -See [CONTRIBUTING.md][contributing].+Contributions of all kinds are welcome, from bug reports and documentation+fixes to new features. Please see [CONTRIBUTING.md][contributing] to get+started.  ## License  See [LICENSE.md][license]. -Copyright © 2018–present Tweag I/O+Copyright © 2018–2026 Tweag I/O, 2026–present Mark Karpov +[tweag]: https://tweag.io/ [aur]: https://aur.archlinux.org/packages/ormolu-[contributing]: https://github.com/tweag/ormolu/blob/master/CONTRIBUTING.md-[design-cpp]: https://github.com/tweag/ormolu/blob/master/DESIGN.md#cpp+[design-cpp]: https://github.com/mrkkrp/ormolu/blob/master/DESIGN.md#cpp [emacs-package]: https://github.com/vyorkin/ormolu.el [haskell-src-exts]: https://hackage.haskell.org/package/haskell-src-exts-[license]: https://github.com/tweag/ormolu/blob/master/LICENSE.md [neoformat]: https://github.com/sbdchd/neoformat-[ormolu-action]: https://github.com/marketplace/actions/ormolu-action+[releases]: https://github.com/mrkkrp/ormolu/releases+[run-ormolu]: https://github.com/haskell-actions/run-ormolu [vim-ormolu]: https://github.com/sdiehl/vim-ormolu [vs-code-plugin]: https://marketplace.visualstudio.com/items?itemName=sjurmillidahl.ormolu-vscode+[fourmolu]: https://github.com/fourmolu/fourmolu+[contributing]: https://github.com/mrkkrp/ormolu/blob/master/CONTRIBUTING.md+[license]: https://github.com/mrkkrp/ormolu/blob/master/LICENSE.md
− Setup.hs
@@ -1,6 +0,0 @@-module Main (main) where--import Distribution.Simple--main :: IO ()-main = defaultMain
app/Main.hs view
@@ -1,34 +1,55 @@ {-# LANGUAGE CPP #-}+{-# LANGUAGE DataKinds #-} {-# LANGUAGE LambdaCase #-}+{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TemplateHaskell #-}-{-# LANGUAGE TypeApplications #-}  module Main (main) where +import Control.Concurrent (MVar, newMVar, withMVar)+import Control.Exception (throwIO) import Control.Monad import Data.Bool (bool) import Data.List (intercalate, sort)-import Data.Maybe (mapMaybe)-import qualified Data.Text.IO as TIO+import Data.List.NonEmpty (NonEmpty)+import Data.Map.Strict qualified as Map+import Data.Maybe (fromMaybe, mapMaybe, maybeToList)+import Data.Set qualified as Set+import Data.Text.IO.Utf8 qualified as T.Utf8 import Data.Version (showVersion)-import Development.GitRev+import Distribution.ModuleName (ModuleName)+import Distribution.Types.PackageName (PackageName)+import Language.Haskell.TH.Env (envQ) import Options.Applicative import Ormolu import Ormolu.Diff.Text (diffText, printTextDiff)+import Ormolu.Fixity import Ormolu.Parser (manualExts) import Ormolu.Terminal import Ormolu.Utils (showOutputable)+import Ormolu.Utils.Fixity import Paths_ormolu (version)+import System.Directory import System.Exit (ExitCode (..), exitWith)-import qualified System.FilePath as FP+import System.FilePath qualified as FP import System.IO (hPutStrLn, stderr)+import UnliftIO.Async (pooledMapConcurrently)  -- | Entry point of the program. main :: IO () main = do   Opts {..} <- execParser optsParserInfo-  let formatOne' = formatOne optMode optConfig+  -- We use this to guard writes to stdout in order to avoid+  -- garbled output from concurrent formatting processes.+  outputLock <- newMVar ()+  let formatOne' =+        formatOne+          optConfigFileOpts+          optMode+          optSourceType+          optConfig+          outputLock   exitCode <- case optInputFiles of     [] -> formatOne' Nothing     ["-"] -> formatOne' Nothing@@ -38,7 +59,8 @@             ExitSuccess -> Nothing             ExitFailure n -> Just n       errorCodes <--        mapMaybe selectFailure <$> mapM (formatOne' . Just) (sort xs)+        mapMaybe selectFailure+          <$> pooledMapConcurrently (formatOne' . Just) (sort xs)       return $         if null errorCodes           then ExitSuccess@@ -51,59 +73,149 @@  -- | Format a single input. formatOne ::+  -- | How to use .cabal files+  ConfigFileOpts ->   -- | Mode of operation   Mode ->+  -- | The 'SourceType' requested by the user+  Maybe SourceType ->   -- | Configuration   Config RegionIndices ->+  -- | Lock for writing to output handles+  MVar () ->   -- | File to format or stdin as 'Nothing'   Maybe FilePath ->   IO ExitCode-formatOne mode config mpath = withPrettyOrmoluExceptions (cfgColorMode config) $-  case FP.normalise <$> mpath of-    Nothing -> do-      r <- ormoluStdin config-      case mode of-        Stdout -> do-          TIO.putStr r-          return ExitSuccess-        _ -> do-          hPutStrLn-            stderr-            "This feature is not supported when input comes from stdin."-          -- 101 is different from all the other exit codes we already use.-          return (ExitFailure 101)-    Just inputFile -> do-      originalInput <- TIO.readFile inputFile-      formattedInput <- ormoluFile config inputFile-      case mode of-        Stdout -> do-          TIO.putStr formattedInput-          return ExitSuccess-        InPlace -> do-          -- Only write when the contents have changed, in order to avoid-          -- updating the modified timestamp if the file was already correctly-          -- formatted.-          when (formattedInput /= originalInput) $-            TIO.writeFile inputFile formattedInput-          return ExitSuccess-        Check ->-          case diffText originalInput formattedInput inputFile of-            Nothing -> return ExitSuccess-            Just diff -> do-              runTerm (printTextDiff diff) (cfgColorMode config) stderr-              -- 100 is different to all the other exit code that are emitted-              -- either from an 'OrmoluException' or from 'error' and-              -- 'notImplemented'.-              return (ExitFailure 100)+formatOne ConfigFileOpts {..} mode reqSourceType rawConfig outputLock mpath =+  withPrettyOrmoluExceptions (cfgColorMode rawConfig) $ do+    let getCabalInfoForSourceFile' sourceFile = do+          cabalSearchResult <- getCabalInfoForSourceFile sourceFile+          let debugEnabled = cfgDebug rawConfig+          case cabalSearchResult of+            CabalNotFound -> do+              when debugEnabled $+                withMVar outputLock $ \_ ->+                  hPutStrLn stderr $+                    "Could not find a .cabal file for " <> sourceFile+              return Nothing+            CabalDidNotMention cabalInfo -> do+              when debugEnabled $ do+                relativeCabalFile <-+                  makeRelativeToCurrentDirectory (ciCabalFilePath cabalInfo)+                withMVar outputLock $ \_ ->+                  hPutStrLn stderr $+                    "Found .cabal file "+                      <> relativeCabalFile+                      <> ", but it did not mention "+                      <> sourceFile+              return (Just cabalInfo)+            CabalFound cabalInfo -> return (Just cabalInfo)+        getDotOrmoluForSourceFile' sourceFile = do+          if optDoNotUseDotOrmolu+            then return Nothing+            else Just <$> getDotOrmoluForSourceFile sourceFile+    case FP.normalise <$> mpath of+      -- input source = STDIN+      Nothing -> do+        mcabalInfo <- case (optStdinInputFile, optDoNotUseCabal) of+          (_, True) -> return Nothing+          (Nothing, False) -> throwIO OrmoluMissingStdinInputFile+          (Just inputFile, False) -> getCabalInfoForSourceFile' inputFile+        mdotOrmolu <- case optStdinInputFile of+          Nothing -> return Nothing+          Just inputFile -> getDotOrmoluForSourceFile' inputFile+        config <- patchConfig Nothing mcabalInfo mdotOrmolu+        case mode of+          Stdout -> do+            output <- ormoluStdin config+            withMVar outputLock $ \_ ->+              T.Utf8.putStr output+            return ExitSuccess+          InPlace -> do+            hPutStrLn+              stderr+              "In-place editing is not supported when the input comes from stdin."+            -- 101 is different from all the other exit codes we already use.+            return (ExitFailure 101)+          Check -> do+            -- ormoluStdin is not used because we need the originalInput+            originalInput <- T.Utf8.getContents+            let stdinRepr = "<stdin>"+            formattedInput <-+              ormolu config stdinRepr originalInput+            handleDiff originalInput formattedInput stdinRepr+      -- input source = a file+      Just inputFile -> do+        mcabalInfo <-+          if optDoNotUseCabal+            then return Nothing+            else getCabalInfoForSourceFile' inputFile+        mdotOrmolu <- getDotOrmoluForSourceFile' inputFile+        config <-+          patchConfig+            (Just (detectSourceType inputFile))+            mcabalInfo+            mdotOrmolu+        case mode of+          Stdout -> do+            output <- ormoluFile config inputFile+            withMVar outputLock $ \_ ->+              T.Utf8.putStr output+            return ExitSuccess+          InPlace -> do+            -- ormoluFile is not used because we need originalInput+            originalInput <- T.Utf8.readFile inputFile+            formattedInput <-+              ormolu config inputFile originalInput+            when (formattedInput /= originalInput) $+              T.Utf8.writeFile inputFile formattedInput+            return ExitSuccess+          Check -> do+            -- ormoluFile is not used because we need originalInput+            originalInput <- T.Utf8.readFile inputFile+            formattedInput <-+              ormolu config inputFile originalInput+            handleDiff originalInput formattedInput inputFile+  where+    patchConfig mdetectedSourceType mcabalInfo mdotOrmolu = do+      let sourceType =+            fromMaybe+              ModuleSource+              (reqSourceType <|> mdetectedSourceType)+      return $+        refineConfig+          sourceType+          mcabalInfo+          (Just (cfgFixityOverrides rawConfig))+          (Just (cfgModuleReexports rawConfig))+          ( rawConfig+              { cfgFixityOverrides = maybe defaultFixityOverrides fst mdotOrmolu,+                cfgModuleReexports = maybe defaultModuleReexports snd mdotOrmolu+              }+          )+    handleDiff originalInput formattedInput fileRepr =+      case diffText originalInput formattedInput fileRepr of+        Nothing -> return ExitSuccess+        Just diff -> do+          runTerm (printTextDiff diff) (cfgColorMode rawConfig) stderr+          -- 100 is different from all the other exit codes that are emitted+          -- either from an 'OrmoluException' or from 'error' and+          -- 'notImplemented'.+          return (ExitFailure 100)  ---------------------------------------------------------------------------- -- Command line options parsing +-- | All command line options. data Opts = Opts   { -- | Mode of operation     optMode :: !Mode,     -- | Ormolu 'Config'     optConfig :: !(Config RegionIndices),+    -- | Options related to info extracted from files+    optConfigFileOpts :: ConfigFileOpts,+    -- | Source type option, where 'Nothing' means autodetection+    optSourceType :: !(Maybe SourceType),     -- | Haskell source files to format or stdin (when the list is empty)     optInputFiles :: ![FilePath]   }@@ -119,6 +231,18 @@     Check   deriving (Eq, Show) +-- | Options related to configuration stored in the file system.+data ConfigFileOpts = ConfigFileOpts+  { -- | DO NOT extract default-extensions and dependencies from .cabal files+    optDoNotUseCabal :: Bool,+    -- | DO NOT look for @.ormolu@ files+    optDoNotUseDotOrmolu :: Bool,+    -- | Optional path to a file which will be used to find a .cabal file+    -- when using input from stdin+    optStdinInputFile :: Maybe FilePath+  }+  deriving (Show)+ optsParserInfo :: ParserInfo Opts optsParserInfo =   info (helper <*> ver <*> exts <*> optsParser) . mconcat $@@ -134,12 +258,9 @@     verStr =       intercalate         "\n"-        [ unwords-            [ "ormolu",-              showVersion version,-              $gitBranch,-              $gitHash-            ],+        [ unwords $+            ["ormolu", showVersion version]+              <> maybeToList $$(envQ @String "ORMOLU_REV"),           "using ghc-lib-parser " ++ VERSION_ghc_lib_parser         ]     exts :: Parser (a -> a)@@ -166,11 +287,29 @@               ]         )     <*> configParser+    <*> configFileOptsParser+    <*> sourceTypeParser     <*> (many . strArgument . mconcat)       [ metavar "FILE",         help "Haskell source files to format or stdin (the default)"       ] +configFileOptsParser :: Parser ConfigFileOpts+configFileOptsParser =+  ConfigFileOpts+    <$> (switch . mconcat)+      [ long "no-cabal",+        help "Do not extract default-extensions and dependencies from .cabal files"+      ]+    <*> (switch . mconcat)+      [ long "no-dot-ormolu",+        help "Do not look for .ormolu files"+      ]+    <*> (optional . strOption . mconcat)+      [ long "stdin-input-file",+        help "Path which will be used to find the .cabal file when using input from stdin"+      ]+ configParser :: Parser (Config RegionIndices) configParser =   Config@@ -180,6 +319,32 @@         metavar "OPT",         help "GHC options to enable (e.g. language extensions)"       ]+    <*> ( fmap (FixityOverrides . Map.fromList . mconcat)+            . many+            . option parseFixityDeclaration+            . mconcat+        )+      [ long "fixity",+        short 'f',+        metavar "FIXITY",+        help "Fixity declaration to use (an override)"+      ]+    <*> ( fmap (ModuleReexports . Map.fromListWith (<>) . mconcat . pure)+            . many+            . option parseModuleReexportDeclaration+            . mconcat+        )+      [ long "reexport",+        short 'r',+        metavar "REEXPORT",+        help "Module re-export that Ormolu should know about"+      ]+    <*> (fmap Set.fromList . many . strOption . mconcat)+      [ long "package",+        short 'p',+        metavar "PACKAGE",+        help "Explicitly specified dependency (for operator fixity/precedence only)"+      ]     <*> (switch . mconcat)       [ long "unsafe",         short 'u',@@ -195,6 +360,10 @@         short 'c',         help "Fail if formatting is not idempotent"       ]+    -- We cannot parse the source type here, because we might need to do+    -- autodetection based on the input file extension (not available here)+    -- before storing the resolved value in the config struct.+    <*> pure ModuleSource     <*> (option parseColorMode . mconcat)       [ long "color",         metavar "WHEN",@@ -214,6 +383,16 @@               ]         ) +sourceTypeParser :: Parser (Maybe SourceType)+sourceTypeParser =+  (option parseSourceType . mconcat)+    [ long "source-type",+      short 't',+      metavar "TYPE",+      value Nothing,+      help "Set the type of source; TYPE can be 'module', 'sig', or 'auto' (the default)"+    ]+ ---------------------------------------------------------------------------- -- Helpers @@ -225,9 +404,28 @@   "check" -> Right Check   s -> Left $ "unknown mode: " ++ s +-- | Parse a fixity declaration.+parseFixityDeclaration :: ReadM [(OpName, FixityInfo)]+parseFixityDeclaration = eitherReader parseFixityDeclarationStr++-- | Parse a module reexport declaration.+parseModuleReexportDeclaration ::+  ReadM (ModuleName, NonEmpty (Maybe PackageName, ModuleName))+parseModuleReexportDeclaration = eitherReader parseModuleReexportDeclarationStr++-- | Parse 'ColorMode'. parseColorMode :: ReadM ColorMode parseColorMode = eitherReader $ \case   "never" -> Right Never   "always" -> Right Always   "auto" -> Right Auto   s -> Left $ "unknown color mode: " ++ s++-- | Parse the 'SourceType'. 'Nothing' means that autodetection based on+-- file extension is requested.+parseSourceType :: ReadM (Maybe SourceType)+parseSourceType = eitherReader $ \case+  "module" -> Right (Just ModuleSource)+  "sig" -> Right (Just SignatureSource)+  "auto" -> Right Nothing+  s -> Left $ "unknown source type: " ++ s
+ data/cabal-tests/Bar.hs view
@@ -0,0 +1,3 @@+module Foo where++import Data.List qualified as List
+ data/cabal-tests/Foo.hs view
@@ -0,0 +1,3 @@+module Foo where++import Data.List qualified as List
+ data/cabal-tests/test.cabal view
@@ -0,0 +1,13 @@+cabal-version: 2.4+name: test+version: 0++library+  exposed-modules: Foo+  hs-source-dirs: .+  default-extensions: ImportQualifiedPost++executable app+  main-is: Main+  other-modules: Bar+  default-extensions: ImportQualifiedPost
+ data/diff-tests/inputs/applicative-after.hs view
@@ -0,0 +1,8 @@+testPermParser :: Permutation Parser String+testPermParser =+  f+    <$> toPermutationWithDefault 'x' (char 'a')+    <*> toPermutationWithDefault 'y' (char 'b')+    <*> toPermutationWithDefault 'z' (char 'c')+  where+    f a b c = [a, b, c]
+ data/diff-tests/inputs/applicative-before.hs view
@@ -0,0 +1,7 @@+testPermParser :: Permutation Parser String+testPermParser =+  f <$> toPermutationWithDefault 'x' (char 'a')+    <*> toPermutationWithDefault 'y' (char 'b')+    <*> toPermutationWithDefault 'z' (char 'c')+  where+    f a b c = [a, b, c]
+ data/diff-tests/inputs/longer-v2.hs view
@@ -0,0 +1,16 @@+module Main (foo) where++a+b+c++main :: IO ()+main = return ()++d+e+f+g++foo :: Int+foo = 6
+ data/diff-tests/inputs/longer.hs view
@@ -0,0 +1,16 @@+module Main (main) where++a+b+c++main :: IO ()+main = return ()++d+e+f+g++foo :: Int+foo = 5
data/diff-tests/outputs/no-preceding.txt view
@@ -1,6 +1,7 @@ TEST-@@ -1,3 +1,3 @@+@@ -1,4 +1,4 @@ - module Main (foo) where + module Main (main) where+   main :: IO ()   main = return ()
data/diff-tests/outputs/simple-hunk.txt view
@@ -1,9 +1,10 @@ TEST-@@ -1,6 +1,6 @@+@@ -1,7 +1,7 @@   module Main (main) where    main :: IO () - main = return () + main = pure ()+   foo :: Int   foo = 5
+ data/diff-tests/outputs/trimming-trailing-both-eof.txt view
@@ -0,0 +1,10 @@+TEST+@@ -1,6 +1,7 @@+  testPermParser :: Permutation Parser String+  testPermParser =+-   f <$> toPermutationWithDefault 'x' (char 'a')++   f++     <$> toPermutationWithDefault 'x' (char 'a')+      <*> toPermutationWithDefault 'y' (char 'b')+      <*> toPermutationWithDefault 'z' (char 'c')+    where
+ data/diff-tests/outputs/trimming-trailing-both-out-of-margin.txt view
@@ -0,0 +1,13 @@+TEST+@@ -1,4 +1,4 @@+- module Main (main) where++ module Main (foo) where++  a+  b+@@ -13,4 +13,4 @@+  g++  foo :: Int+- foo = 5++ foo = 6
data/examples/declaration/class/default-signatures-out.hs view
@@ -14,9 +14,7 @@     ( Read a,       Semigroup a     ) =>-    a ->-    a ->-    a+    a -> a -> a   -- Even more pointless comment   bar     a
data/examples/declaration/class/default-signatures-simple-out.hs view
@@ -4,5 +4,5 @@ class Foo a where   -- | Foo   foo :: a -> String-  default foo :: Show a => a -> String+  default foo :: (Show a) => a -> String   foo = show
data/examples/declaration/class/super-classes-out.hs view
@@ -1,6 +1,6 @@ class Foo a -class Foo a => Bar a+class (Foo a) => Bar a  class   (Foo a, Bar a) =>
+ data/examples/declaration/data/comment-in-empty-record-out.hs view
@@ -0,0 +1,6 @@+instance StateKey ExampleReq where+  data State ExampleReq = ExampleState+    {+    -- in here you can put any state that the+    -- run.+    }
+ data/examples/declaration/data/comment-in-empty-record.hs view
@@ -0,0 +1,5 @@+instance StateKey ExampleReq where+  data State ExampleReq = ExampleState {+        -- in here you can put any state that the+        -- run.+        }
+ data/examples/declaration/data/ctype-0-out.hs view
@@ -0,0 +1,1 @@+data {-# CTYPE "unistd.h" "useconds_t" #-} T
+ data/examples/declaration/data/ctype-0.hs view
@@ -0,0 +1,1 @@+data    {-# CTYPE "unistd.h" "useconds_t" #-} T
+ data/examples/declaration/data/ctype-1-out.hs view
@@ -0,0 +1,6 @@+data+  {-# CTYPE "header.h" "an-ffi-type-with-along-name" #-}+  AnFFITypeWithAlongName = AnFFITypeWithAlongName+  { a :: X,+    b :: Y+  }
+ data/examples/declaration/data/ctype-1.hs view
@@ -0,0 +1,6 @@+data+  {-# CTYPE "header.h" "an-ffi-type-with-along-name"  #-}+  AnFFITypeWithAlongName = AnFFITypeWithAlongName+  { a :: X,+    b :: Y+  }
− data/examples/declaration/data/ctype-out.hs
@@ -1,1 +0,0 @@-data {-# CTYPE "unistd.h" "useconds_t" #-} T
− data/examples/declaration/data/ctype.hs
@@ -1,1 +0,0 @@-data    {-# CTYPE "unistd.h" "useconds_t" #-} T
+ data/examples/declaration/data/datatype-contexts-out.hs view
@@ -0,0 +1,11 @@+data (IsString s) => T s = T++data+  (IsString s) =>+  T s = T++data+  ( IsString s,+    IsString s+  ) =>+  T s = T
+ data/examples/declaration/data/datatype-contexts.hs view
@@ -0,0 +1,8 @@+data IsString s => T s = T++data IsString s =>+  T s = T++data+  ( IsString s+  , IsString s ) =>  T s = T
data/examples/declaration/data/existential-multiline-out.hs view
@@ -2,7 +2,7 @@  data Foo   = forall a. MkFoo a (a -> Bool)-  | forall a. Eq a => MkBar a+  | forall a. (Eq a) => MkBar a  data Bar   = forall x y.
data/examples/declaration/data/existential-out.hs view
@@ -2,4 +2,4 @@  data Foo = forall a. MkFoo a (a -> Bool) -data Bar = forall a b. a + b => Bar a b+data Bar = forall a b. (a + b) => Bar a b
+ data/examples/declaration/data/existential-unicode-out.hs view
@@ -0,0 +1,9 @@+{-# LANGUAGE UnicodeSyntax #-}++data Foo+  = forall a.+    Foo++data Bar+  = forall a.+    Bar
+ data/examples/declaration/data/existential-unicode.hs view
@@ -0,0 +1,7 @@+{-# LANGUAGE UnicodeSyntax #-}++data Foo = forall+  a. Foo++data Bar = ∀+  a. Bar
+ data/examples/declaration/data/field-layout/record-0-out.hs view
@@ -0,0 +1,10 @@+-- | Foo.+data Foo = Foo+  { -- | Something+    foo :: Foo Int Int,+    -- | Something else+    bar ::+      Bar+        Char+        Char+  }
+ data/examples/declaration/data/field-layout/record-0.hs view
@@ -0,0 +1,9 @@+-- | Foo.++data Foo = Foo+  { foo :: Foo Int Int+    -- ^ Something+  , bar :: Bar Char+           Char+    -- ^ Something else+  }
+ data/examples/declaration/data/field-layout/record-1-out.hs view
@@ -0,0 +1,11 @@+-- | Foo.+data Foo+  = Foo+  { -- | Something+    foo :: Foo Int Int,+    -- | Something else+    bar ::+      Bar+        Char+        Char+  }
+ data/examples/declaration/data/field-layout/record-1.hs view
@@ -0,0 +1,10 @@+-- | Foo.++data Foo =+  Foo+  { foo :: Foo Int Int+    -- ^ Something+  , bar :: Bar Char+           Char+    -- ^ Something else+  }
+ data/examples/declaration/data/field-layout/record-2-out.hs view
@@ -0,0 +1,7 @@+data IndexWithInfo schema+  = forall x.+  IndexWithInfo+  { checkedIndex :: Index schema x,+    checkedIndexName :: U.Variable,+    checkedIndexType :: Type x+  }
+ data/examples/declaration/data/field-layout/record-2.hs view
@@ -0,0 +1,7 @@+data IndexWithInfo schema =+  forall x.+  IndexWithInfo+    { checkedIndex :: Index schema x+    , checkedIndexName :: U.Variable+    , checkedIndexType :: Type x+    }
− data/examples/declaration/data/field-layout/record-out.hs
@@ -1,12 +0,0 @@-module Main where---- | Foo.-data Foo = Foo-  { -- | Something-    foo :: Foo Int Int,-    -- | Something else-    bar ::-      Bar-        Char-        Char-  }
− data/examples/declaration/data/field-layout/record.hs
@@ -1,11 +0,0 @@-module Main where---- | Foo.--data Foo = Foo-  { foo :: Foo Int Int-    -- ^ Something-  , bar :: Bar Char-           Char-    -- ^ Something else-  }
data/examples/declaration/data/gadt/multiline-out.hs view
@@ -9,17 +9,11 @@     forall a b.     (Show a, Eq b) => -- foo     -- bar-    a ->-    b ->-    Foo 'Int+    a -> b -> Foo 'Int   -- | But 'Bar' is also not too bad.   Bar ::-    Int ->-    Maybe Text ->-    Foo 'Bool+    Int -> Maybe Text -> Foo 'Bool   -- | So is 'Baz'.   Baz ::-    forall a.-    a ->-    Foo 'String+    forall a. a -> Foo 'String   (:~>) :: Foo a -> Foo a -> Foo a
data/examples/declaration/data/gadt/multiline-where-out.hs view
@@ -5,3 +5,26 @@     c   where   Foo :: a -> b -> c -> Foo a b c++data+  Foo ::+    Type ->+    Type ->+    Type+  where+  Foo :: Foo a b++data+  Foo a b c ::+    Type -> Type -> Type -> Type+  where+  Foo :: Foo a b c++data+  Vec ::+    Type ->+    Type ->+    Type+  where+  Nil :: Vec a Ze+  Cons :: a -> Vec a n -> Vec a (Su n)
data/examples/declaration/data/gadt/multiline-where.hs view
@@ -4,3 +4,20 @@     b     c where   Foo :: a -> b -> c -> Foo a b c++data Foo :: Type+         -> Type+         -> Type where+  Foo :: Foo a b++data Foo a b c ::+  Type -> Type -> Type -> Type where+  Foo :: Foo a b c++data Vec+  :: Type+  -> Type+  -> Type+  where+    Nil  :: Vec a Ze+    Cons :: a -> Vec a n -> Vec a (Su n)
data/examples/declaration/data/gadt/multiple-declaration-out.hs view
@@ -4,12 +4,10 @@ data GADT1 a where   GADT11,     GADT12 ::-    Int ->-    GADT1 a+    Int -> GADT1 a  data GADT2 a where   GADT21,     GADT21,     GADT22 ::-    Int ->-    GADT2 a+    Int -> GADT2 a
+ data/examples/declaration/data/gadt/unicode-out.hs view
@@ -0,0 +1,4 @@+{-# LANGUAGE UnicodeSyntax #-}++data Foo :: Type -> Type where+  Foo :: a -> Foo a
+ data/examples/declaration/data/gadt/unicode.hs view
@@ -0,0 +1,4 @@+{-# LANGUAGE UnicodeSyntax #-}++data Foo ∷ Type → Type where+  Foo ∷ a → Foo a
+ data/examples/declaration/data/haddock-before-deriving-out.hs view
@@ -0,0 +1,5 @@+data A = A+  deriving+    ( -- | B+      Eq+    )
+ data/examples/declaration/data/haddock-before-deriving.hs view
@@ -0,0 +1,3 @@+data A = A+  -- | B+  deriving (Eq)
+ data/examples/declaration/data/haddock-before-record-braces-out.hs view
@@ -0,0 +1,6 @@+module Example where++data Hello = Hello+  { -- | hello world+    hello :: String+  }
+ data/examples/declaration/data/haddock-before-record-braces.hs view
@@ -0,0 +1,5 @@+module Example where++data Hello = Hello+  -- | hello world+  {hello :: String}
+ data/examples/declaration/data/infix-haddocks-out.hs view
@@ -0,0 +1,51 @@+{- https://github.com/tweag/ormolu/issues/758 -}++data A+  = -- | Docs for :#+    A :# A++data WithDocs+  = forall left right.+    (Show left) =>+    -- | Docs for left arg+    left+      -- | Docs for op+      :*:+      -- | Docs for right arg+      right++data MixedDocs+  = forall left right.+    (Show left) =>+    left -- ^ before+      :*:+      -- | after+      right++data DocPartial+  = Left -- ^ left docs+         -- on multiple+         -- lines+      :*:+      Right+  | -- | op+    Left+      :*:+      Right+  | Left+      :*:+      -- | right+      Right+  | -- | op+    Left+      :*:+      Right+  | -- | op+    Left+      :*:+      Right++data NoDocs+  = Left+      :*:+      Right
+ data/examples/declaration/data/infix-haddocks.hs view
@@ -0,0 +1,43 @@+{- https://github.com/tweag/ormolu/issues/758 -}++data A = A :# A -- ^ Docs for :#++data WithDocs+  = forall left right.+    Show left =>+    left -- ^ Docs for left arg+    :*: -- ^ Docs for op+    right -- ^ Docs for right arg++data MixedDocs+  -- | before+  = forall left right.+    Show left =>+    left :*: right+  -- ^ after++data DocPartial+  = Left -- ^ left docs+         -- on multiple+         -- lines+      :*: Right+  | Left+      :*: -- ^ op+      Right+  | Left+      :*:+      -- | right+      Right+  | -- | op+    Left+      :*:+      Right+  | Left+      :*:+      Right+    -- ^ op++data NoDocs+  = Left+    :*:+    Right
+ data/examples/declaration/data/invisible-binders-out.hs view
@@ -0,0 +1,2 @@+type T :: forall k. k -> forall j. j -> Type+data T @k (a :: k) @(j :: Type) (b :: j)
+ data/examples/declaration/data/invisible-binders.hs view
@@ -0,0 +1,2 @@+type T :: forall k. k -> forall j. j -> Type+data T @k (a :: k) @(j :: Type) (b :: j)
+ data/examples/declaration/data/linear-out.hs view
@@ -0,0 +1,11 @@+{-# LANGUAGE LinearTypes #-}++data Record = Rec {x %'Many :: Int, y :: Char}++data T2 a b c where+  MkT2 :: a -> b %1 -> c %1 -> T2 a b c++data T2 a b c = MkT2 {x %Many :: a, y :: b, z :: c}++data T3 a m where+  MkT3 :: a %m -> T3 a m
+ data/examples/declaration/data/linear.hs view
@@ -0,0 +1,10 @@+{-# LANGUAGE LinearTypes #-}+data Record = Rec { x %'Many :: Int, y :: Char }++data T2 a b c where+    MkT2 :: a -> b %1 -> c %1 -> T2 a b c++data T2 a b c = MkT2 { x %Many :: a, y :: b, z :: c }++data T3 a m where+    MkT3 :: a %m -> T3 a m
+ data/examples/declaration/data/record-empty-haddock-out.hs view
@@ -0,0 +1,5 @@+data A = A+  { -- \|+    --+    a :: Int+  }
+ data/examples/declaration/data/record-empty-haddock.hs view
@@ -0,0 +1,6 @@+data A = A+  {+    -- |+    -- +    a :: Int+  }
+ data/examples/declaration/data/record-fancy-existential-out.hs view
@@ -0,0 +1,6 @@+{-# LANGUAGE ExistentialQuantification #-}++data Foo = forall a b. (Show a, Eq b) => Bar+  { foo :: a,+    bars :: b+  }
+ data/examples/declaration/data/record-fancy-existential.hs view
@@ -0,0 +1,5 @@+{-# LANGUAGE ExistentialQuantification #-}+data Foo = forall a b . (Show a, Eq b) => Bar+  { foo  :: a+  , bars :: b+  }
data/examples/declaration/data/record-out.hs view
@@ -12,7 +12,7 @@     fooGag,     fooGog ::       NonEmpty-        ( Indentity+        ( Identity             Bool         ),     -- | Huh!
data/examples/declaration/data/record.hs view
@@ -6,7 +6,7 @@   { fooX :: Int -- ^ X   , fooY :: Int -- ^ Y   , fooBar, fooBaz :: NonEmpty (Identity Bool) -- ^ BarBaz-  , fooGag, fooGog :: NonEmpty (Indentity+  , fooGag, fooGog :: NonEmpty (Identity                                   Bool)     -- ^ GagGog   , fooFoo
+ data/examples/declaration/data/required-type-arguments-out.hs view
@@ -0,0 +1,27 @@+data T a where+  Typed :: forall a -> a -> T a++f1 (Typed a x) = x :: a++f2 (Typed Int n) = n * 2++f3 (Typed ((->) w Bool) g) = not . g++data D x where+  MkD1 ::+    forall a b ->+    a ->+    b ->+    D (a, b)+  MkD2 ::+    forall a.+    forall b ->+    a ->+    b ->+    D (a, b)+  MkD3 ::+    forall a ->+    a ->+    forall b ->+    b ->+    D (a, b)
+ data/examples/declaration/data/required-type-arguments.hs view
@@ -0,0 +1,24 @@+data T a where+  Typed :: forall a -> a -> T a++f1 (Typed a x) = x :: a+f2 (Typed Int n) = n*2+f3 (Typed ((->) w Bool) g) = not . g++data D x where+  MkD1 :: forall a b ->+          a ->+          b ->+          D (a, b)++  MkD2 :: forall a.+          forall b ->+          a ->+          b ->+          D (a, b)++  MkD3 :: forall a ->+          a ->+          forall b ->+          b ->+          D (a, b)
data/examples/declaration/data/simple-broken-out.hs view
@@ -1,7 +1,8 @@ module Main where  -- | Here we go.-data Foo = Foo {unFoo :: Int}+data Foo+  = Foo {unFoo :: Int}   deriving (Eq)  -- | And once again.
+ data/examples/declaration/data/single-constructor-with-haddock-out.hs view
@@ -0,0 +1,7 @@+data FutureSumType+  = -- | This is what the documentation for this type looks like.+    -- It is pretty awkward that the @--@s aren't aligned.+    SingleConstructor+    { someRecordField :: Bool,+      someOtherRecordField :: Int+    }
+ data/examples/declaration/data/single-constructor-with-haddock.hs view
@@ -0,0 +1,6 @@+data FutureSumType = -- | This is what the documentation for this type looks like.+  -- It is pretty awkward that the @--@s aren't aligned.+  SingleConstructor+  { someRecordField :: Bool,+    someOtherRecordField :: Int+  }
+ data/examples/declaration/data/type-data-out.hs view
@@ -0,0 +1,8 @@+type data Universe = Character | Number | Boolean++type data Maybe a+  = Just a+  | Nothing++type data P :: Type -> Type -> Type where+  MkP :: (a ~ Natural, b ~~ Char) => P a b
+ data/examples/declaration/data/type-data.hs view
@@ -0,0 +1,7 @@+type data Universe = Character | Number | Boolean++type data Maybe a = Just a+                  | Nothing++type data P :: Type -> Type -> Type where+  MkP :: (a ~ Natural, b ~~ Char) => P a b
data/examples/declaration/data/unnamed-field-comment-0-out.hs view
@@ -1,7 +1,7 @@ data Foo   = -- | Bar     Bar+      -- | Field 1       Field1-      -- ^ Field 1+      -- | Field 2       Field2-      -- ^ Field 2
data/examples/declaration/data/unnamed-field-comment-1-out.hs view
@@ -1,5 +1,5 @@ data X   = B+      -- | y       !Int-      -- ^ y       C
+ data/examples/declaration/data/unnamed-field-comment-2-out.hs view
@@ -0,0 +1,11 @@+-- | Describes what sort of dictionary to generate for type class instances+data Evidence+  = -- | An existing named instance+    NamedInstance (Qualified Ident)+  | -- | Computed instances+    WarnInstance+      -- | Warn type class with a user-defined warning message+      SourceType+  | -- | The IsSymbol type class for a given Symbol literal+    IsSymbolInstance PSString+  deriving (Show, Eq)
+ data/examples/declaration/data/unnamed-field-comment-2.hs view
@@ -0,0 +1,9 @@+-- | Describes what sort of dictionary to generate for type class instances+data Evidence+  -- | An existing named instance+  = NamedInstance (Qualified Ident)++  -- | Computed instances+  | WarnInstance SourceType -- ^ Warn type class with a user-defined warning message+  | IsSymbolInstance PSString -- ^ The IsSymbol type class for a given Symbol literal+  deriving (Show, Eq)
+ data/examples/declaration/data/unnamed-field-comment-3-out.hs view
@@ -0,0 +1,1 @@+data A = A {- | a number -} Int Bool
+ data/examples/declaration/data/unnamed-field-comment-3.hs view
@@ -0,0 +1,1 @@+data A = A {- | a number -} Int Bool
+ data/examples/declaration/data/unpack-field-comment-0-out.hs view
@@ -0,0 +1,4 @@+data Buffer+  = Buffer+      {-# UNPACK #-} !(ForeignPtr Word8) -- underlying pinned array+      {-# UNPACK #-} !(Ptr Word8) -- beginning of slice
+ data/examples/declaration/data/unpack-field-comment-0.hs view
@@ -0,0 +1,2 @@+data Buffer = Buffer {-# UNPACK #-} !(ForeignPtr Word8) -- underlying pinned array+                     {-# UNPACK #-} !(Ptr Word8)        -- beginning of slice
+ data/examples/declaration/data/unpack-field-comment-1-out.hs view
@@ -0,0 +1,4 @@+data P+  = P+      {-# UNPACK #-} !Word32 -- left word+      {-# UNPACK #-} !Word32 -- right word
+ data/examples/declaration/data/unpack-field-comment-1.hs view
@@ -0,0 +1,2 @@+data P = P {-# UNPACK #-} !Word32 -- left word+           {-# UNPACK #-} !Word32 -- right word
+ data/examples/declaration/data/unpack-field-comment-2-out.hs view
@@ -0,0 +1,4 @@+data TBQueue a+  = TBQueue+      {-# UNPACK #-} !(TVar Natural) -- CR:  read capacity+      {-# UNPACK #-} !(TVar [a]) -- R:   elements waiting to be read
+ data/examples/declaration/data/unpack-field-comment-2.hs view
@@ -0,0 +1,3 @@+data TBQueue a+   = TBQueue {-# UNPACK #-} !(TVar Natural) -- CR:  read capacity+             {-# UNPACK #-} !(TVar [a])     -- R:   elements waiting to be read
+ data/examples/declaration/data/unpack-field-comment-3-out.hs view
@@ -0,0 +1,4 @@+data Builder+  = Builder+      {-# UNPACK #-} !Int -- offset+      {-# UNPACK #-} !Int -- used units
+ data/examples/declaration/data/unpack-field-comment-3.hs view
@@ -0,0 +1,3 @@+data Builder = Builder+     {-# UNPACK #-} !Int -- offset+     {-# UNPACK #-} !Int -- used units
+ data/examples/declaration/data/wildcard-binders-out.hs view
@@ -0,0 +1,1 @@+data Proxy _ = Proxy
+ data/examples/declaration/data/wildcard-binders.hs view
@@ -0,0 +1,1 @@+data Proxy _ = Proxy
data/examples/declaration/default/default-out.hs view
@@ -1,3 +1,5 @@+module MyModule (default Monoid) where+ default (Int, Foo, Bar)  default@@ -5,3 +7,9 @@     Foo,     Bar   )++default Num (Int, Float)++default IsList ([], Vector)++default IsString (Text.Text, Foundation.String, String)
data/examples/declaration/default/default.hs view
@@ -1,6 +1,13 @@+module MyModule (default Monoid) where+ default        (  Int , Foo     , Bar      )  default ( Int                , Foo,   Bar            )++default Num (Int, Float)+default IsList ([], Vector)++default IsString (Text.Text, Foundation.String, String)
+ data/examples/declaration/foreign/foreign-import-multiline-out.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE MultilineStrings #-}++foreign import capi+  """+  foo+     bar+  """+  foo :: Int -> Int
+ data/examples/declaration/foreign/foreign-import-multiline.hs view
@@ -0,0 +1,6 @@+{-# language MultilineStrings #-}++foreign import capi """+         foo+            bar+     """ foo :: Int -> Int
data/examples/declaration/instance/contexts-out.hs view
@@ -1,4 +1,4 @@-instance Eq a => Eq [a] where (==) _ _ = False+instance (Eq a) => Eq [a] where (==) _ _ = False  instance   ( Ord a,
data/examples/declaration/instance/newlines-between-methods-out.hs view
@@ -1,4 +1,4 @@-instance Num a => Num (Diff a) where+instance (Num a) => Num (Diff a) where   D u dudx + D v dvdx = D (u + v) (dudx + dvdx)   D u dudx - D v dvdx = D (u - v) (dudx - dvdx)   D u dudx * D v dvdx = D (u * v) (u * dvdx + v * dudx)
+ data/examples/declaration/rewrite-rule/never-active-out.hs view
@@ -0,0 +1,1 @@+{-# RULES "map-loop" [~] forall f. map' f = map' (id . f) #-}
+ data/examples/declaration/rewrite-rule/never-active.hs view
@@ -0,0 +1,1 @@+{-# RULES "map-loop" [ ~  ]  forall f . map' f = map' (id . f) #-}
data/examples/declaration/rewrite-rule/prelude2-out.hs view
@@ -11,7 +11,7 @@ -- when we disable the rule that expands (++) into foldr  -- The foldr/cons rule looks nice, but it can give disastrously--- bloated code when commpiling+-- bloated code when compiling --      array (a,b) [(1,2), (2,2), (3,2), ...very long list... ] -- i.e. when there are very very long literal lists -- So I've disabled it for now. We could have special cases
data/examples/declaration/rewrite-rule/prelude2.hs view
@@ -11,7 +11,7 @@         -- when we disable the rule that expands (++) into foldr  -- The foldr/cons rule looks nice, but it can give disastrously--- bloated code when commpiling+-- bloated code when compiling --      array (a,b) [(1,2), (2,2), (3,2), ...very long list... ] -- i.e. when there are very very long literal lists -- So I've disabled it for now. We could have special cases
data/examples/declaration/rewrite-rule/prelude4-out.hs view
@@ -2,6 +2,7 @@ "unpack" [~1] forall a. unpackCString # a = build (unpackFoldrCString # a) "unpack-list" [1] forall a. unpackFoldrCString # a (:) [] = unpackCString # a "unpack-append" forall a n. unpackFoldrCString # a (:) n = unpackAppendCString # a n+ -- There's a built-in rule (in PrelRules.lhs) for --      unpackFoldr "foo" c (unpackFoldr "baz" c n)  =  unpackFoldr "foobaz" c n   #-}
data/examples/declaration/rewrite-rule/type-signature-out.hs view
@@ -8,9 +8,7 @@   z   ( g ::       forall b.-      (a -> b -> b) ->-      b ->-      b+      (a -> b -> b) -> b -> b   ).   foldr k z (build g) =     g k z
data/examples/declaration/signature/fixity/infix-out.hs view
@@ -1,3 +1,9 @@ infix 0 <?>  infix 9 <^-^>++infix 2 ->++infix 0 type <!>++infix 9 +
data/examples/declaration/signature/fixity/infix.hs view
@@ -1,2 +1,8 @@ infix 0 <?> infix 9 <^-^>++infix 2 ->++infix 0 type <!>++infix +
data/examples/declaration/signature/fixity/infixl-out.hs view
@@ -1,3 +1,5 @@ infixl 8 ***  infixl 0 $, *, +, &&, **++infixl 9 type $
data/examples/declaration/signature/fixity/infixl.hs view
@@ -1,2 +1,4 @@ infixl 8 *** infixl 0 $, *, +, &&, **++infixl 9 type $
data/examples/declaration/signature/fixity/infixr-out.hs view
@@ -1,3 +1,5 @@ infixr 8 `Foo`  infixr 0 ***, &&&++infixr 0 data $
data/examples/declaration/signature/fixity/infixr.hs view
@@ -1,2 +1,4 @@ infixr 8 `Foo` infixr 0 ***, &&&++infixr 0 data $
data/examples/declaration/signature/inline/noinline-out.hs view
@@ -9,3 +9,7 @@ baz :: Int -> Int baz = id {-# NOINLINE [~2] baz #-}++blub :: Int -> Int+blub = baz+{-# OPAQUE blub #-}
data/examples/declaration/signature/inline/noinline.hs view
@@ -11,3 +11,7 @@ baz = id  {-#   NOINLINE    [~2] baz #-}++blub :: Int -> Int+blub = baz+{-# opaque blub #-}
+ data/examples/declaration/signature/specialize/specialize-2-out.hs view
@@ -0,0 +1,8 @@+{-# SPECIALIZE addMult @Double #-}+{-# SPECIALIZE addMult (5 :: Int) #-}+{-# SPECIALIZE addMult 5 :: Int -> Int #-}++{-# SPECIALIZE [1] forall x y. f @Int True (x, y) #-}++{-# SPECIALIZE forall x xs. loop (x : xs)+  #-}
+ data/examples/declaration/signature/specialize/specialize-2.hs view
@@ -0,0 +1,9 @@+{-# SPECIALISE addMult @Double #-}+{-# SPECIALISE addMult (5 :: Int) #-}+{-# SPECIALISE addMult 5 :: Int -> Int #-}++{-# SPECIALISE [1] forall x y. f @Int True (x,y) #-}++{-# SPECIALISE+  forall x xs .+  loop (x:xs) #-}
+ data/examples/declaration/signature/specialize/specialize-3-out.hs view
@@ -0,0 +1,10 @@+sep, fsep, hsep :: (Applicative m, Foldable t) => t (m Doc) -> m Doc+sep = fmap P.sep . sequenceAFoldable+{-# SPECIALIZE NOINLINE sep :: [TCM Doc] -> TCM Doc #-}+{-# SPECIALIZE NOINLINE sep :: List1 (TCM Doc) -> TCM Doc #-}+fsep = fmap P.fsep . sequenceAFoldable+{-# SPECIALIZE NOINLINE [2] fsep :: [TCM Doc] -> TCM Doc #-}+{-# SPECIALIZE NOINLINE [2] fsep :: List1 (TCM Doc) -> TCM Doc #-}+hsep = fmap P.hsep . sequenceAFoldable+{-# SPECIALIZE NOINLINE [~2] hsep :: [TCM Doc] -> TCM Doc #-}+{-# SPECIALIZE NOINLINE [~2] hsep :: List1 (TCM Doc) -> TCM Doc #-}
+ data/examples/declaration/signature/specialize/specialize-3.hs view
@@ -0,0 +1,4 @@+sep, fsep, hsep :: (Applicative m, Foldable t) => t (m Doc) -> m Doc+sep  = fmap P.sep  . sequenceAFoldable  ; {-# SPECIALIZE NOINLINE sep  :: [TCM Doc] -> TCM Doc #-} ; {-# SPECIALIZE NOINLINE sep  :: List1 (TCM Doc) -> TCM Doc #-}+fsep = fmap P.fsep . sequenceAFoldable  ; {-# SPECIALIZE NOINLINE [2] fsep :: [TCM Doc] -> TCM Doc #-} ; {-# SPECIALIZE NOINLINE [2] fsep :: List1 (TCM Doc) -> TCM Doc #-}+hsep = fmap P.hsep . sequenceAFoldable  ; {-# SPECIALIZE NOINLINE [~2] hsep :: [TCM Doc] -> TCM Doc #-} ; {-# SPECIALIZE NOINLINE [~2] hsep :: List1 (TCM Doc) -> TCM Doc #-}
data/examples/declaration/signature/specialize/specialize-instance-out.hs view
@@ -8,7 +8,6 @@  instance (Num r, V.Vector v r, Factored m r) => Num (VT v m r) where   {-# SPECIALIZE instance-    ( Factored m Int => Num (VT U.Vector m Int)-    )+    ((Factored m Int) => Num (VT U.Vector m Int))     #-}   VT x + VT y = VT $ V.zipWith (+) x y
data/examples/declaration/signature/specialize/specialize-out.hs view
@@ -1,13 +1,13 @@-foo :: Num a => a -> a+foo :: (Num a) => a -> a foo = id {-# SPECIALIZE foo :: Int -> Int #-} {-# SPECIALIZE INLINE foo :: Float -> Float #-}  {-# SPECIALIZE NOINLINE [2] bar :: Int -> Int #-}-bar :: Num a => a -> a+bar :: (Num a) => a -> a bar = id -baz :: Num a => a -> a+baz :: (Num a) => a -> a baz = id {-# SPECIALIZE [~2] baz ::   Int ->@@ -20,5 +20,5 @@   Bool,   Integer -> Bool   #-}-fits13Bits :: Integral a => a -> Bool+fits13Bits :: (Integral a) => a -> Bool fits13Bits x = x >= -4096 && x < 4096
data/examples/declaration/signature/type/unicode-out.hs view
@@ -1,4 +1,4 @@ {-# LANGUAGE UnicodeSyntax #-} -foo :: forall a. Show a => a -> String+foo :: forall a. (Show a) => a -> String foo = const ()
+ data/examples/declaration/splice/bracket-unicode-out.hs view
@@ -0,0 +1,6 @@+{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE UnicodeSyntax #-}++ascii = [|x|]++unicode = [|x|]
+ data/examples/declaration/splice/bracket-unicode.hs view
@@ -0,0 +1,6 @@+{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE UnicodeSyntax   #-}++ascii = [|x|]++unicode = ⟦x⟧
data/examples/declaration/splice/quasiquote-out.hs view
@@ -10,3 +10,7 @@ [d|    foo bar  |]++header =+  [here|+#include foo|]
data/examples/declaration/splice/quasiquote.hs view
@@ -9,3 +9,6 @@ [d|    foo bar  |]++header = [here|+#include foo|]
data/examples/declaration/splice/typed-splice-out.hs view
@@ -1,7 +1,6 @@ {-# LANGUAGE TemplateHaskell #-}  x =-  $$( foo bar-    )+  $$(foo bar)  x = $$foo
data/examples/declaration/type-families/closed-type-family/multi-line-out.hs view
@@ -23,3 +23,7 @@   F Bool =     Char   F a = String++type family F a where+  F a = -- foo+    a
data/examples/declaration/type-families/closed-type-family/multi-line.hs view
@@ -12,3 +12,7 @@   F Bool =            Char   F a    = String++type family F a where+  F a -- foo+    = a
+ data/examples/declaration/type-families/closed-type-family/promotion-out.hs view
@@ -0,0 +1,2 @@+type family Foo a where+  Foo '( 'x', a) = a
+ data/examples/declaration/type-families/closed-type-family/promotion.hs view
@@ -0,0 +1,2 @@+type family Foo a where+  Foo '( 'x', a) = a
+ data/examples/declaration/type-families/closed-type-family/with-comments-out.hs view
@@ -0,0 +1,10 @@+type family LT a b where+  -- 0+  LT 0 _ = True+  -- 1+  LT 1 0 = False+  LT 1 _ = True+  -- 2+  LT 2 0 = False+  LT 2 1 = False+  LT 2 _ = True
+ data/examples/declaration/type-families/closed-type-family/with-comments.hs view
@@ -0,0 +1,12 @@+type family LT a b where+  -- 0+  LT 0 _ = True++  -- 1+  LT 1 0 = False+  LT 1 _ = True++  -- 2+  LT 2 0 = False+  LT 2 1 = False+  LT 2 _ = True
data/examples/declaration/type-synonyms/multi-line-out.hs view
@@ -1,3 +1,5 @@+import Servant.API+ type Foo a b c =   Bar c a b @@ -16,3 +18,6 @@   "route1" :> ApiRoute1     :<|> "route2" :> ApiRoute2 -- comment here     :<|> OmitDocs :> "i" :> ASomething API++type A = -- foo+  B
data/examples/declaration/type-synonyms/multi-line.hs view
@@ -1,3 +1,5 @@+import Servant.API+ type Foo a b c   = Bar c a b @@ -15,3 +17,6 @@   = "route1" :> ApiRoute1       :<|> "route2" :> ApiRoute2 -- comment here       :<|> OmitDocs :> "i" :> ASomething API++type A -- foo+  = B
+ data/examples/declaration/type/parens-comments-out.hs view
@@ -0,0 +1,4 @@+type Test =+  ( -- a+    x+  )
+ data/examples/declaration/type/parens-comments.hs view
@@ -0,0 +1,3 @@+type Test = (+  -- a+  x)
data/examples/declaration/type/promotion-1-out.hs view
@@ -13,3 +13,7 @@ type E = TypeError ('Text "Some text")  type G = '[ '( 'Just, 'Bool)]++type X = () '`PromotedInfix` ()++type A = '[ 'a']
data/examples/declaration/type/promotion-1.hs view
@@ -7,3 +7,7 @@  type E = TypeError ('Text "Some text") type G = '[ '( 'Just, 'Bool) ]++type X = () '`PromotedInfix` ()++type A = '[ 'a' ]
+ data/examples/declaration/type/promotion-no-puns-out.hs view
@@ -0,0 +1,5 @@+{-# LANGUAGE NoListTuplePuns #-}++type X = (Int, String)++type Y = [String, Int]
+ data/examples/declaration/type/promotion-no-puns.hs view
@@ -0,0 +1,5 @@+{-# Language NoListTuplePuns #-}++type X = (Int, String)++type Y = [String, Int]
+ data/examples/declaration/type/wildcard-binders-out.hs view
@@ -0,0 +1,1 @@+type Const a _ = a
+ data/examples/declaration/type/wildcard-binders.hs view
@@ -0,0 +1,1 @@+type Const a _ = a
data/examples/declaration/value/function/application-1-out.hs view
@@ -1,19 +1,19 @@ main =   do-    x-    y-   z+      x+      y+    z  main =   case foo of-    x -> a-   foo-   a-   b+      x -> a+    foo+    a+    b  main =   do-    if x then y else z-   foo-   a-   b+      if x then y else z+    foo+    a+    b
data/examples/declaration/value/function/application-2-out.hs view
@@ -1,13 +1,11 @@ {-# LANGUAGE TemplateHaskell #-}  foo = do-  $( bar-   )+  $(bar)     baz  foo = do-  $$( bar-    )+  $$(bar)     baz  foo = do@@ -16,8 +14,8 @@  foo = do   do-    (+ 1)-   2+      (+ 1)+    2  foo = do   case () of () -> (+ 1)@@ -25,8 +23,8 @@  foo = do   case () of-    () -> (+ 1)-   2+      () -> (+ 1)+    2  foo = do   \case 2 -> 3@@ -34,5 +32,5 @@  foo = do   \case-    2 -> 3-   2+      2 -> 3+    2
data/examples/declaration/value/function/arrow/proc-applications2-out.hs view
@@ -8,4 +8,5 @@       LT -> \a -> returnA -< x + a       EQ -> \b -> returnA -< y + z + b       GT -> \c -> returnA -< z + x-  ) 1+  )+    1
data/examples/declaration/value/function/arrow/proc-do-complex-out.hs view
@@ -12,7 +12,7 @@         )     -> do       -- Begin do-      (x, y) <- -- GHC parser fails if layed out over multiple lines+      (x, y) <- -- GHC parser fails if laid out over multiple lines         f -- Call into f           ( a,             c -- Tuple together arguments@@ -58,5 +58,8 @@             -<               ( i                   + x-                  * y -- Just do the calculation+                    * y -- Just do the calculation               )++traverseA_ f = proc (e, (xs, s)) ->+  (| foldlA' (\() x -> do (e, (x, s)) >- f; () >- returnA) |) () xs
data/examples/declaration/value/function/arrow/proc-do-complex.hs view
@@ -9,7 +9,7 @@         (e, f)       ) ->     do -- Begin do-        (x,y) -- GHC parser fails if layed out over multiple lines+        (x,y) -- GHC parser fails if laid out over multiple lines          <- f -- Call into f               (a,                c) -- Tuple together arguments@@ -47,3 +47,6 @@           returnA -< (i +                       x *                       y) -- Just do the calculation++traverseA_ f = proc (e, (xs, s)) ->+  (| foldlA' (\() x -> do { (e, (x, s)) >- f; () >- returnA }) |) () xs
data/examples/declaration/value/function/arrow/proc-do-simple1-out.hs view
@@ -1,7 +1,6 @@ {-# LANGUAGE Arrows #-} -bar f = proc a -> do-  b <- f -< a+bar f = proc a -> do b <- f -< a  barbar f g = proc a -> do   b <- f -< a@@ -16,3 +15,15 @@     f       -<         a++foo =+  proc x ->+    do+        returnA -< x+      1++foo a =+  proc x ->+    case Left x of+        Left x -> returnA -< x+      a
data/examples/declaration/value/function/arrow/proc-do-simple1.hs view
@@ -18,3 +18,13 @@        -<        a +foo =+  proc x -> do+    returnA -< x+   1++foo a =+  proc x ->+    case Left x of+      Left x -> returnA -< x+     a
data/examples/declaration/value/function/arrow/proc-do-simple2-out.hs view
@@ -1,7 +1,6 @@ {-# LANGUAGE Arrows #-} -foo f = proc a -> do-  f -< a+foo f = proc a -> do f -< a  bazbaz f g h = proc (a, b, c) -> do   x <-@@ -20,3 +19,5 @@   returnA     -<       (x, y, z)++bar f = proc x -> do { f -< x } <+> do f -< x
data/examples/declaration/value/function/arrow/proc-do-simple2.hs view
@@ -18,3 +18,5 @@        )      returnA -<        (x, y, z)++bar f = proc x -> do {f -< x} <+> do f -< x
data/examples/declaration/value/function/arrow/proc-form-do-indent-out.hs view
@@ -10,4 +10,12 @@   (|     bar       (bindA -< y)-    |) z+    |)+    z++foo2 = proc () -> do+  ( proc () ->+      returnA -< ()+    )+    -<+      ()
data/examples/declaration/value/function/arrow/proc-form-do-indent.hs view
@@ -11,3 +11,8 @@     bar       (bindA -< y)     |) z++foo2 = proc () -> do+  (proc () ->+    returnA -< ()+    ) -< ()
data/examples/declaration/value/function/arrow/proc-forms2-out.hs view
@@ -15,27 +15,32 @@     ( (h f . h g)         -<           (y x) . y z-    ) |||-      ( (h g . h f)-          -<-            y z . (y x)-      )+    )+      ||| ( (h g . h f)+              -<+                y z . (y x)+          )  bar4 = proc x ->   case x of     Just f -> f -< ()     Nothing -> x -< ()-  <+> do-    g -< x+    <+> do+      g -< x  expr' = proc x ->   do     returnA -< x-  <+> do-    symbol Plus -< ()-    y <- term -< ()-    expr' -< x + y-  <+> do-    symbol Minus -< ()-    y <- term -< ()-    expr' -< x - y+    <+> do+      symbol Plus -< ()+      y <- term -< ()+      expr' -< x + y+    <+> do+      symbol Minus -< ()+      y <- term -< ()+      expr' -< x - y++bar f = proc (a, b) -> do+  (f a -< b)+    >-> (\y -> f b >- a)+    >-> (\y -> f b >- a)
data/examples/declaration/value/function/arrow/proc-forms2.hs view
@@ -34,3 +34,8 @@                 symbol Minus -< ()                 y <- term -< ()                 expr' -< x - y++bar f = proc (a, b) -> do+    (f a -< b)+      >-> (\y -> f b >- a)+      >-> (\y -> f b >- a)
data/examples/declaration/value/function/arrow/proc-parentheses-out.hs view
@@ -4,8 +4,7 @@  bar f g = proc a ->   ( ( (f)-        ( g-        )+        (g)     )       -<         ( ( ( ( ( ( g
data/examples/declaration/value/function/awkward-comment-0-out.hs view
@@ -1,6 +1,5 @@ mergeErrorReply :: ParseError -> Reply s u a -> Reply s u a-mergeErrorReply err1 reply -- XXX where to put it?-  =+mergeErrorReply err1 reply = -- XXX where to put it?   case reply of     Ok x state err2 -> Ok x state (mergeError err1 err2)     Error err2 -> Error (mergeError err1 err2)
data/examples/declaration/value/function/awkward-comment-1-out.hs view
@@ -1,8 +1,7 @@ doForeign :: Vars -> [Name] -> [Term] -> Idris LExp doForeign x = x   where-    splitArg tm | (_, [_, _, l, r]) <- unApply tm -- pair, two implicits-      =+    splitArg tm | (_, [_, _, l, r]) <- unApply tm = -- pair, two implicits       do         let l' = toFDesc l         r' <- irTerm (sMN 0 "__foreignCall") vs env r
data/examples/declaration/value/function/block-arguments-out.hs view
@@ -32,3 +32,5 @@   do a   do b   do c++f11 = do a do b do c do d
data/examples/declaration/value/function/block-arguments.hs view
@@ -28,3 +28,5 @@   do { a }   do { b }   do c++f11 = do a do b do c do d
+ data/examples/declaration/value/function/case-comment-after-pattern-out.hs view
@@ -0,0 +1,3 @@+foo = case a of+  b -> -- comment+    c
+ data/examples/declaration/value/function/case-comment-after-pattern.hs view
@@ -0,0 +1,3 @@+foo = case a of+  b -- comment+    -> c
+ data/examples/declaration/value/function/case-comment-between-alt-and-where-out.hs view
@@ -0,0 +1,6 @@+foo =+  case x of+    _ -> 1+  -- comment+  where+    x = 1
+ data/examples/declaration/value/function/case-comment-between-alt-and-where.hs view
@@ -0,0 +1,6 @@+foo =+  case x of+    _ -> 1+    -- comment+    where+      x = 1
+ data/examples/declaration/value/function/case-empty-out.hs view
@@ -0,0 +1,6 @@+absurd x = case x of {}+absurd = \case {}+absurd x = case x of {}+absurd = \case {}++foo = case () of {} 1
+ data/examples/declaration/value/function/case-empty.hs view
@@ -0,0 +1,6 @@+absurd x = case x of+absurd = \case+absurd x = case x of {}+absurd = \case {}++foo = case () of {} 1
data/examples/declaration/value/function/case-multi-line-guards-out.hs view
@@ -3,8 +3,8 @@   case x of     x       | x > 10 ->-        foo-          + bar+          foo+            + bar     x | x > 5 -> 10     _ -> 20 
data/examples/declaration/value/function/case-multi-line-out.hs view
@@ -21,7 +21,6 @@ quux x = case x of   x -> x -funnyComment =-  -- comment+funnyComment = -- comment   case () of     () -> ()
+ data/examples/declaration/value/function/case-single-line-with-braces-out.hs view
@@ -0,0 +1,2 @@+getValue :: Maybe Int -> Int+getValue x = case x of Just n -> n; Nothing -> 0
+ data/examples/declaration/value/function/case-single-line-with-braces.hs view
@@ -0,0 +1,2 @@+getValue :: Maybe Int -> Int+getValue x = case x of {Just n -> n; Nothing -> 0}
+ data/examples/declaration/value/function/case-with-comment-before-where-out.hs view
@@ -0,0 +1,14 @@+foo =+  case x of+    _ -> 1+  -- comment+  where+    -- comment 2+    x = 1++foo = case x of+  _ -> 1+  -- comment+  where+    -- comment 2+    x = 1
+ data/examples/declaration/value/function/case-with-comment-before-where.hs view
@@ -0,0 +1,14 @@+foo =+  case x of+    _ -> 1+    -- comment+    where+      -- comment 2+      x = 1++foo = case x of+    _ -> 1+    -- comment+    where+      -- comment 2+      x = 1
data/examples/declaration/value/function/comprehension/transform-monad-out.hs view
@@ -5,14 +5,14 @@   [ ( x,       y     )-    | x <- xs,-      y <- ys,-      then group by-        -- First comment-        ( x-            + y-        )-      using-        -- Second comment-        groupWith -- Third comment+  | x <- xs,+    y <- ys,+    then group by+      -- First comment+      ( x+          + y+      )+    using+      -- Second comment+      groupWith -- Third comment   ]
data/examples/declaration/value/function/comprehension/transform-multi-line1-out.hs view
@@ -4,9 +4,9 @@   [ ( x,       y     )-    | x <- xs,-      y <- ys,-      then-        -- First comment-        reverse -- Second comment+  | x <- xs,+    y <- ys,+    then+      -- First comment+      reverse -- Second comment   ]
data/examples/declaration/value/function/comprehension/transform-multi-line2-out.hs view
@@ -4,13 +4,13 @@   [ ( x,       y     )-    | x <- xs,-      y <- ys,-      then-        -- First comment-        sortWith-      by-        ( x-            + y -- Second comment-        )+  | x <- xs,+    y <- ys,+    then+      -- First comment+      sortWith+    by+      ( x+          + y -- Second comment+      )   ]
data/examples/declaration/value/function/comprehension/transform-multi-line3-out.hs view
@@ -4,9 +4,9 @@   [ ( x,       y     )-    | x <- xs,-      y <- ys,-      then group using-        -- First comment-        permutations -- Second comment+  | x <- xs,+    y <- ys,+    then group using+      -- First comment+      permutations -- Second comment   ]
data/examples/declaration/value/function/comprehension/transform-multi-line4-out.hs view
@@ -4,14 +4,14 @@   [ ( x,       y     )-    | x <- xs,-      y <- ys,-      then group by-        -- First comment-        ( x-            + y-        )-      using-        -- Second comment-        groupWith -- Third comment+  | x <- xs,+    y <- ys,+    then group by+      -- First comment+      ( x+          + y+      )+    using+      -- Second comment+      groupWith -- Third comment   ]
+ data/examples/declaration/value/function/do-multiline-with-case-out.hs view
@@ -0,0 +1,13 @@+handleInput :: IO ()+handleInput = do+  putStrLn "Enter command:"+  cmd <- getLine+  case cmd of+    "quit" -> putStrLn "Goodbye"+    "help" -> do+      putStrLn "Available commands:"+      putStrLn "  quit - exit the program"+      putStrLn "  help - show this message"+    _ -> do+      putStrLn $ "Unknown command: " ++ cmd+      handleInput
+ data/examples/declaration/value/function/do-multiline-with-case.hs view
@@ -0,0 +1,13 @@+handleInput :: IO ()+handleInput = do+  putStrLn "Enter command:"+  cmd <- getLine+  case cmd of+    "quit" -> putStrLn "Goodbye"+    "help" -> do+      putStrLn "Available commands:"+      putStrLn "  quit - exit the program"+      putStrLn "  help - show this message"+    _ -> do+      putStrLn $ "Unknown command: " ++ cmd+      handleInput
+ data/examples/declaration/value/function/do-single-line-case-guards-out.hs view
@@ -0,0 +1,2 @@+checkValue :: Int -> IO ()+checkValue n = do putStr "Value is: "; case () of { _ | n < 0 -> putStrLn "negative" | n == 0 -> putStrLn "zero" | otherwise -> putStrLn "positive" }
+ data/examples/declaration/value/function/do-single-line-case-guards.hs view
@@ -0,0 +1,2 @@+checkValue :: Int -> IO ()+checkValue n = do {putStr "Value is: "; case () of {_ | n < 0 -> putStrLn "negative" | n == 0 -> putStrLn "zero" | otherwise -> putStrLn "positive"}}
+ data/examples/declaration/value/function/do-single-line-lambda-case-out.hs view
@@ -0,0 +1,2 @@+processValue :: Maybe Int -> IO ()+processValue x = do putStrLn "Processing:"; \case { Just n -> print n; Nothing -> putStrLn "Empty" } x; putStrLn "Done"
+ data/examples/declaration/value/function/do-single-line-lambda-case.hs view
@@ -0,0 +1,2 @@+processValue :: Maybe Int -> IO ()+processValue x = do {putStrLn "Processing:"; \case {Just n -> print n; Nothing -> putStrLn "Empty"} x; putStrLn "Done"}
+ data/examples/declaration/value/function/do-single-line-multiple-cases-out.hs view
@@ -0,0 +1,2 @@+processPair :: Maybe Int -> Maybe String -> IO ()+processPair x y = do case x of { Just n -> print n; Nothing -> putStrLn "No number" }; case y of { Just s -> putStrLn s; Nothing -> putStrLn "No string" }
+ data/examples/declaration/value/function/do-single-line-multiple-cases.hs view
@@ -0,0 +1,2 @@+processPair :: Maybe Int -> Maybe String -> IO ()+processPair x y = do {case x of {Just n -> print n; Nothing -> putStrLn "No number"}; case y of {Just s -> putStrLn s; Nothing -> putStrLn "No string"}}
+ data/examples/declaration/value/function/do-single-line-nested-case-out.hs view
@@ -0,0 +1,2 @@+nestedDo :: Either String Int -> IO ()+nestedDo e = do putStr "Start: "; case e of { Left s -> do { putStr "Error: "; putStrLn s }; Right n -> do { putStr "Value: "; print n } }; putStrLn "End"
+ data/examples/declaration/value/function/do-single-line-nested-case.hs view
@@ -0,0 +1,2 @@+nestedDo :: Either String Int -> IO ()+nestedDo e = do {putStr "Start: "; case e of {Left s -> do {putStr "Error: "; putStrLn s}; Right n -> do {putStr "Value: "; print n}}; putStrLn "End"}
+ data/examples/declaration/value/function/do-single-line-with-case-out.hs view
@@ -0,0 +1,2 @@+doGuessing :: (Ord t, Read t) => t -> IO ()+doGuessing num = do putStrLn "Enter your guess:"; guess <- getLine; case compare (read guess) num of { LT -> do { putStrLn "Too low!"; doGuessing num }; GT -> do { putStrLn "Too high!"; doGuessing num }; EQ -> putStrLn "You win!" }
+ data/examples/declaration/value/function/do-single-line-with-case.hs view
@@ -0,0 +1,2 @@+doGuessing :: (Ord t, Read t) => t -> IO ()+doGuessing num = do {putStrLn "Enter your guess:"; guess <- getLine; case compare (read guess) num of {LT -> do {putStrLn "Too low!"; doGuessing num}; GT -> do { putStrLn "Too high!"; doGuessing num}; EQ -> putStrLn "You win!"}}
+ data/examples/declaration/value/function/do/do-dollar-mixed-chain-out.hs view
@@ -0,0 +1,23 @@+module A (a) where++a :: Int+a = do+  f+    . do+      g+    $ do+      1+        + 2+          * 3+    $ ( 6+          * 5+          + 4+      )++b =+  f a <> 1 + 2 <> do+    3++c =+  f b $ 1 + 2 $ do+    3
+ data/examples/declaration/value/function/do/do-dollar-mixed-chain.hs view
@@ -0,0 +1,23 @@+module A (a) where++a :: Int+a = do+    f+     . do+      g+     $ do+      1+       + 2+       * 3+     $ ( 6 *+         5 ++         4+       )++b =+  f a <> 1 + 2 <> do+    3++c =+  f b $ 1 + 2 $ do+    3
data/examples/declaration/value/function/fancy-forall-0-out.hs view
@@ -2,9 +2,8 @@   forall outertag innertag t outer inner m a.   ( forall x. Coercible (t m x) (m x),     forall m'.-    HasCatch outertag outer m' =>+    (HasCatch outertag outer m') =>     HasCatch innertag inner (t m'),     HasCatch outertag outer m   ) =>-  (forall m'. HasCatch innertag inner m' => m' a) ->-  m a+  (forall m'. (HasCatch innertag inner m') => m' a) -> m a
data/examples/declaration/value/function/fancy-forall-1-out.hs view
@@ -2,9 +2,8 @@   forall outertag innertag t outer inner m a.   ( forall x. Coercible (t m x) (m x),     forall m'.-    HasReader outertag outer m' =>+    (HasReader outertag outer m') =>     HasReader innertag inner (t m'),     HasReader outertag outer m   ) =>-  (forall m'. HasReader innertag inner m' => m' a) ->-  m a+  (forall m'. (HasReader innertag inner m') => m' a) -> m a
data/examples/declaration/value/function/guards-out.hs view
@@ -10,3 +10,5 @@ quux :: Int -> Int quux x | x < 0 = x quux x = x++(a, b) | c = d
data/examples/declaration/value/function/guards.hs view
@@ -10,3 +10,5 @@ quux :: Int -> Int quux x | x < 0 = x quux x = x++(a, b) | c = d
+ data/examples/declaration/value/function/if-single-line-functions-do-out.hs view
@@ -0,0 +1,5 @@+foo x = do+  y <- quux+  if x > 2+    then bar x+    else baz y
+ data/examples/declaration/value/function/if-single-line-functions-do.hs view
@@ -0,0 +1,5 @@+foo x = do+  y <- quux+  if x > 2+    then bar x+    else baz y
+ data/examples/declaration/value/function/if-single-line-functions-out.hs view
@@ -0,0 +1,4 @@+foo x =+  if x > 2+    then bar x+    else baz x
+ data/examples/declaration/value/function/if-single-line-functions.hs view
@@ -0,0 +1,4 @@+foo x =+  if x > 2+    then bar x+    else baz x
+ data/examples/declaration/value/function/if-with-comment-above-branches-out.hs view
@@ -0,0 +1,7 @@+foo =+  if undefined+    -- then comment+    then undefined+    -- else comment+    else do+      undefined
+ data/examples/declaration/value/function/if-with-comment-above-branches.hs view
@@ -0,0 +1,8 @@+foo =+  if undefined+    -- then comment+    then undefined+    -- else comment+    else+      do+        undefined
+ data/examples/declaration/value/function/if-with-comment-before-do-blocks-out.hs view
@@ -0,0 +1,10 @@+foo =+  if something+    -- then comment+    then do+      stuff+      stuff+    -- else comment+    else do+      stuff+      stuff
+ data/examples/declaration/value/function/if-with-comment-before-do-blocks.hs view
@@ -0,0 +1,10 @@+foo =+  if something+    -- then comment+    then do+      stuff+      stuff+    -- else comment+    else do+      stuff+      stuff
+ data/examples/declaration/value/function/if-with-comment-in-branches-out.hs view
@@ -0,0 +1,14 @@+foo =+  if x+    then+      -- comment 1+      -- comment 2+      case a of+        Just b -> _+        Nothing -> _+    else+      -- comment 3+      -- comment 4+      case a of+        Just b -> _+        Nothing -> _
+ data/examples/declaration/value/function/if-with-comment-in-branches-with-functions-out.hs view
@@ -0,0 +1,12 @@+foo =+  if x+    then+      -- comment 1+      -- comment 2+      foo 1 2 3+    else+      -- comment 3+      -- comment 4+      foo+        "here"+        "there"
+ data/examples/declaration/value/function/if-with-comment-in-branches-with-functions.hs view
@@ -0,0 +1,12 @@+foo =+  if x+    then+      -- comment 1+      -- comment 2+      foo 1 2 3+    else+      -- comment 3+      -- comment 4+      foo+        "here"+        "there"
+ data/examples/declaration/value/function/if-with-comment-in-branches.hs view
@@ -0,0 +1,14 @@+foo =+  if x+    then+      -- comment 1+      -- comment 2+      case a of+        Just b -> _+        Nothing -> _+    else+      -- comment 3+      -- comment 4+      case a of+        Just b -> _+        Nothing -> _
+ data/examples/declaration/value/function/if-with-comment-next-to-keyword-out.hs view
@@ -0,0 +1,10 @@+foo =+  if x+    then -- comment 1+    -- comment 2+      foo 1 2 3+    else -- comment 3+    -- comment 4+      foo+        "here"+        "there"
+ data/examples/declaration/value/function/if-with-comment-next-to-keyword.hs view
@@ -0,0 +1,10 @@+foo =+  if x+    then -- comment 1+      -- comment 2+      foo 1 2 3+    else -- comment 3+      -- comment 4+      foo+        "here"+        "there"
− data/examples/declaration/value/function/if-with-comment-out.hs
@@ -1,8 +0,0 @@-foo =-  if undefined-    then -- then comment-      undefined-    else -- else comment--    do-      undefined
− data/examples/declaration/value/function/if-with-comment.hs
@@ -1,8 +0,0 @@-foo =-  if undefined-    -- then comment-    then undefined-    -- else comment-    else-      do-        undefined
data/examples/declaration/value/function/implicit-params-out.hs view
@@ -11,6 +11,5 @@       a -> a -> Bool,     ?foo :: Int   ) =>-  [a] ->-  [a]+  [a] -> [a] sort' = sort
data/examples/declaration/value/function/infix/applicative-out.hs view
@@ -1,4 +1,5 @@ f =-  Foo <$> bar+  Foo+    <$> bar     <*> baz     <*> baz'
+ data/examples/declaration/value/function/infix/dollar-chains-1-out.hs view
@@ -0,0 +1,22 @@+module Main where++foo =+  fmap escapeLeadingDollar+    . dropPaddingSpace+    . dropWhileEnd T.null+    . fmap (T.stripEnd . T.pack)+    . lines+    $ unpackHDS docStr++foo =+  when (GHC.xopt Cpp dynFlags && not cfgTolerateCpp) $+    throwIO (OrmoluCppEnabled path)++foo =+  bar+    $ baz+    $ quux++x =+  case l of { A -> B } $+    case q of r -> s
+ data/examples/declaration/value/function/infix/dollar-chains-1.hs view
@@ -0,0 +1,22 @@+module Main where++foo =+  fmap escapeLeadingDollar+    . dropPaddingSpace+    . dropWhileEnd T.null+    . fmap (T.stripEnd . T.pack)+    . lines+    $ unpackHDS docStr++foo =+  when (GHC.xopt Cpp dynFlags && not cfgTolerateCpp) $+    throwIO (OrmoluCppEnabled path)++foo =+  bar+    $ baz+    $ quux++x =+  case l of { A -> B } $+  case q of r -> s
+ data/examples/declaration/value/function/infix/dollar-chains-2-out.hs view
@@ -0,0 +1,17 @@+module Main where++foo =+  bar+    $ do 1+    $ quux++abc =+  a1 $+    a2 $ do+      3++cde =+  b1 $+    b2 $+      b3 $ \c ->+        putStrLn "foo"
+ data/examples/declaration/value/function/infix/dollar-chains-2.hs view
@@ -0,0 +1,18 @@+module Main where++foo =+  bar $+    do 1+    $+      quux++abc =+  a1 $+    a2 $ do+      3++cde =+  b1+    $ b2+    $ b3 $ \c ->+      putStrLn "foo"
+ data/examples/declaration/value/function/infix/dollar-chains-3-out.hs view
@@ -0,0 +1,11 @@+ex1 =+  f1+    $ arg1+    $ arg2+    $ arg3++ex3 =+  f1+    $ arg1+    $ arg2+    $ 1 + 3
+ data/examples/declaration/value/function/infix/dollar-chains-3.hs view
@@ -0,0 +1,9 @@+ex1 =+  f1 $+    arg1 $+      arg2 $ arg3++ex3 =+  f1 $+    arg1 $+      arg2 $ 1 + 3
+ data/examples/declaration/value/function/infix/dollar-chains-4-out.hs view
@@ -0,0 +1,5 @@+ex2 =+  f1+    $ arg1+    $ arg2+    $ f2 arg3
+ data/examples/declaration/value/function/infix/dollar-chains-4.hs view
@@ -0,0 +1,4 @@+ex2 =+  f1 $+    arg1 $+      arg2 $ f2 arg3
+ data/examples/declaration/value/function/infix/dollar-chains-5-out.hs view
@@ -0,0 +1,11 @@+ex4 =+  f1 $+    arg1 $+      arg2 $ do+        arg3++ex6 =+  f1 $+    arg1 $+      arg2 $+        do arg3
+ data/examples/declaration/value/function/infix/dollar-chains-5.hs view
@@ -0,0 +1,10 @@+ex4 =+  f1 $+    arg1 $+      arg2 $ do+        arg3++ex6 =+  f1 $+    arg1 $+      arg2 $ do arg3
+ data/examples/declaration/value/function/infix/dollar-chains-6-out.hs view
@@ -0,0 +1,11 @@+ex5 =+  f1 $+    arg1 $+      arg2 $ \c ->+        3 * c++ex7 =+  f1 $+    arg1 $+      arg2 $+        \c -> 3 * c
+ data/examples/declaration/value/function/infix/dollar-chains-6.hs view
@@ -0,0 +1,10 @@+ex5 =+  f1 $+    arg1 $+      arg2 $ \c ->+        3 * c++ex7 =+  f1 $+    arg1 $+      arg2 $ \c -> 3 * c
− data/examples/declaration/value/function/infix/dollar-chains-out.hs
@@ -1,22 +0,0 @@-module Main where--foo =-  fmap escapeLeadingDollar-    . dropPaddingSpace-    . dropWhileEnd T.null-    . fmap (T.stripEnd . T.pack)-    . lines-    $ unpackHDS docStr--foo =-  when (GHC.xopt Cpp dynFlags && not cfgTolerateCpp) $-    throwIO (OrmoluCppEnabled path)--foo =-  bar $-    baz $-      quux--x =-  case l of { A -> B } $-    case q of r -> s
− data/examples/declaration/value/function/infix/dollar-chains.hs
@@ -1,22 +0,0 @@-module Main where--foo =-  fmap escapeLeadingDollar-    . dropPaddingSpace-    . dropWhileEnd T.null-    . fmap (T.stripEnd . T.pack)-    . lines-    $ unpackHDS docStr--foo =-  when (GHC.xopt Cpp dynFlags && not cfgTolerateCpp) $-    throwIO (OrmoluCppEnabled path)--foo =-  bar-    $ baz-    $ quux--x =-  case l of { A -> B } $-  case q of r -> s
+ data/examples/declaration/value/function/infix/esqueleto-0-out.hs view
@@ -0,0 +1,12 @@+import Database.Esqueleto.Experimental++foo = select $ do+  t <-+    from $+      table @Bar+        `innerJoin` table @Baz+          `on` do+            \(br :& bz) -> whatever+  where_ $+    t ^. BarInt ==. val 3+      &&. t ^. BarName `in_` valList ["hello", "world"]
+ data/examples/declaration/value/function/infix/esqueleto-0.hs view
@@ -0,0 +1,10 @@+import Database.Esqueleto.Experimental++foo = select $ do+  t <- from $ table @Bar+    `innerJoin` table @Baz+      `on` do+        \(br :& bz) -> whatever+  where_ $+    t ^. BarInt ==. val 3+   &&. t ^. BarName `in_` valList ["hello", "world"]
+ data/examples/declaration/value/function/infix/esqueleto-1-out.hs view
@@ -0,0 +1,9 @@+import qualified Database.Esqueleto.Experimental as E++foo =+  E.from $+    E.table+      `E.innerJoin` E.table+        `E.on` ( \(a :& b) ->+                   a E.^. AField E.==. b E.^. BField+               )
+ data/examples/declaration/value/function/infix/esqueleto-1.hs view
@@ -0,0 +1,9 @@+import qualified Database.Esqueleto.Experimental as E++foo =+  E.from $+    E.table+      `E.innerJoin` E.table+      `E.on` ( \(a :& b) ->+               a E.^. AField E.==. b E.^. BField+             )
+ data/examples/declaration/value/function/infix/fractional-precedence-out.hs view
@@ -0,0 +1,3 @@+startFormTok |~| messageTag+  >~< startMessageTok |~| name+  >~< p' |~| endMessageTok |~| endFormTok
+ data/examples/declaration/value/function/infix/fractional-precedence.hs view
@@ -0,0 +1,3 @@+startFormTok |~| messageTag+  >~< startMessageTok |~| name+  >~< p' |~| endMessageTok |~| endFormTok
+ data/examples/declaration/value/function/infix/hspec-expectation-out.hs view
@@ -0,0 +1,8 @@+import Test.Hspec++my_tests = do+  context "my context" $+    it "does something" $+      property $ \pos xs0 xs1 ->+        FancyError pos xs0 <> FancyError pos xs1+          `shouldBe` (FancyError pos (E.union xs0 xs1) :: PE)
+ data/examples/declaration/value/function/infix/hspec-expectation.hs view
@@ -0,0 +1,8 @@+import Test.Hspec++my_tests = do+  context "my context" $+    it "does something" $+      property $ \pos xs0 xs1 ->+        FancyError pos xs0 <> FancyError pos xs1+          `shouldBe` (FancyError pos (E.union xs0 xs1) :: PE)
data/examples/declaration/value/function/infix/lenses-out.hs view
@@ -1,12 +1,14 @@+import Control.Lens+ lenses =-  Just $-    M.fromList $-      "type" .= ("user.connection" :: Text)-        # "connection" .= uc-        # "user" .= case name of-          Just n -> Just $ object ["name" .= n]-          Nothing -> Nothing-        # []+  Just+    $ M.fromList+    $ "type" .= ("user.connection" :: Text)+      # "connection" .= uc+      # "user" .= case name of+        Just n -> Just $ object ["name" .= n]+        Nothing -> Nothing+      # []  foo =   a@@ -15,7 +17,8 @@  wreq =   let opts =-        defaults & auth ?~ awsAuth AWSv4 "key" "secret"+        defaults+          & auth ?~ awsAuth AWSv4 "key" "secret"           & header "Accept" .~ ["application/json"]           & header "Runscope-Bucket-Auth" .~ ["1example-1111-4yyyy-zzzz-xxxxxxxx"]    in getWith opts
data/examples/declaration/value/function/infix/lenses.hs view
@@ -1,3 +1,5 @@+import Control.Lens+ lenses = Just $ M.fromList   $ "type"       .= ("user.connection" :: Text)   # "connection" .= uc
+ data/examples/declaration/value/function/infix/op-chain-colon-do-out.hs view
@@ -0,0 +1,10 @@+-- chain mixing : and do-blocks+d =+  do+    1+    : do+      2+    : do+      3+    : do+      4
+ data/examples/declaration/value/function/infix/op-chain-colon-do.hs view
@@ -0,0 +1,10 @@+-- chain mixing : and do-blocks+d =+  do+    1+  : do+    2+  : do+    3+  : do+    4
+ data/examples/declaration/value/function/infix/op-chain-l-eq-out.hs view
@@ -0,0 +1,11 @@+-- Left chain, 2 operators with p(a) == p(b)+s :: Int+s =+  1+    + 2+    + 3+    + 4+    - 5+    + 6+    + 7+    + 8
+ data/examples/declaration/value/function/infix/op-chain-l-eq.hs view
@@ -0,0 +1,11 @@+-- Left chain, 2 operators with p(a) == p(b)+s :: Int+s =+  1 ++  2 ++  3 ++  4 -+  5 ++  6 ++  7 ++  8
+ data/examples/declaration/value/function/infix/op-chain-l-gt-out.hs view
@@ -0,0 +1,11 @@+-- Left chain, 2 operators with p(a) > p(b)+t :: Int+t =+  1+    + 2+    + 3+    + 4+    >> 5+      + 6+      + 7+      + 8
+ data/examples/declaration/value/function/infix/op-chain-l-gt.hs view
@@ -0,0 +1,11 @@+-- Left chain, 2 operators with p(a) > p(b)+t :: Int+t =+  1 ++  2 ++  3 ++  4 >>+  5 ++  6 ++  7 ++  8
+ data/examples/declaration/value/function/infix/op-chain-l-lt-out.hs view
@@ -0,0 +1,11 @@+-- Left chain, 2 operators with p(a) < p(b)+u :: Int+u =+  1+    + 2+    + 3+    + 4+      * 5+    + 6+    + 7+    + 8
+ data/examples/declaration/value/function/infix/op-chain-l-lt.hs view
@@ -0,0 +1,11 @@+-- Left chain, 2 operators with p(a) < p(b)+u :: Int+u =+  1 ++  2 ++  3 ++  4 *+  5 ++  6 ++  7 ++  8
+ data/examples/declaration/value/function/infix/op-chain-l-s-out.hs view
@@ -0,0 +1,7 @@+-- Left chain, 1 operator type+r :: Int+r =+  1+    + 2+    + 3+    + 4
+ data/examples/declaration/value/function/infix/op-chain-l-s.hs view
@@ -0,0 +1,7 @@+-- Left chain, 1 operator type+r :: Int+r =+  1 ++  2 ++  3 ++  4
+ data/examples/declaration/value/function/infix/op-chain-r-eq-colon-1-out.hs view
@@ -0,0 +1,11 @@+-- Right chain, : case, 2 operators with p(:) == p(b)+h :: Int+h =+  1+    : 2+    : 3+    : 4+    ++ 5+    : 6+    : 7+    : 8
+ data/examples/declaration/value/function/infix/op-chain-r-eq-colon-1.hs view
@@ -0,0 +1,11 @@+-- Right chain, : case, 2 operators with p(:) == p(b)+h :: Int+h =+  1 :+  2 :+  3 :+  4 +++  5 :+  6 :+  7 :+  8
+ data/examples/declaration/value/function/infix/op-chain-r-eq-colon-2-out.hs view
@@ -0,0 +1,11 @@+-- Right chain, : case, 2 operators with p(a) == p(:)+k :: Int+k =+  1+    ++ 2+    ++ 3+    ++ 4+    : 5+    ++ 6+    ++ 7+    ++ 8
+ data/examples/declaration/value/function/infix/op-chain-r-eq-colon-2.hs view
@@ -0,0 +1,11 @@+-- Right chain, : case, 2 operators with p(a) == p(:)+k :: Int+k =+  1 +++  2 +++  3 +++  4 :+  5 +++  6 +++  7 +++  8
+ data/examples/declaration/value/function/infix/op-chain-r-eq-dollar-1-out.hs view
@@ -0,0 +1,11 @@+-- Right chain, $ case, 2 operators with p($) == p(b)+n :: Int+n =+  1+    $ 2+    $ 3+    $ 4+    `seq` 5+    $ 6+    $ 7+    $ 8
+ data/examples/declaration/value/function/infix/op-chain-r-eq-dollar-1.hs view
@@ -0,0 +1,11 @@+-- Right chain, $ case, 2 operators with p($) == p(b)+n :: Int+n =+  1 $+  2 $+  3 $+  4 `seq`+  5 $+  6 $+  7 $+  8
+ data/examples/declaration/value/function/infix/op-chain-r-eq-dollar-2-out.hs view
@@ -0,0 +1,11 @@+-- Right chain, $ case, 2 operators with p(a) == p($)+p :: Int+p =+  1+    `seq` 2+    `seq` 3+    `seq` 4+    $ 5+    `seq` 6+    `seq` 7+    `seq` 8
+ data/examples/declaration/value/function/infix/op-chain-r-eq-dollar-2.hs view
@@ -0,0 +1,11 @@+-- Right chain, $ case, 2 operators with p(a) == p($)+p :: Int+p =+  1 `seq`+  2 `seq`+  3 `seq`+  4 $+  5 `seq`+  6 `seq`+  7 `seq`+  8
+ data/examples/declaration/value/function/infix/op-chain-r-eq-normal-out.hs view
@@ -0,0 +1,11 @@+-- Right chain, normal case, 2 operators with p(a) == p(b)+e :: Int+e =+  1+    ^^ 2+    ^^ 3+    ^^ 4+    ^ 5+    ^^ 6+    ^^ 7+    ^^ 8
+ data/examples/declaration/value/function/infix/op-chain-r-eq-normal.hs view
@@ -0,0 +1,11 @@+-- Right chain, normal case, 2 operators with p(a) == p(b)+e :: Int+e =+  1 ^^+  2 ^^+  3 ^^+  4 ^+  5 ^^+  6 ^^+  7 ^^+  8
+ data/examples/declaration/value/function/infix/op-chain-r-gt-colon-1-out.hs view
@@ -0,0 +1,11 @@+-- Right chain, : case, 2 operators with p(:) > p(b)+i :: Int+i =+  1+    : 2+    : 3+    : 4+    `seq` 5+      : 6+      : 7+      : 8
+ data/examples/declaration/value/function/infix/op-chain-r-gt-colon-1.hs view
@@ -0,0 +1,11 @@+-- Right chain, : case, 2 operators with p(:) > p(b)+i :: Int+i =+  1 :+  2 :+  3 :+  4 `seq`+  5 :+  6 :+  7 :+  8
+ data/examples/declaration/value/function/infix/op-chain-r-gt-colon-2-out.hs view
@@ -0,0 +1,11 @@+-- Right chain, : case, 2 operators with p(a) > p(:)+l :: Int+l =+  1+    ^^ 2+    ^^ 3+    ^^ 4+    : 5+      ^^ 6+      ^^ 7+      ^^ 8
+ data/examples/declaration/value/function/infix/op-chain-r-gt-colon-2.hs view
@@ -0,0 +1,11 @@+-- Right chain, : case, 2 operators with p(a) > p(:)+l :: Int+l =+  1 ^^+  2 ^^+  3 ^^+  4 :+  5 ^^+  6 ^^+  7 ^^+  8
+ data/examples/declaration/value/function/infix/op-chain-r-gt-dollar-out.hs view
@@ -0,0 +1,11 @@+-- Right chain, $ case, 2 operators with p(a) > p($)+q :: Int+q =+  1+    ++ 2+    ++ 3+    ++ 4+    $ 5+      ++ 6+      ++ 7+      ++ 8
+ data/examples/declaration/value/function/infix/op-chain-r-gt-dollar.hs view
@@ -0,0 +1,11 @@+-- Right chain, $ case, 2 operators with p(a) > p($)+q :: Int+q =+  1 +++  2 +++  3 +++  4 $+  5 +++  6 +++  7 +++  8
+ data/examples/declaration/value/function/infix/op-chain-r-gt-normal-out.hs view
@@ -0,0 +1,11 @@+-- Right chain, normal case, 2 operators with p(a) > p(b)+f :: Int+f =+  1+    ^^ 2+    ^^ 3+    ^^ 4+    ++ 5+      ^^ 6+      ^^ 7+      ^^ 8
+ data/examples/declaration/value/function/infix/op-chain-r-gt-normal.hs view
@@ -0,0 +1,11 @@+-- Right chain, normal case, 2 operators with p(a) > p(b)+f :: Int+f =+  1 ^^+  2 ^^+  3 ^^+  4 +++  5 ^^+  6 ^^+  7 ^^+  8
+ data/examples/declaration/value/function/infix/op-chain-r-lt-colon-1-out.hs view
@@ -0,0 +1,11 @@+-- Right chain, : case, 2 operators with p(:) < p(b)+j :: Int+j =+  1+    : 2+    : 3+    : 4+      ^^ 5+    : 6+    : 7+    : 8
+ data/examples/declaration/value/function/infix/op-chain-r-lt-colon-1.hs view
@@ -0,0 +1,11 @@+-- Right chain, : case, 2 operators with p(:) < p(b)+j :: Int+j =+  1 :+  2 :+  3 :+  4 ^^+  5 :+  6 :+  7 :+  8
+ data/examples/declaration/value/function/infix/op-chain-r-lt-colon-2-out.hs view
@@ -0,0 +1,11 @@+-- Right chain, : case, 2 operators with p(a) < p(:)+m :: Int+m =+  1+    || 2+    || 3+    || 4+      : 5+    || 6+    || 7+    || 8
+ data/examples/declaration/value/function/infix/op-chain-r-lt-colon-2.hs view
@@ -0,0 +1,11 @@+-- Right chain, : case, 2 operators with p(a) < p(:)+m :: Int+m =+  1 ||+  2 ||+  3 ||+  4 :+  5 ||+  6 ||+  7 ||+  8
+ data/examples/declaration/value/function/infix/op-chain-r-lt-dollar-out.hs view
@@ -0,0 +1,11 @@+-- Right chain, $ case, 2 operators with p($) < p(b)+o :: Int+o =+  1+    $ 2+    $ 3+    $ 4+      ++ 5+    $ 6+    $ 7+    $ 8
+ data/examples/declaration/value/function/infix/op-chain-r-lt-dollar.hs view
@@ -0,0 +1,11 @@+-- Right chain, $ case, 2 operators with p($) < p(b)+o :: Int+o =+  1 $+  2 $+  3 $+  4 +++  5 $+  6 $+  7 $+  8
+ data/examples/declaration/value/function/infix/op-chain-r-lt-normal-out.hs view
@@ -0,0 +1,11 @@+-- Right chain, normal case, 2 operators with p(a) < p(b)+g :: Int+g =+  1+    ++ 2+    ++ 3+    ++ 4+      ^^ 5+    ++ 6+    ++ 7+    ++ 8
+ data/examples/declaration/value/function/infix/op-chain-r-lt-normal.hs view
@@ -0,0 +1,11 @@+-- Right chain, normal case, 2 operators with p(a) < p(b)+g :: Int+g =+  1 +++  2 +++  3 +++  4 ^^+  5 +++  6 +++  7 +++  8
+ data/examples/declaration/value/function/infix/op-chain-r-s-colon-out.hs view
@@ -0,0 +1,7 @@+-- Right chain, : case, 1 operator type+b :: Int+b =+  1+    : 2+    : 3+    : 4
+ data/examples/declaration/value/function/infix/op-chain-r-s-colon.hs view
@@ -0,0 +1,7 @@+-- Right chain, : case, 1 operator type+b :: Int+b =+  1 :+  2 :+  3 :+  4
+ data/examples/declaration/value/function/infix/op-chain-r-s-dollar-out.hs view
@@ -0,0 +1,7 @@+-- Right chain, $ case, 1 operator type+c :: Int+c =+  1+    $ 2+    $ 3+    $ 4
+ data/examples/declaration/value/function/infix/op-chain-r-s-dollar.hs view
@@ -0,0 +1,7 @@+-- Right chain, $ case, 1 operator type+c :: Int+c =+  1 $+  2 $+  3 $+  4
+ data/examples/declaration/value/function/infix/op-chain-r-s-normal-out.hs view
@@ -0,0 +1,7 @@+-- Right chain, normal case, 1 operator type+a :: Int+a =+  1+    ++ 2+    ++ 3+    ++ 4
+ data/examples/declaration/value/function/infix/op-chain-r-s-normal.hs view
@@ -0,0 +1,7 @@+-- Right chain, normal case, 1 operator type+a :: Int+a =+  1 +++  2 +++  3 +++  4
+ data/examples/declaration/value/function/infix/qualified-ops-out.hs view
@@ -0,0 +1,9 @@+lenses =+  Just+    $ M.fromList+    $ "type" Foo..= ("user.connection" :: Text)+      Bar.# "connection" Foo..= uc+      Bar.# "user" Foo..= case name of+        Just n -> Just $ object ["name" .= n]+        Nothing -> Nothing+      Bar.# []
+ data/examples/declaration/value/function/infix/qualified-ops.hs view
@@ -0,0 +1,7 @@+lenses = Just $ M.fromList+  $ "type"       Foo..= ("user.connection" :: Text)+  Bar.# "connection" Foo..= uc+  Bar.# "user"       Foo..= case name of+      Just  n -> Just $ object ["name" .= n]+      Nothing -> Nothing+  Bar.# []
+ data/examples/declaration/value/function/infix/qualified-prelude-out.hs view
@@ -0,0 +1,12 @@+module StreamSpec where++import Prelude (($))+import qualified Prelude++spec :: Spec+spec = do+  describe "Comparing list function to" $ do+    qit "yieldMany" $+      \(mono :: Seq Int) ->+        yieldMany mono+          `checkProducer` otoList mono
+ data/examples/declaration/value/function/infix/qualified-prelude.hs view
@@ -0,0 +1,12 @@+module StreamSpec where++import qualified Prelude+import           Prelude (($))++spec :: Spec+spec = do+    describe "Comparing list function to" $ do+        qit "yieldMany" $+            \(mono :: Seq Int) ->+                yieldMany mono `checkProducer`+                otoList mono
+ data/examples/declaration/value/function/infix/tricky-colon-chain-out.hs view
@@ -0,0 +1,9 @@+b :: [Int]+b =+  1+    : do+      2+    : do+      3+    : do+      [4]
+ data/examples/declaration/value/function/infix/tricky-colon-chain.hs view
@@ -0,0 +1,9 @@+b :: [Int]+b =+  1 :+    do+      2+     : do+        3+       : do+          [4]
data/examples/declaration/value/function/lambda-case-out.hs view
@@ -7,3 +7,17 @@   5 -> 10   i | i > 5 -> 11   _ -> 12++foo :: Maybe a -> Maybe a -> Maybe a -> Int+foo = \cases Nothing Just {} Nothing -> 1; _ _ _ -> 0++foo :: Maybe Int -> Maybe Int -> Int+foo = \cases+  (Just a) (Just a) -> a + a+  _ _ -> 0++foo :: Bool -> Bool -> Bool+foo = \cases+  True+    True -> True+  _ _ -> False
data/examples/declaration/value/function/lambda-case.hs view
@@ -7,3 +7,17 @@   5 -> 10   i  | i > 5 -> 11   _ -> 12++foo :: Maybe a -> Maybe a -> Maybe a -> Int+foo = \cases Nothing Just{} Nothing -> 1;  _ _ _ -> 0++foo :: Maybe Int -> Maybe Int -> Int+foo = \cases+  (Just a) (Just a) -> a + a+  _         _       -> 0++foo :: Bool -> Bool -> Bool+foo = \cases+  True+   True -> True+  _ _ -> False
+ data/examples/declaration/value/function/lambda-comment-after-arrow-out.hs view
@@ -0,0 +1,2 @@+f = \a -> -- foo+  a
+ data/examples/declaration/value/function/lambda-comment-after-arrow.hs view
@@ -0,0 +1,2 @@+f = \a -> -- foo+  a
data/examples/declaration/value/function/let-multi-line-out.hs view
@@ -17,7 +17,7 @@                    () -> undefined    in go -implicitParams :: HasCallStack => Int+implicitParams :: (HasCallStack) => Int implicitParams =   let ?cs = ?callstack    in foo cs
+ data/examples/declaration/value/function/linear-bindings-out.hs view
@@ -0,0 +1,9 @@+{-# LANGUAGE LinearTypes #-}++h x = g y+  where+    %1 y = f x++let %1 x = u in ()+let %Many (x, y) = u in ()+let %1 ~(x, y) = u in ()
+ data/examples/declaration/value/function/linear-bindings.hs view
@@ -0,0 +1,9 @@+{-# Language LinearTypes #-}++h x = g y+  where+    %1 y = f x++let %1 x = u in ()+let %Many (x, y) = u in ()+let %1 ~(x, y) = u in ()
data/examples/declaration/value/function/list-comprehensions-out.hs view
@@ -4,21 +4,40 @@  barbaz x y z w =   [ (a, b, c, d) -- Foo-    | a <--        x, -- Bar-      b <- y, -- Baz-      any even [a, b],-      c <--        z-          * z ^ 2, -- Bar baz-      d <--        w-          + w, -- Baz bar-      all-        even-        [ a,-          b,-          c,-          d-        ]+  | a <-+      x, -- Bar+    b <- y, -- Baz+    any even [a, b],+    c <-+      z+        * z ^ 2, -- Bar baz+    d <-+      w+        + w, -- Baz bar+    all+      even+      [ a,+        b,+        c,+        d+      ]+  ]++a = do+  d <-+    [ x + 1+    | x <- b+    ]++  [ c+    | c <- d+    ]++trans =+  [ x+  | x <- xs,+    then+      reverse,+    then+      reverse   ]
data/examples/declaration/value/function/list-comprehensions.hs view
@@ -20,3 +20,19 @@         c, d       ]   ]++a = do+  d <-+    [ x + 1+      | x <- b+        ]++  [ c+      | c <- d ]++trans =+  [ x+  | x <- xs+  , then reverse+  , then reverse+  ]
data/examples/declaration/value/function/list-notation-0-out.hs view
@@ -1,5 +1,5 @@ foo =-  testCase "Foo" testFoo :-  testCase "Bar" testBar :-  testCase "Baz" testBaz :-  []+  testCase "Foo" testFoo+    : testCase "Bar" testBar+    : testCase "Baz" testBaz+    : []
data/examples/declaration/value/function/list-notation-1-out.hs view
@@ -1,8 +1,8 @@ instance A.ToJSON UpdateTable where   toJSON a =     A.object $-      "TableName" .= updateTableName a :-      "ProvisionedThroughput" .= updateProvisionedThroughput a :-      case updateGlobalSecondaryIndexUpdates a of-        [] -> []-        l -> ["GlobalSecondaryIndexUpdates" .= l]+      "TableName" .= updateTableName a+        : "ProvisionedThroughput" .= updateProvisionedThroughput a+        : case updateGlobalSecondaryIndexUpdates a of+          [] -> []+          l -> ["GlobalSecondaryIndexUpdates" .= l]
data/examples/declaration/value/function/list-notation-2-out.hs view
@@ -1,6 +1,6 @@ -- A list of the element and all its parents up to the root node. getPath tree t =-  t :-  case Map.lookup (getId t) tree of-    Nothing -> []-    Just parent -> getPath tree parent+  t+    : case Map.lookup (getId t) tree of+      Nothing -> []+      Just parent -> getPath tree parent
data/examples/declaration/value/function/list-notation-3-out.hs view
@@ -1,12 +1,10 @@ foo =-  reportSDoc "tc.cc" 30 $-    sep $ do-      (prettyTCM q <+> " before compilation") : do-        map (prettyTCM . map unArg . clPats) cls+  reportSDoc "tc.cc" 30 $ sep $ do+    (prettyTCM q <+> " before compilation") : do+      map (prettyTCM . map unArg . clPats) cls  foo =-  reportSDoc "tc.cc" 30 $-    sep $ do-      (prettyTCM q <+> " before compilation") :-        do-          map (prettyTCM . map unArg . clPats) cls+  reportSDoc "tc.cc" 30 $ sep $ do+    (prettyTCM q <+> " before compilation")+      : do+        map (prettyTCM . map unArg . clPats) cls
data/examples/declaration/value/function/multi-way-if-out.hs view
@@ -4,13 +4,15 @@  bar x y =   if-      | x > y -> x-      | x < y ->+    | x > y -> x+    | x < y ->         y-      | otherwise -> x+    | otherwise -> x  baz =   if       | p -> f       | otherwise -> g     x++x y = if | foo -> False | otherwise -> True
data/examples/declaration/value/function/multi-way-if.hs view
@@ -12,3 +12,5 @@   if | p -> f      | otherwise -> g     x++x y = if | foo -> False | otherwise -> True
+ data/examples/declaration/value/function/multiline-strings-0-out.hs view
@@ -0,0 +1,29 @@+{-# LANGUAGE MultilineStrings #-}++s =+  """Line 1+     Line 2+  Line 3+  """++s_2 =+  """\ \Line 1+     Line 2+  Line 3+  """++-- equivalent to+s' = "Line 1\n   Line 2\nLine 3"++-- the following are equivalent+s = """hello world"""++s' = "hello world"++s =+  """    hello+  world+  """++-- equivalent to+s' = "    hello\nworld"
+ data/examples/declaration/value/function/multiline-strings-0.hs view
@@ -0,0 +1,31 @@+{-# LANGUAGE MultilineStrings #-}++s =+  """Line 1+     Line 2+  Line 3+  """++s_2 =+  """\+ \Line 1+     Line 2+  Line 3+  """++-- equivalent to+s' = "Line 1\n   Line 2\nLine 3"+++-- the following are equivalent+s = """hello world"""+s' = "hello world"+++s =+  """    hello+  world+  """++-- equivalent to+s' = "    hello\nworld"
+ data/examples/declaration/value/function/multiline-strings-1-out.hs view
@@ -0,0 +1,12 @@+{-# LANGUAGE MultilineStrings #-}++s =+  """+  a b\ \ c d e+  f g+  """++-- equivalent to+s' = "a b c d e\nf g"++weirdGap = """\65\ \0"""
+ data/examples/declaration/value/function/multiline-strings-1.hs view
@@ -0,0 +1,13 @@+{-# LANGUAGE MultilineStrings #-}++s =+    """+      a b\+  \ c d e+      f g+    """++-- equivalent to+s' = "a b c d e\nf g"++weirdGap = """\65\ \0"""
+ data/examples/declaration/value/function/multiline-strings-2-out.hs view
@@ -0,0 +1,11 @@+{-# LANGUAGE MultilineStrings #-}++s =+  """+  a+  b+  c+  """++-- equivalent to+s' = "a\nb\nc"
+ data/examples/declaration/value/function/multiline-strings-2.hs view
@@ -0,0 +1,11 @@+{-# LANGUAGE MultilineStrings #-}++s =+	"""+	        a+	 	b+	    	c+	"""++-- equivalent to+s' = "a\nb\nc"
+ data/examples/declaration/value/function/multiline-strings-3-out.hs view
@@ -0,0 +1,32 @@+{-# LANGUAGE MultilineStrings #-}++s =+  """++  a+  b+  c+  """++-- equivalent to+s' = "\na\nb\nc"++s1 =+  """    a+  b+  c+  """++s2 =+  """+  a+  b+  c+  """++-- In the current proposal, these are equivalent to+-- the below. If leading newline were removed at the+-- beginning, both would result in s1'.+s1' = "    a\nb\nc"++s2' = "a\nb\nc"
+ data/examples/declaration/value/function/multiline-strings-3.hs view
@@ -0,0 +1,32 @@+{-# LANGUAGE MultilineStrings #-}++s =+  """++  a+  b+  c+  """++-- equivalent to+s' = "\na\nb\nc"+++s1 =+  """    a+  b+  c+  """++s2 =+  """+  a+  b+  c+  """++-- In the current proposal, these are equivalent to+-- the below. If leading newline were removed at the+-- beginning, both would result in s1'.+s1' = "    a\nb\nc"+s2' = "a\nb\nc"
+ data/examples/declaration/value/function/multiline-strings-4-out.hs view
@@ -0,0 +1,25 @@+{-# LANGUAGE MultilineStrings #-}++s =+  """+  a+  b++  """++-- equivalent to+s' = "a\nb\n"++s1 =+  """+  line 1+  line 2+  """++s2 = "line 3"++s3 =+  """+  line 4+  line 5+  """
+ data/examples/declaration/value/function/multiline-strings-4.hs view
@@ -0,0 +1,26 @@+{-# LANGUAGE MultilineStrings #-}++s =+  """+  a+  b++  """++-- equivalent to+s' = "a\nb\n"+++s1 =+  """+  line 1+  line 2+  """++s2 = "line 3"++s3 =+  """+  line 4+  line 5+  """
+ data/examples/declaration/value/function/multiline-strings-5-out.hs view
@@ -0,0 +1,26 @@+{-# LANGUAGE MultilineStrings #-}++s1 =+  """+  a+  b+  c+  """++s1' = "a\nb\nc"++s2 =+  """+  \&  a+    b+    c+  """++s2_2 =+  """+  \&  a+  \&  b+  \&  c+  """++s2' = "  a\n  b\n  c"
+ data/examples/declaration/value/function/multiline-strings-5.hs view
@@ -0,0 +1,26 @@+{-# LANGUAGE MultilineStrings #-}++s1 =+  """+    a+    b+    c+  """++s1' = "a\nb\nc"++s2 =+  """+  \&  a+    b+    c+  """++s2_2 =+  """+  \&  a+  \&  b+  \&  c+  """++s2' = "  a\n  b\n  c"
+ data/examples/declaration/value/function/multiline-strings-6-out.hs view
@@ -0,0 +1,10 @@+{-# LANGUAGE MultilineStrings #-}++x =+  """+  This is a literal multiline string:+  \"\"\"+  Hello+    world!+  \"""+  """
+ data/examples/declaration/value/function/multiline-strings-6.hs view
@@ -0,0 +1,10 @@+{-# LANGUAGE MultilineStrings #-}++x =+  """+  This is a literal multiline string:+  \"\"\"+  Hello+    world!+  \"""+  """
+ data/examples/declaration/value/function/multiline-strings-7-out.hs view
@@ -0,0 +1,30 @@+{-# LANGUAGE MultilineStrings #-}++printf+  """+  instance Aeson.FromJSON %s where+    parseJSON =+      Aeson.withText "%s" $ \\s ->+        either Aeson.parseFail pure $+          parsePrinterOptType (Text.unpack s)++  instance PrinterOptsFieldType %s where+    parsePrinterOptType s =+      case s of+  %s+        _ ->+          Left . unlines $+            [ "unknown value: " <> show s+            , "Valid values are: %s"+            ]++  """+  fieldTypeName+  fieldTypeName+  fieldTypeName+  ( unlines_+      [ printf "      \"%s\" -> Right %s" val con+      | (con, val) <- enumOptions+      ]+  )+  (renderEnumOptions enumOptions)
+ data/examples/declaration/value/function/multiline-strings-7.hs view
@@ -0,0 +1,30 @@+{-# LANGUAGE MultilineStrings #-}++printf+  """+  instance Aeson.FromJSON %s where+    parseJSON =+      Aeson.withText "%s" $ \\s ->+        either Aeson.parseFail pure $+          parsePrinterOptType (Text.unpack s)++  instance PrinterOptsFieldType %s where+    parsePrinterOptType s =+      case s of+  %s+        _ ->+          Left . unlines $+            [ "unknown value: " <> show s+            , "Valid values are: %s"+            ]++  """+  fieldTypeName+  fieldTypeName+  fieldTypeName+  ( unlines_+      [ printf "      \"%s\" -> Right %s" val con+      | (con, val) <- enumOptions+      ]+  )+  (renderEnumOptions enumOptions)
+ data/examples/declaration/value/function/multiline-strings-8-out.hs view
@@ -0,0 +1,12 @@+{-# LANGUAGE MultilineStrings #-}++type Foo =+  """+  yeah+    yeah"""++foo =+  foo+    @"""yeah+     yeah+     """
+ data/examples/declaration/value/function/multiline-strings-8.hs view
@@ -0,0 +1,9 @@+{-# LANGUAGE MultilineStrings #-}++type Foo = """+  yeah+    yeah"""++foo = foo @"""yeah+           yeah+           """
+ data/examples/declaration/value/function/multiline-strings-9-out.hs view
@@ -0,0 +1,11 @@+{-# LANGUAGE MultilineStrings #-}++multilineBlank =+  """+  1+++++  6+  """
+ data/examples/declaration/value/function/multiline-strings-9.hs view
@@ -0,0 +1,11 @@+{-# LANGUAGE MultilineStrings #-}++multilineBlank =+  """+  1+++++  6+  """
+ data/examples/declaration/value/function/multiline-types-out.hs view
@@ -0,0 +1,17 @@+foo ::+  (Monad m, Show a) =>+  a ->+  m String+bar ::+  ( Monad m,+    Show a+  ) =>+  a -> m String+multiConstraints ::+  (Show a) =>+  a ->+  a ->+  a ->+  (Eq a) =>+  (Num a) =>+  a -> a -> ()
+ data/examples/declaration/value/function/multiline-types.hs view
@@ -0,0 +1,15 @@+foo ::+   (Monad m, Show a) =>+   a ->+   m String++bar ::+   (Monad m,+      Show a) =>+   a -> m String++multiConstraints ::+  Show a =>+  a -> a -> a ->+  Eq a => Num a =>+  a -> a -> ()
data/examples/declaration/value/function/multiple-guards-out.hs view
@@ -6,9 +6,9 @@ bar :: Int -> Int bar x   | x == 5 =-    foo x-      + foo 10+      foo x+        + foo 10   | x == 6 =-    foo x-      + foo 20+      foo x+        + foo 20   | otherwise = foo 100
data/examples/declaration/value/function/multiple-guards.hs view
@@ -1,7 +1,6 @@ foo :: Int -> Int-foo x-  | x == 5 = 10-  | otherwise = 12+foo x | x == 5 = 10+      | otherwise = 12  bar :: Int -> Int bar x
data/examples/declaration/value/function/newline-single-line-body-out.hs view
@@ -4,7 +4,6 @@  function' :: String -> String function' s = case s of-  "ThisString" ->-    -- And a comment here is okay+  "ThisString" -> -- And a comment here is okay     "Yay"   _ -> "Boo"
+ data/examples/declaration/value/function/operator-comments-3-out.hs view
@@ -0,0 +1,5 @@+data X = X {x :: Int}++f =+  id+    . (\s -> s {x = 1}) -- Some comment
+ data/examples/declaration/value/function/operator-comments-3.hs view
@@ -0,0 +1,5 @@+data X = X { x :: Int }++f = id+    . -- Some comment+    (\s -> s { x = 1 })
+ data/examples/declaration/value/function/operator-comments-4-out.hs view
@@ -0,0 +1,4 @@+foo = do+  bar+    -- txt+    $ baz
+ data/examples/declaration/value/function/operator-comments-4.hs view
@@ -0,0 +1,4 @@+foo = do+  bar+    -- txt+    $ baz
+ data/examples/declaration/value/function/operator-fixity-defaulting-out.hs view
@@ -0,0 +1,12 @@+def1 =+  (,,)+    <$> gvar (primitiveGVar "natToHex")+      `foo` ne+    <*> con cNothing+      `foo` tcon tChar++def2 =+  tds1+    && lc1 == mempty+    && gc1 `M.isSubmapOf` gc2+    && sh1 == sh2
+ data/examples/declaration/value/function/operator-fixity-defaulting.hs view
@@ -0,0 +1,12 @@+def1 =+  (,,)+    <$> gvar (primitiveGVar "natToHex")+         `foo` ne+    <*> con cNothing+         `foo` tcon tChar++def2 =+  tds1+    && lc1 == mempty+    && gc1 `M.isSubmapOf` gc2+    && sh1 == sh2
+ data/examples/declaration/value/function/operator-hash-with-unboxed-sums-out.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE UnboxedSums #-}++module Foo (( #<| )) where++( #<| ) :: Int -> Int -> Int+( #<| ) = (+)++(+) = (+)
+ data/examples/declaration/value/function/operator-hash-with-unboxed-sums.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE UnboxedSums #-}++module Foo (( #<| )) where++( #<| ) :: Int -> Int -> Int+( #<| ) = (+)++(+) = (+)
+ data/examples/declaration/value/function/operator-hash-without-unboxed-sums-out.hs view
@@ -0,0 +1,6 @@+module Foo ((#<|)) where++(#<|) :: Int -> Int -> Int+(#<|) = (+)++(+) = (+)
+ data/examples/declaration/value/function/operator-hash-without-unboxed-sums.hs view
@@ -0,0 +1,6 @@+module Foo (( #<| )) where++( #<| ) :: Int -> Int -> Int+( #<| ) = (+)++(+) = (+)
data/examples/declaration/value/function/operators-0-out.hs view
@@ -1,5 +1,8 @@+import Control.Lens.Operators+ a =-  b & c .~ d+  b+    & c .~ d     & e       %~ f         g
data/examples/declaration/value/function/operators-0.hs view
@@ -1,3 +1,5 @@+import Control.Lens.Operators+ a =   b & c .~ d     & e %~ f
data/examples/declaration/value/function/operators-2-out.hs view
@@ -1,4 +1,6 @@ foo n-  | x || y && z || n ** x+  | x+      || y && z+      || n ** x       || x && n =-    42+      42
data/examples/declaration/value/function/operators-3-out.hs view
@@ -1,3 +1,8 @@+import Control.Arrow+ foo =-  op <> n <+> colon <+> prettySe <+> text "="+  op <> n+    <+> colon+    <+> prettySe+    <+> text "="     <+> prettySe <> text sc
data/examples/declaration/value/function/operators-3.hs view
@@ -1,3 +1,5 @@+import Control.Arrow+ foo =   op <> n <+> colon <+> prettySe <+> text "=" <+>     prettySe <> text sc
data/examples/declaration/value/function/operators-4-out.hs view
@@ -1,3 +1,8 @@+import Control.Arrow+ foo =-  line <> bindingOf <+> text "=" <+> tPretty <+> colon+  line <> bindingOf+    <+> text "="+    <+> tPretty+    <+> colon     <+> align <> prettyPs
data/examples/declaration/value/function/operators-4.hs view
@@ -1,3 +1,5 @@+import Control.Arrow+ foo =   line <> bindingOf <+> text "=" <+> tPretty <+> colon <+>     align <> prettyPs
data/examples/declaration/value/function/operators-6-out.hs view
@@ -1,3 +1,5 @@+import Servant.API+ type PermuteRef =   "a"     :> ( "b" :> "c" :> End
data/examples/declaration/value/function/operators-6.hs view
@@ -1,3 +1,5 @@+import Servant.API+ type PermuteRef =        "a" :> (    "b" :> "c" :> End               :<|> "c" :> "b" :> End
+ data/examples/declaration/value/function/operators-7-out.hs view
@@ -0,0 +1,1 @@+foo c = case c of { _ -> c } : []
+ data/examples/declaration/value/function/operators-7.hs view
@@ -0,0 +1,1 @@+foo c = case c of {_->c} : []
data/examples/declaration/value/function/overloaded-labels-out.hs view
@@ -3,3 +3,36 @@ foo = #field  bar = (#this) (#that)++baz = #Foo #"Hello world!" #"\"" #3 #"\n"++-- from https://gitlab.haskell.org/ghc/ghc/-/blob/ghc-9.6.1-alpha3/testsuite/tests/overloadedrecflds/should_run/T11671_run.hs+-- unnecessary once https://github.com/tweag/ormolu/issues/821 lands+main =+  traverse_+    putStrLn+    [ #a,+      #number17,+      #do,+      #type,+      #Foo,+      #3,+      #"199.4",+      #17a23b,+      #f'a',+      #'a',+      #',+      #''notTHSplice,+      #"...",+      #привет,+      #こんにちは,+      #"3",+      #":",+      #"Foo",+      #"The quick brown fox",+      #"\"",+      (++) #hello #world,+      (++) #"hello" #"world",+      #"hello" # 1, -- equivalent to `(fromLabel @"hello") # 1`+      f "hello" #2 -- equivalent to `f ("hello"# :: Addr#) 2`+    ]
data/examples/declaration/value/function/overloaded-labels.hs view
@@ -2,3 +2,33 @@  foo = #field bar = (#this ) ( #that)+baz = #Foo #"Hello world!" #"\"" #3 #"\n"++-- from https://gitlab.haskell.org/ghc/ghc/-/blob/ghc-9.6.1-alpha3/testsuite/tests/overloadedrecflds/should_run/T11671_run.hs+-- unnecessary once https://github.com/tweag/ormolu/issues/821 lands+main = traverse_ putStrLn+  [ #a+  , #number17+  , #do+  , #type+  , #Foo+  , #3+  , #"199.4"+  , #17a23b+  , #f'a'+  , #'a'+  , #'+  , #''notTHSplice+  , #"..."+  , #привет+  , #こんにちは+  , #"3"+  , #":"+  , #"Foo"+  , #"The quick brown fox"+  , #"\""+  , (++) #hello#world+  , (++) #"hello"#"world"+  , #"hello"# 1 -- equivalent to `(fromLabel @"hello") # 1`+  , f "hello"#2 -- equivalent to `f ("hello"# :: Addr#) 2`+  ]
data/examples/declaration/value/function/parallel-comprehensions-complex-out.hs view
@@ -10,26 +10,26 @@       i,       j     )-    | a <- -- Foo 1-        x, -- Foo 2-      b <- -- Bar 1-        y, -- Bar 2+  | a <- -- Foo 1+      x, -- Foo 2+    b <- -- Bar 1+      y, -- Bar 2+    a+      `mod` b -- Value+      == 0+  | c <- -- Baz 1+      z+        * z -- Baz 2+        -- Baz 3+  | d <- w -- Other+  | e <- x * x -- Foo bar+  | f <- -- Foo baz 1+      y + y -- Foo baz 2+  | h <- z + z * w ^ 2 -- Bar foo+  | i <- -- Bar bar 1       a-        `mod` b -- Value-        == 0-    | c <- -- Baz 1-        z-          * z -- Baz 2-          -- Baz 3-    | d <- w -- Other-    | e <- x * x -- Foo bar-    | f <- -- Foo baz 1-        y + y -- Foo baz 2-    | h <- z + z * w ^ 2 -- Bar foo-    | i <- -- Bar bar 1-        a-          + b, -- Bar bar 2-          -- Bar bar 3-      j <- -- Bar baz 1-        a + b -- Bar baz 2+        + b, -- Bar bar 2+        -- Bar bar 3+    j <- -- Bar baz 1+      a + b -- Bar baz 2   ]
+ data/examples/declaration/value/function/parens-comments-out.hs view
@@ -0,0 +1,4 @@+test =+  ( -- a+    x+  )
+ data/examples/declaration/value/function/parens-comments.hs view
@@ -0,0 +1,3 @@+test = (+  -- a+  x)
+ data/examples/declaration/value/function/pattern/many-guards-in-singleline-out.hs view
@@ -0,0 +1,3 @@+foobar x | x <- 5 = 5 | x <- 6 = 6 | otherwise = 7++foobaz | x <- 5 = 5 | x <- 6 = 6 | otherwise = 7
+ data/examples/declaration/value/function/pattern/many-guards-in-singleline.hs view
@@ -0,0 +1,3 @@+foobar x | x <- 5 = 5 | x <- 6 = 6 | otherwise = 7++foobaz | x <- 5 = 5 | x <- 6 = 6 | otherwise = 7
+ data/examples/declaration/value/function/pattern/multiline-guard-statement-out.hs view
@@ -0,0 +1,6 @@+foobarbar :: Int -> Bool+foobarbar+  | x <-+      5 = case x of+      5 -> True+      _ -> False
+ data/examples/declaration/value/function/pattern/multiline-guard-statement.hs view
@@ -0,0 +1,5 @@+foobarbar :: Int -> Bool+foobarbar | x <-+    5 = case x of+  5 -> True+  _ -> False
+ data/examples/declaration/value/function/pattern/multiple-guard-statements-out.hs view
@@ -0,0 +1,6 @@+foobarbar :: Int -> Bool+foobarbar+  | x <- 5,+    y <- 6 = case x of+      5 -> True+      _ -> False
+ data/examples/declaration/value/function/pattern/multiple-guard-statements.hs view
@@ -0,0 +1,4 @@+foobarbar :: Int -> Bool+foobarbar | x <- 5, y <- 6 = case x of+  5 -> True+  _ -> False
+ data/examples/declaration/value/function/pattern/or-patterns-out.hs view
@@ -0,0 +1,44 @@+{-# LANGUAGE PatternSynonyms #-}++tasty (Cupcake; Cookie) = True+tasty (Liquorice; Raisins) = False++f :: (Eq a, Show a) => a -> a -> Bool+f a ((== a) -> True; show -> "yes") = True+f _ _ = False++small (abs -> (0; 1; 2); 3) = True -- -3 is not small+small _ = False++type Coll a = Either [a] (Set a)++pattern None <- (Left []; Right (toList -> []))++case e of+  1; 2; 3 -> x+  4; (5; 6) -> y++sane e = case e of+  1+  2+  3 ->+    a+  4+  5+  6 -> b+  7; 8 -> c++insane e = case e of+  A _ _+  B _+  C -> 3+  (D; E (Just _) Nothing) ->+    4+  F -> 5++food+  foo@( A;+        B;+        C+        ) = Just foo+food _ = Nothing
+ data/examples/declaration/value/function/pattern/or-patterns.hs view
@@ -0,0 +1,39 @@+{-# LANGUAGE PatternSynonyms #-}++tasty (Cupcake; Cookie) = True+tasty (Liquorice; Raisins) = False++f :: (Eq a, Show a) => a -> a -> Bool+f a ((== a) -> True; show -> "yes") = True+f _ _ = False++small (abs -> (0; 1; 2); 3) = True -- -3 is not small+small _ = False++type Coll a = Either [a] (Set a)+pattern None <- (Left []; Right (toList -> []))++case e of+  1; 2; 3 -> x+  4; (5; 6) -> y++sane e = case e of+  1+  2+  3 ->+    a+  4+  5;6 -> b+  7;8 -> c++insane e = case e of+  A _ _; B _+  C -> 3+  (D; E (Just _) Nothing)+   -> 4+  F -> 5++food foo@(A;+          B;+          C) = Just foo+food _ = Nothing
data/examples/declaration/value/function/pragmas-out.hs view
@@ -1,8 +1,13 @@-sccfoo = {-# SCC foo #-} 1+sccfoo = {-# SCC "foo" #-} 1  sccbar =   {-# SCC "barbaz" #-}   "hello"++foo = do+  {-# SCC "foo" #-}+    fmap succ $ do+      {-# SCC "bar" #-} pure 1  -- CORE pragma got removed in https://gitlab.haskell.org/ghc/ghc/-/commit/12f9035200424ec8104484f154a040d612fee99d 
data/examples/declaration/value/function/pragmas.hs view
@@ -2,6 +2,10 @@ sccbar = {-# SCC "barbaz"#-}   "hello" +foo = do+  {-# SCC "foo" #-} fmap succ $ do+    {-# SCC "bar" #-} pure 1+ -- CORE pragma got removed in https://gitlab.haskell.org/ghc/ghc/-/commit/12f9035200424ec8104484f154a040d612fee99d  corefoo = {-# CORE "foo"#-}  1
+ data/examples/declaration/value/function/primitive-literals-out.hs view
@@ -0,0 +1,10 @@+{-# LANGUAGE ExtendedLiterals #-}+{-# LANGUAGE MagicHash #-}++foo = 1#++bar = 2##++baz = 3#Word32++baz = 0b1010#Int64
+ data/examples/declaration/value/function/primitive-literals.hs view
@@ -0,0 +1,9 @@+{-# LANGUAGE ExtendedLiterals, MagicHash #-}++foo = 1#++bar = 2##++baz = 3#Word32++baz =  0b1010#Int64
− data/examples/declaration/value/function/record/dot-multiline-out.hs
@@ -1,15 +0,0 @@-{-# OPTIONS_GHC -fplugin=RecordDotPreprocessor #-}--bar' =-  (Foo 1){bar = 2-         }--fooplus'''' f n =-  f{foo = n,-    bar = n-   }--fooplus''''' f n =-  f-    { foo = n-    }
− data/examples/declaration/value/function/record/dot-multiline.hs
@@ -1,10 +0,0 @@-{-# OPTIONS_GHC -fplugin=RecordDotPreprocessor #-}-bar' = (Foo 1){bar = 2-              }--fooplus'''' f n = f{foo = n,-                    bar = n-                   }--fooplus''''' f n = f-                   { foo = n }
− data/examples/declaration/value/function/record/dot-singleline-out.hs
@@ -1,15 +0,0 @@-{-# OPTIONS_GHC -fplugin=RecordDotPreprocessor #-}--data Foo = Foo {bar :: Int}--mfoo = fmap (.bar) $ Nothing--bar = (Foo 1).bar--fooplus f n = f{foo = f.bar + n}--fooplus' f n = f {foo = f.bar + n}--fooplus'' f n = f {foo = f.bar + n}--fooplus''' f n = f {foo = f.bar + n}
− data/examples/declaration/value/function/record/dot-singleline.hs
@@ -1,14 +0,0 @@-{-# OPTIONS_GHC -fplugin=RecordDotPreprocessor #-}-data Foo = Foo { bar :: Int }--mfoo = fmap (.bar)   $ Nothing--bar = (  Foo 1).bar--fooplus f n = f{foo = f.bar + n}--fooplus' f n = f { foo = f.bar + n}--fooplus'' f n = f {foo = f.bar + n}--fooplus''' f n = f{ foo = f.bar + n}
+ data/examples/declaration/value/function/record/record-dot-out.hs view
@@ -0,0 +1,16 @@+{-# LANGUAGE OverloadedRecordDot #-}+{-# LANGUAGE OverloadedRecordUpdate #-}++data Foo = Foo {bar :: Foo}++mfoo = fmap (.bar) $ Nothing++bar = (Foo 1).bar++fooplus f n = f {foo = f.bar + n}++nestedFoo f = f.bar.bar.bar.bar.bar++nestedFooUpdate f = f {bar.bar = f.bar} <> f {bar.bar.bar.bar}++operatorUpdate f = f {(+) = 1}
+ data/examples/declaration/value/function/record/record-dot.hs view
@@ -0,0 +1,16 @@+{-# LANGUAGE OverloadedRecordDot #-}+{-# LANGUAGE OverloadedRecordUpdate #-}++data Foo = Foo { bar :: Foo }++mfoo = fmap (.bar)   $ Nothing++bar = (  Foo 1).bar++fooplus f n = f{foo = f.bar + n}++nestedFoo f = f.bar.bar.bar.bar.bar++nestedFooUpdate f = f {bar.bar = f.bar } <> f {bar.bar.bar.bar}++operatorUpdate f = f { (+) = 1 }
+ data/examples/declaration/value/function/record/wildcard-comments-0-out.hs view
@@ -0,0 +1,12 @@+{-# LANGUAGE RecordWildCards #-}++example =+  Record+    { -- A+      field = (), -- B+      -- C+      field = (), -- D+      -- E+      -- F+      ..+    } -- G
+ data/examples/declaration/value/function/record/wildcard-comments-0.hs view
@@ -0,0 +1,11 @@+{-# LANGUAGE RecordWildCards #-}++example =+  Record+    { -- A+      field = (), -- B+      -- C+      field = (), -- D+      -- E+      .. -- F+    } -- G
+ data/examples/declaration/value/function/record/wildcard-comments-1-out.hs view
@@ -0,0 +1,12 @@+{-# LANGUAGE RecordWildCards #-}++example =+  Record+    { -- A+      field = (),+      -- C+      field = (),+      -- E+      -- F+      ..+    } -- G
+ data/examples/declaration/value/function/record/wildcard-comments-1.hs view
@@ -0,0 +1,11 @@+{-# LANGUAGE RecordWildCards #-}++example =+  Record+    { -- A+      field = (),+      -- C+      field = (),+      -- E+      .. -- F+    } -- G
+ data/examples/declaration/value/function/required-type-arguments-2-out.hs view
@@ -0,0 +1,23 @@+{-# LANGUAGE LinearTypes #-}+{-# LANGUAGE UnicodeSyntax #-}++ex1 = f (forall a. Proxy a)++ex2 = f ((ctx) => Int)++ex2' = f ((ctx, ctx') => Int)++ex3 = f (String -> Bool)++long =+  f+    ( forall m a.+      (A a, M m) =>+      String ->+      Bool %1 ->+      Maybe Int ->+      Maybe+        (String, Int) %1 ->+      Word %m ->+      Text+    )
+ data/examples/declaration/value/function/required-type-arguments-2.hs view
@@ -0,0 +1,14 @@+{-# LANGUAGE UnicodeSyntax #-}+{-# LANGUAGE LinearTypes #-}++ex1  = f (forall a. Proxy a)+ex2  = f (ctx => Int)+ex2' = f ((ctx,ctx') => Int)+ex3  = f (String -> Bool)++long = f (forall m a. (A a, M m) => String+       -> Bool %1 ->+          Maybe Int+       -> Maybe+             (String,Int)+        ⊸ Word %m -> Text )
+ data/examples/declaration/value/function/required-type-arguments-out.hs view
@@ -0,0 +1,21 @@+vshow :: forall a -> (Show a) => a -> String+vshow t x = show (x :: t)++s1 = vshow Int 42++s2 = vshow Double 42++a1 = f (type (Int -> Bool))++a2 = f (type ((Read T) => T))++a3 = f (type (forall a. a))++a4 = f (type (forall a. (Read a) => String -> a))++foo =+  f+    ( type ( Maybe+               Int+           )+    )
+ data/examples/declaration/value/function/required-type-arguments.hs view
@@ -0,0 +1,13 @@+vshow :: forall a -> Show a => a -> String+vshow t x = show (x :: t)++s1 = vshow Int    42+s2 = vshow Double 42++a1 = f (type (Int -> Bool))+a2 = f (type (Read T => T))+a3 = f (type (forall a. a))+a4 = f (type (forall a. Read a => String -> a))++foo = f (type (Maybe+            Int))
data/examples/declaration/value/function/strings-out.hs view
@@ -2,9 +2,13 @@  foo = "foobar" -bar = "foo\&barbaz"+bar = "foo\&bar\ \baz"  baz =   "foo\   \bar\   \baz"++weirdGap = "\65\ \0"++weirdEscape = "\^\ "
data/examples/declaration/value/function/strings.hs view
@@ -5,3 +5,7 @@ baz = "foo\       \bar\     \baz"++weirdGap = "\65\ \0"++weirdEscape = "\^\ "
+ data/examples/declaration/value/function/type-abstractions-out.hs view
@@ -0,0 +1,9 @@+id :: forall a. a -> a+id @t x = x :: t++f1 :: forall a. a -> forall b. b -> (a, b)+f1 @a x @b y = (x :: a, y :: b)++f2 =+  (\ @a x @b y -> (x :: a, y :: b)) ::+    forall a. a -> forall b. b -> (a, b)
+ data/examples/declaration/value/function/type-abstractions.hs view
@@ -0,0 +1,8 @@+id :: forall a. a -> a+id @t x = x :: t++f1 :: forall a. a -> forall b. b -> (a, b)+f1 @a x @b y = (x :: a, y :: b)++f2 = (\ @a x @b y -> (x :: a, y :: b) )+    :: forall a. a -> forall b. b -> (a, b)
data/examples/declaration/value/function/type-applications-out.hs view
@@ -14,3 +14,13 @@     @(HASH TPraosStandardCrypto)     @ByteString     "And the lamb lies down on Broadway"++test x = case x of+  Foo @t -> show @t 0+  Bar+    @t+    @u+    v ->+      ""++foo = foo @[k|bar|]
data/examples/declaration/value/function/type-applications.hs view
@@ -11,3 +11,11 @@   @(HASH TPraosStandardCrypto)   @ByteString   "And the lamb lies down on Broadway"++test x = case x of+  Foo  @t -> show @t 0+  Bar+   @t @u v+    -> ""++foo = foo @[k|bar|]
data/examples/declaration/value/function/unboxed-sums-out.hs view
@@ -1,10 +1,26 @@ {-# LANGUAGE UnboxedSums #-} +foo :: (# Int | Bool #) foo = (# 1 | #) +bar :: (# Int | Int | Int | Int #) bar = (# | | 2 | #) +baz ::+  (#+    Int |+    Int |+    Int |+    Int |+    Int |+    Int |+    Int |+    Int |+    Int+  #) baz =   (#     | | | 10 | | | | |   #)++type UbxPair = (# | #)
data/examples/declaration/value/function/unboxed-sums.hs view
@@ -1,7 +1,16 @@ {-# LANGUAGE UnboxedSums #-} +foo :: (# Int|Bool #) foo = (# 1 | #)++bar :: (#Int|Int|Int|Int #) bar = (# | |2| #)++baz :: (# Int |+  Int | Int | Int | Int | Int | Int |+  Int | Int #) baz = (# |   | | 10 | | | |   | #)++type UbxPair = (# |  #)
data/examples/declaration/value/function/unboxed-tuples-out.hs view
@@ -8,3 +8,6 @@     2,     3   #)++unit :: (# #)+unit = (# #)
data/examples/declaration/value/function/unboxed-tuples.hs view
@@ -5,3 +5,6 @@     1,     2,     3 #)++unit :: (##)+unit = (##)
data/examples/declaration/value/pattern-synonyms/explicitely-bidirectional-out.hs view
@@ -2,8 +2,7 @@  pattern P a <- C a where P a = C a -pattern HeadC x <--  x : xs+pattern HeadC x <- x : xs   where     HeadC x = [x] @@ -12,8 +11,7 @@   where     HeadC' x = [x] -pattern Simple <--  "Simple"+pattern Simple <- "Simple"   where     Simple = "Complicated" 
data/examples/declaration/warning/warning-multiline-out.hs view
@@ -7,3 +7,12 @@   #-} test :: IO () test = pure ()++instance+  {-# WARNING "Don't use" #-}+  Show G1 where+  show = "G1"++deriving instance+    {-# WARNING "to be removed" #-}+  Eq G2
data/examples/declaration/warning/warning-multiline.hs view
@@ -2,3 +2,11 @@   foo ["These are bad functions", "Really bad!"] #-} test :: IO () test = pure ()++instance+  {-# WARNING "Don't use" #-}+  Show G1 where+  show = "G1"++deriving instance+  {-# WARNING "to be removed" #-} Eq G2
data/examples/declaration/warning/warning-single-line-out.hs view
@@ -6,8 +6,19 @@ bar = 3 {-# DEPRECATED bar "Bar is deprecated" #-} -{-# DEPRECATED baz "Baz is also deprecated" #-}+{-# DEPRECATED data baz "Baz is also deprecated" #-} baz = 5  data Number = Number Dobule-{-# DEPRECATED Number "Use Scientific instead." #-}+{-# DEPRECATED type Number "Use Scientific instead." #-}++head (a : _) = a+{-# WARNING in "x-partial" head "This function is partial..." #-}++instance {-# DEPRECATED "Don't use" #-} Show T1++instance {-# WARNING "Don't use either" #-} Show G1++deriving instance {-# DEPRECATED "to be removed" #-} Eq T2++deriving instance {-# WARNING "to be removed as well" #-} Eq G2
data/examples/declaration/warning/warning-single-line.hs view
@@ -8,8 +8,17 @@  {-# Deprecated bar "Bar is deprecated" #-} -{-# DEPRECATED baz "Baz is also deprecated" #-}+{-# DEPRECATED data baz "Baz is also deprecated" #-} baz = 5  data Number = Number Dobule-{-# DEPRECATED Number "Use Scientific instead." #-}+{-# DEPRECATED type Number "Use Scientific instead." #-}++head (a:_) = a+{-# WARNING in "x-partial" head "This function is partial..." #-}++instance {-# DEPRECATED "Don't use" #-}     Show T1 where+instance {-# WARNING "Don't use either" #-} Show G1 where++deriving instance {-# DEPRECATED "to be removed" #-}      Eq T2+deriving instance {-# WARNING "to be removed as well" #-} Eq G2
+ data/examples/fixity/megaparsec-alternative-out.hs view
@@ -0,0 +1,8 @@+module MegaparsecExample where++import Text.Megaparsec++pValue =+  Object <$> parseObjectBody+    <|> Array <$> parseArrayBody+    <|> String <$> parseStringBody
+ data/examples/fixity/megaparsec-alternative.hs view
@@ -0,0 +1,8 @@+module MegaparsecExample where++import Text.Megaparsec++pValue =+  Object <$> parseObjectBody+    <|> Array <$> parseArrayBody+    <|> String <$> parseStringBody
+ data/examples/fixity/optics-mixed-out.hs view
@@ -0,0 +1,8 @@+module OpticsExample where++import Optics++updated =+  record+    & fieldLens % subFieldLens .~ someValue+    & otherLens %~ someTransformationFunctionApplied
+ data/examples/fixity/optics-mixed.hs view
@@ -0,0 +1,8 @@+module OpticsExample where++import Optics++updated =+  record+    & fieldLens % subFieldLens .~ someValue+    & otherLens %~ someTransformationFunctionApplied
+ data/examples/fixity/relude-default-operator-chain-out.hs view
@@ -0,0 +1,10 @@+module ReludeChainExample where++import Relude++resolveValue =+  primarySource+    ?: secondarySource+    ?: tertiarySource+    ?: quaternarySource+    ?: finalFallbackValue
+ data/examples/fixity/relude-default-operator-chain.hs view
@@ -0,0 +1,10 @@+module ReludeChainExample where++import Relude++resolveValue =+  primarySource+    ?: secondarySource+    ?: tertiarySource+    ?: quaternarySource+    ?: finalFallbackValue
+ data/examples/fixity/relude-default-operator-out.hs view
@@ -0,0 +1,7 @@+module ReludeExample where++import Relude++config =+  lookupOptionalSetting environment ?:+    defaultConfigurationValue
+ data/examples/fixity/relude-default-operator.hs view
@@ -0,0 +1,7 @@+module ReludeExample where++import Relude++config =+  lookupOptionalSetting environment+    ?: defaultConfigurationValue
+ data/examples/fixity/rio-ampersand-out.hs view
@@ -0,0 +1,7 @@+module RioExample where++import RIO++message =+  greetingText <> userNameText+    & Text.strip
+ data/examples/fixity/rio-ampersand.hs view
@@ -0,0 +1,7 @@+module RioExample where++import RIO++message =+  greetingText <> userNameText+    & Text.strip
+ data/examples/fixity/rio-deepseq-out.hs view
@@ -0,0 +1,7 @@+module RioDeepseqExample where++import RIO++result =+  forceEvaluationOfBigStructure `deepseq`+    continueWithNextStep
+ data/examples/fixity/rio-deepseq.hs view
@@ -0,0 +1,7 @@+module RioDeepseqExample where++import RIO++result =+  forceEvaluationOfBigStructure+    `deepseq` continueWithNextStep
+ data/examples/import/comment-before-merged-import-lists-out.hs view
@@ -0,0 +1,7 @@+-- their own formatters.+import Test.Hspec.Core.Formatters.V1.Monad+  ( FormatM,+    Formatter (..),+    Item (..),+    interpretWith,+  )
+ data/examples/import/comment-before-merged-import-lists.hs view
@@ -0,0 +1,7 @@+-- their own formatters.+import Test.Hspec.Core.Formatters.V1.Monad (+    Formatter(..)+  , FormatM+  )++import Test.Hspec.Core.Formatters.V1.Monad (Item(..), interpretWith)
+ data/examples/import/comment-before-merged-imports-out.hs view

file too large to diff

+ data/examples/import/comment-before-merged-imports.hs view

file too large to diff

+ data/examples/import/comment-between-merged-imports-out.hs view

file too large to diff

+ data/examples/import/comment-between-merged-imports.hs view

file too large to diff

+ data/examples/import/comment-inside-empty-import-list-out.hs view

file too large to diff

+ data/examples/import/comment-inside-empty-import-list.hs view

file too large to diff

+ data/examples/import/comment-inside-sorted-import-list-out.hs view

file too large to diff

+ data/examples/import/comment-inside-sorted-import-list.hs view

file too large to diff

data/examples/import/comments-inside-imports-out.hs view

file too large to diff

data/examples/import/comments-per-import-out.hs view

file too large to diff

+ data/examples/import/data-out.hs view

file too large to diff

+ data/examples/import/data.hs view

file too large to diff

+ data/examples/import/deprecated-export-multi-line-out.hs view

file too large to diff

+ data/examples/import/deprecated-export-multi-line.hs view

file too large to diff

+ data/examples/import/deprecated-export-single-line-out.hs view

file too large to diff

+ data/examples/import/deprecated-export-single-line.hs view

file too large to diff

+ data/examples/import/docstrings-after-exports-out.hs view

file too large to diff

+ data/examples/import/docstrings-after-exports.hs view

file too large to diff

data/examples/import/explicit-imports-with-comments-out.hs view

file too large to diff

+ data/examples/import/explicit-level-imports-out.hs view

file too large to diff

+ data/examples/import/explicit-level-imports-qualified-post-out.hs view

file too large to diff

+ data/examples/import/explicit-level-imports-qualified-post.hs view

file too large to diff

+ data/examples/import/explicit-level-imports.hs view

file too large to diff

+ data/examples/import/implicit-prelude-package-out.hs view

file too large to diff

+ data/examples/import/implicit-prelude-package.hs view

file too large to diff

data/examples/import/merging-0-out.hs view

file too large to diff

data/examples/import/merging-1-out.hs view

file too large to diff

data/examples/import/merging-2-out.hs view

file too large to diff

+ data/examples/import/no-implicit-prelude-out.hs view

file too large to diff

+ data/examples/import/no-implicit-prelude-package-out.hs view

file too large to diff

+ data/examples/import/no-implicit-prelude-package.hs view

file too large to diff

+ data/examples/import/no-implicit-prelude.hs view

file too large to diff

data/examples/import/simple-out.hs view

file too large to diff

+ data/examples/import/sorted-package-imports-out.hs view

file too large to diff

+ data/examples/import/sorted-package-imports.hs view

file too large to diff

+ data/examples/module-header/block-haddock-in-export-list-out.hs view

file too large to diff

+ data/examples/module-header/block-haddock-in-export-list.hs view

file too large to diff

+ data/examples/module-header/empty-haddock-out.hs view

file too large to diff

+ data/examples/module-header/empty-haddock.hs view

file too large to diff

+ data/examples/module-header/multiline-empty-comment-out.hs view

file too large to diff

+ data/examples/module-header/multiline-empty-comment.hs view

file too large to diff

data/examples/other/argument-comment-out.hs view

file too large to diff

+ data/examples/other/block-comment-before-argument-out.hs view

file too large to diff

+ data/examples/other/block-comment-before-argument.hs view

file too large to diff

+ data/examples/other/block-comment-before-element-out.hs view

file too large to diff

+ data/examples/other/block-comment-before-element.hs view

file too large to diff

+ data/examples/other/comment-around-quasiquote-out.hs view

file too large to diff

+ data/examples/other/comment-around-quasiquote.hs view

file too large to diff

+ data/examples/other/comment-block-section-heading-out.hs view

file too large to diff

+ data/examples/other/comment-block-section-heading.hs view

file too large to diff

+ data/examples/other/comment-empty-let-out.hs view

file too large to diff

+ data/examples/other/comment-empty-let.hs view

file too large to diff

data/examples/other/comment-glued-together-out.hs view

file too large to diff

+ data/examples/other/comment-in-empty-list-out.hs view

file too large to diff

+ data/examples/other/comment-in-empty-list.hs view

file too large to diff

+ data/examples/other/comment-opening-a-list-out.hs view

file too large to diff

+ data/examples/other/comment-opening-a-list.hs view

file too large to diff

+ data/examples/other/comment-spacing-out.hs view

file too large to diff

+ data/examples/other/comment-spacing.hs view

file too large to diff

data/examples/other/comment-style-transform-out.hs view

file too large to diff

+ data/examples/other/comment-trailing-blank-line-do-out.hs view

file too large to diff

+ data/examples/other/comment-trailing-blank-line-do.hs view

file too large to diff

+ data/examples/other/comment-trailing-blank-line-let-out.hs view

file too large to diff

+ data/examples/other/comment-trailing-blank-line-let.hs view

file too large to diff

+ data/examples/other/comment-trailing-blank-line-variants-out.hs view

file too large to diff

+ data/examples/other/comment-trailing-blank-line-variants.hs view

file too large to diff

+ data/examples/other/comment-trailing-blank-line-where-out.hs view

file too large to diff

+ data/examples/other/comment-trailing-blank-line-where.hs view

file too large to diff

+ data/examples/other/comment-trailing-no-blank-line-out.hs view

file too large to diff

+ data/examples/other/comment-trailing-no-blank-line.hs view

file too large to diff

+ data/examples/other/comment-trigger-escaping-out.hs view

file too large to diff

+ data/examples/other/comment-trigger-escaping.hs view

file too large to diff

data/examples/other/comment-two-blocks-out.hs view

file too large to diff

data/examples/other/cpp/continuation-out.hs view

file too large to diff

data/examples/other/cpp/continuation.hs view

file too large to diff

+ data/examples/other/cpp/cpp-and-imports-out.hs view

file too large to diff

+ data/examples/other/cpp/cpp-and-imports.hs view

file too large to diff

data/examples/other/cpp/lonely-hash-out.hs view

file too large to diff

data/examples/other/cpp/lonely-hash.hs view

file too large to diff

data/examples/other/cpp/separation-0a-out.hs view

file too large to diff

data/examples/other/cpp/separation-0a.hs view

file too large to diff

data/examples/other/cpp/separation-0b-out.hs view

file too large to diff

data/examples/other/cpp/separation-0b.hs view

file too large to diff

data/examples/other/cpp/separation-1a-out.hs view

file too large to diff

data/examples/other/cpp/separation-1a.hs view

file too large to diff

data/examples/other/cpp/separation-1b-out.hs view

file too large to diff

data/examples/other/cpp/separation-1b.hs view

file too large to diff

data/examples/other/cpp/separation-2a-out.hs view

file too large to diff

data/examples/other/cpp/separation-2a.hs view

file too large to diff

data/examples/other/cpp/separation-2b-out.hs view

file too large to diff

data/examples/other/cpp/separation-2b.hs view

file too large to diff

data/examples/other/cpp/shifted-out.hs view

file too large to diff

data/examples/other/cpp/shifted.hs view

file too large to diff

data/examples/other/cpp/simple-import-out.hs view

file too large to diff

data/examples/other/cpp/simple-import.hs view

file too large to diff

+ data/examples/other/disabling/closing-comment-in-disabled-region-out.hs view

file too large to diff

+ data/examples/other/disabling/closing-comment-in-disabled-region.hs view

file too large to diff

+ data/examples/other/disabling/empty-disabled-region-out.hs view

file too large to diff

+ data/examples/other/disabling/empty-disabled-region.hs view

file too large to diff

− data/examples/other/disabling/indented-fragment-out.hs

file too large to diff

− data/examples/other/disabling/indented-fragment.hs

file too large to diff

+ data/examples/other/disabling/line-pragma-in-disabled-region-out.hs view

file too large to diff

+ data/examples/other/disabling/line-pragma-in-disabled-region.hs view

file too large to diff

+ data/examples/other/disabling/normalize-magic-comments-out.hs view

file too large to diff

+ data/examples/other/disabling/normalize-magic-comments.hs view

file too large to diff

+ data/examples/other/disabling/preserve-empty-lines-out.hs view

file too large to diff

+ data/examples/other/disabling/preserve-empty-lines.hs view

file too large to diff

+ data/examples/other/disabling/preserve-trailing-whitespace-out.hs view

file too large to diff

+ data/examples/other/disabling/preserve-trailing-whitespace.hs view

file too large to diff

+ data/examples/other/disabling/suffix-comment-out.hs view

file too large to diff

+ data/examples/other/disabling/suffix-comment.hs view

file too large to diff

data/examples/other/empty-forall-out.hs view

file too large to diff

data/examples/other/empty-haddock-out.hs view

file too large to diff

data/examples/other/empty-haddock.hs view

file too large to diff

data/examples/other/inline-comment-1-out.hs view

file too large to diff

+ data/examples/other/invalid-haddock-1-out.hs view

file too large to diff

+ data/examples/other/invalid-haddock-1.hs view

file too large to diff

+ data/examples/other/invalid-haddock-2-out.hs view

file too large to diff

+ data/examples/other/invalid-haddock-2.hs view

file too large to diff

+ data/examples/other/invalid-haddock-double-trigger-out.hs view

file too large to diff

+ data/examples/other/invalid-haddock-double-trigger.hs view

file too large to diff

+ data/examples/other/invalid-haddock-weird-out.hs view

file too large to diff

+ data/examples/other/invalid-haddock-weird.hs view

file too large to diff

+ data/examples/other/jsffi-out.hs view

file too large to diff

+ data/examples/other/jsffi.hs view

file too large to diff

data/examples/other/multiline-forall-out.hs view

file too large to diff

+ data/examples/other/necessary-brackets-out.hs view

file too large to diff

+ data/examples/other/necessary-brackets.hs view

file too large to diff

− data/examples/other/no-linear-arrows-out.hs

file too large to diff

− data/examples/other/no-linear-arrows.hs

file too large to diff

+ data/examples/other/pragma-below-header-out.hs view

file too large to diff

+ data/examples/other/pragma-below-header.hs view

file too large to diff

+ data/examples/other/pragma-comment-multi-extension-out.hs view

file too large to diff

+ data/examples/other/pragma-comment-multi-extension.hs view

file too large to diff

data/examples/other/pragma-sorting-out.hs view

file too large to diff

data/examples/other/pragma-sorting.hs view

file too large to diff

+ data/parse-failures/disabling-preserves-error-location.hs view

file too large to diff

+ data/parse-failures/line-pragma.hs view

file too large to diff

+ extract-hackage-info/hackage-info.bin view

file too large to diff

ormolu.cabal view

file too large to diff

src/GHC/DynFlags.hs view

file too large to diff

src/Ormolu.hs view

file too large to diff

+ src/Ormolu/Comments/Anchor.hs view

file too large to diff

+ src/Ormolu/Comments/Invariants.hs view

file too large to diff

+ src/Ormolu/Comments/Tree.hs view

file too large to diff

src/Ormolu/Config.hs view

file too large to diff

src/Ormolu/Diff/ParseResult.hs view

file too large to diff

src/Ormolu/Diff/Text.hs view

file too large to diff

src/Ormolu/Exception.hs view

file too large to diff

+ src/Ormolu/Fixity.hs view

file too large to diff

+ src/Ormolu/Fixity/Imports.hs view

file too large to diff

+ src/Ormolu/Fixity/Internal.hs view

file too large to diff

+ src/Ormolu/Fixity/Parser.hs view

file too large to diff

+ src/Ormolu/Fixity/Printer.hs view

file too large to diff

src/Ormolu/Imports.hs view

file too large to diff

src/Ormolu/Parser.hs view

file too large to diff

− src/Ormolu/Parser/Anns.hs

file too large to diff

src/Ormolu/Parser/CommentStream.hs view

file too large to diff

src/Ormolu/Parser/Pragma.hs view

file too large to diff

src/Ormolu/Parser/Result.hs view

file too large to diff

− src/Ormolu/Parser/Shebang.hs

file too large to diff

src/Ormolu/Printer.hs view

file too large to diff

src/Ormolu/Printer/Combinators.hs view

file too large to diff

+ src/Ormolu/Printer/CommentPlacement.hs view

file too large to diff

src/Ormolu/Printer/Comments.hs view

file too large to diff

src/Ormolu/Printer/Internal.hs view

file too large to diff

src/Ormolu/Printer/Meat/Common.hs view

file too large to diff

src/Ormolu/Printer/Meat/Declaration.hs view

file too large to diff

src/Ormolu/Printer/Meat/Declaration/Annotation.hs view

file too large to diff

src/Ormolu/Printer/Meat/Declaration/Class.hs view

file too large to diff

src/Ormolu/Printer/Meat/Declaration/Data.hs view

file too large to diff

src/Ormolu/Printer/Meat/Declaration/Default.hs view

file too large to diff

src/Ormolu/Printer/Meat/Declaration/Foreign.hs view

file too large to diff

src/Ormolu/Printer/Meat/Declaration/Instance.hs view

file too large to diff

+ src/Ormolu/Printer/Meat/Declaration/OpTree.hs view

file too large to diff

+ src/Ormolu/Printer/Meat/Declaration/OpTree.hs-boot view

file too large to diff

src/Ormolu/Printer/Meat/Declaration/RoleAnnotation.hs view

file too large to diff

src/Ormolu/Printer/Meat/Declaration/Rule.hs view

file too large to diff

src/Ormolu/Printer/Meat/Declaration/Signature.hs view

file too large to diff

+ src/Ormolu/Printer/Meat/Declaration/Signature.hs-boot view

file too large to diff

src/Ormolu/Printer/Meat/Declaration/Splice.hs view

file too large to diff

+ src/Ormolu/Printer/Meat/Declaration/StringLiteral.hs view

file too large to diff

src/Ormolu/Printer/Meat/Declaration/Type.hs view

file too large to diff

src/Ormolu/Printer/Meat/Declaration/TypeFamily.hs view

file too large to diff

src/Ormolu/Printer/Meat/Declaration/Value.hs view

file too large to diff

src/Ormolu/Printer/Meat/Declaration/Value.hs-boot view

file too large to diff

src/Ormolu/Printer/Meat/Declaration/Warning.hs view

file too large to diff

src/Ormolu/Printer/Meat/ImportExport.hs view

file too large to diff

src/Ormolu/Printer/Meat/Module.hs view

file too large to diff

src/Ormolu/Printer/Meat/Pragma.hs view

file too large to diff

src/Ormolu/Printer/Meat/Type.hs view

file too large to diff

src/Ormolu/Printer/Operators.hs view

file too large to diff

− src/Ormolu/Printer/SpanStream.hs

file too large to diff

src/Ormolu/Processing/Common.hs view

file too large to diff

src/Ormolu/Processing/Cpp.hs view

file too large to diff

− src/Ormolu/Processing/Postprocess.hs

file too large to diff

src/Ormolu/Processing/Preprocess.hs view

file too large to diff

src/Ormolu/Terminal.hs view

file too large to diff

+ src/Ormolu/Terminal/QualifiedDo.hs view

file too large to diff

src/Ormolu/Utils.hs view

file too large to diff

+ src/Ormolu/Utils/Cabal.hs view

file too large to diff

+ src/Ormolu/Utils/Fixity.hs view

file too large to diff

+ src/Ormolu/Utils/IO.hs view

file too large to diff

+ tests/Ormolu/CabalInfoSpec.hs view

file too large to diff

+ tests/Ormolu/Comments/AnchorSpec.hs view

file too large to diff

tests/Ormolu/Diff/TextSpec.hs view

file too large to diff

+ tests/Ormolu/Fixity/ParserSpec.hs view

file too large to diff

+ tests/Ormolu/Fixity/PrinterSpec.hs view

file too large to diff

+ tests/Ormolu/FixitySpec.hs view

file too large to diff

+ tests/Ormolu/OpTreeSpec.hs view

file too large to diff

tests/Ormolu/Parser/OptionsSpec.hs view

file too large to diff

+ tests/Ormolu/Parser/ParseFailureSpec.hs view

file too large to diff

tests/Ormolu/Parser/PragmaSpec.hs view

file too large to diff

tests/Ormolu/PrinterSpec.hs view

file too large to diff

+ tests/Ormolu/TestConfig.hs view

file too large to diff