├── .envrc ├── .github ├── dependabot.yml └── workflows │ ├── binaries.yml │ └── ci.yml ├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── DESIGN.md ├── LICENSE.md ├── README.md ├── app └── Main.hs ├── cabal.project ├── data ├── cabal-tests │ ├── Bar.hs │ ├── Foo.hs │ └── test.cabal ├── diff-tests │ ├── inputs │ │ ├── applicative-after.hs │ │ ├── applicative-before.hs │ │ ├── empty.hs │ │ ├── longer-v2.hs │ │ ├── longer.hs │ │ ├── main-and-bar-v2.hs │ │ ├── main-and-bar.hs │ │ ├── main-and-baz-v2.hs │ │ ├── main-and-baz.hs │ │ ├── main-and-foo-v2.hs │ │ ├── main-and-foo.hs │ │ ├── main-foo.hs │ │ ├── main-v2.hs │ │ ├── main.hs │ │ ├── no-trailing-blank-line.hs │ │ ├── one-line.hs │ │ ├── spaced-v2.hs │ │ ├── spaced.hs │ │ └── with-trailing-blank-line.hs │ └── outputs │ │ ├── joined-hunk.txt │ │ ├── no-following.txt │ │ ├── no-preceding.txt │ │ ├── one-line-added.txt │ │ ├── one-line-removed.txt │ │ ├── simple-hunk.txt │ │ ├── trailing-blank-line.txt │ │ ├── trimming-trailing-both-eof.txt │ │ ├── trimming-trailing-both-out-of-margin.txt │ │ ├── trimming.txt │ │ └── two-hunks.txt ├── examples │ ├── backpack │ │ ├── signature-0-out.hsig │ │ └── signature-0.hsig │ ├── declaration │ │ ├── annotation │ │ │ ├── annotation-out.hs │ │ │ └── annotation.hs │ │ ├── class │ │ │ ├── associated-data1-out.hs │ │ │ ├── associated-data1.hs │ │ │ ├── associated-data2-out.hs │ │ │ ├── associated-data2.hs │ │ │ ├── associated-type-defaults-out.hs │ │ │ ├── associated-type-defaults.hs │ │ │ ├── associated-types1-out.hs │ │ │ ├── associated-types1.hs │ │ │ ├── associated-types2-out.hs │ │ │ ├── associated-types2.hs │ │ │ ├── default-implementations-comments-out.hs │ │ │ ├── default-implementations-comments.hs │ │ │ ├── default-implementations-out.hs │ │ │ ├── default-implementations.hs │ │ │ ├── default-signatures-out.hs │ │ │ ├── default-signatures-simple-out.hs │ │ │ ├── default-signatures-simple.hs │ │ │ ├── default-signatures.hs │ │ │ ├── dependency-super-classes-out.hs │ │ │ ├── dependency-super-classes.hs │ │ │ ├── empty-classes-out.hs │ │ │ ├── empty-classes.hs │ │ │ ├── functional-dependencies-out.hs │ │ │ ├── functional-dependencies.hs │ │ │ ├── multi-parameters1-out.hs │ │ │ ├── multi-parameters1.hs │ │ │ ├── multi-parameters2-out.hs │ │ │ ├── multi-parameters2.hs │ │ │ ├── newlines-after-where-out.hs │ │ │ ├── newlines-after-where.hs │ │ │ ├── newlines-and-default-decls-out.hs │ │ │ ├── newlines-and-default-decls.hs │ │ │ ├── newlines-and-haddocks-out.hs │ │ │ ├── newlines-and-haddocks.hs │ │ │ ├── newlines-between-methods-out.hs │ │ │ ├── newlines-between-methods.hs │ │ │ ├── poly-kinded-classes-out.hs │ │ │ ├── poly-kinded-classes.hs │ │ │ ├── single-parameters-out.hs │ │ │ ├── single-parameters.hs │ │ │ ├── super-classes-out.hs │ │ │ ├── super-classes.hs │ │ │ ├── type-operators1-out.hs │ │ │ ├── type-operators1.hs │ │ │ ├── type-operators2-out.hs │ │ │ ├── type-operators2.hs │ │ │ ├── type-operators3-out.hs │ │ │ └── type-operators3.hs │ │ ├── data │ │ │ ├── ctype-0-out.hs │ │ │ ├── ctype-0.hs │ │ │ ├── ctype-1-out.hs │ │ │ ├── ctype-1.hs │ │ │ ├── datatype-contexts-out.hs │ │ │ ├── datatype-contexts.hs │ │ │ ├── deriving-out.hs │ │ │ ├── deriving-strategies-out.hs │ │ │ ├── deriving-strategies.hs │ │ │ ├── deriving.hs │ │ │ ├── empty-out.hs │ │ │ ├── empty.hs │ │ │ ├── existential-multiline-out.hs │ │ │ ├── existential-multiline.hs │ │ │ ├── existential-out.hs │ │ │ ├── existential-unicode-out.hs │ │ │ ├── existential-unicode.hs │ │ │ ├── existential.hs │ │ │ ├── fat-multiline-out.hs │ │ │ ├── fat-multiline.hs │ │ │ ├── field-layout │ │ │ │ ├── gadt-out.hs │ │ │ │ ├── gadt.hs │ │ │ │ ├── record-0-out.hs │ │ │ │ ├── record-0.hs │ │ │ │ ├── record-1-out.hs │ │ │ │ ├── record-1.hs │ │ │ │ ├── record-2-out.hs │ │ │ │ ├── record-2.hs │ │ │ │ ├── variants-out.hs │ │ │ │ └── variants.hs │ │ │ ├── gadt-syntax-out.hs │ │ │ ├── gadt-syntax.hs │ │ │ ├── gadt │ │ │ │ ├── multiline-out.hs │ │ │ │ ├── multiline-where-out.hs │ │ │ │ ├── multiline-where.hs │ │ │ │ ├── multiline.hs │ │ │ │ ├── multiple-declaration-out.hs │ │ │ │ ├── multiple-declaration.hs │ │ │ │ ├── record-out.hs │ │ │ │ ├── record.hs │ │ │ │ ├── simple-out.hs │ │ │ │ ├── simple.hs │ │ │ │ ├── strictness-out.hs │ │ │ │ ├── strictness.hs │ │ │ │ ├── unicode-out.hs │ │ │ │ └── unicode.hs │ │ │ ├── infix-haddocks-out.hs │ │ │ ├── infix-haddocks.hs │ │ │ ├── infix-out.hs │ │ │ ├── infix.hs │ │ │ ├── invisible-binders-out.hs │ │ │ ├── invisible-binders.hs │ │ │ ├── kind-annotations-out.hs │ │ │ ├── kind-annotations.hs │ │ │ ├── multiline-arg-parens-out.hs │ │ │ ├── multiline-arg-parens.hs │ │ │ ├── multiline-names-out.hs │ │ │ ├── multiline-names.hs │ │ │ ├── multiline-out.hs │ │ │ ├── multiline.hs │ │ │ ├── newtype-out.hs │ │ │ ├── newtype.hs │ │ │ ├── operators-out.hs │ │ │ ├── operators.hs │ │ │ ├── partly-documented-out.hs │ │ │ ├── partly-documented.hs │ │ │ ├── record-fancy-existential-out.hs │ │ │ ├── record-fancy-existential.hs │ │ │ ├── record-multi-const-out.hs │ │ │ ├── record-multi-const.hs │ │ │ ├── record-out.hs │ │ │ ├── record-singleline-out.hs │ │ │ ├── record-singleline.hs │ │ │ ├── record.hs │ │ │ ├── simple-broken-out.hs │ │ │ ├── simple-broken.hs │ │ │ ├── simple-out.hs │ │ │ ├── simple.hs │ │ │ ├── single-constructor-with-haddock-out.hs │ │ │ ├── single-constructor-with-haddock.hs │ │ │ ├── strictness-out.hs │ │ │ ├── strictness.hs │ │ │ ├── type-data-out.hs │ │ │ ├── type-data.hs │ │ │ ├── unnamed-field-comment-0-out.hs │ │ │ ├── unnamed-field-comment-0.hs │ │ │ ├── unnamed-field-comment-1-out.hs │ │ │ ├── unnamed-field-comment-1.hs │ │ │ ├── unnamed-field-comment-2-out.hs │ │ │ ├── unnamed-field-comment-2.hs │ │ │ ├── unnamed-field-comment-3-out.hs │ │ │ ├── unnamed-field-comment-3.hs │ │ │ ├── wildcard-binders-out.hs │ │ │ ├── wildcard-binders.hs │ │ │ ├── with-comment-out.hs │ │ │ ├── with-comment.hs │ │ │ ├── with-weird-haddock-out.hs │ │ │ └── with-weird-haddock.hs │ │ ├── default │ │ │ ├── default-out.hs │ │ │ └── default.hs │ │ ├── deriving │ │ │ ├── multiline-out.hs │ │ │ ├── multiline.hs │ │ │ ├── overlapping-out.hs │ │ │ ├── overlapping.hs │ │ │ ├── singleline-out.hs │ │ │ └── singleline.hs │ │ ├── foreign │ │ │ ├── foreign-export-out.hs │ │ │ ├── foreign-export.hs │ │ │ ├── foreign-import-out.hs │ │ │ └── foreign-import.hs │ │ ├── instance │ │ │ ├── associated-data-out.hs │ │ │ ├── associated-data.hs │ │ │ ├── associated-types-out.hs │ │ │ ├── associated-types.hs │ │ │ ├── contexts-comments-out.hs │ │ │ ├── contexts-comments.hs │ │ │ ├── contexts-out.hs │ │ │ ├── contexts.hs │ │ │ ├── data-family-instances-gadt-out.hs │ │ │ ├── data-family-instances-gadt.hs │ │ │ ├── data-family-instances-newtype-out.hs │ │ │ ├── data-family-instances-newtype.hs │ │ │ ├── data-family-instances-out.hs │ │ │ ├── data-family-instances.hs │ │ │ ├── empty-instance-out.hs │ │ │ ├── empty-instance.hs │ │ │ ├── instance-sigs-multiple-out.hs │ │ │ ├── instance-sigs-multiple.hs │ │ │ ├── instance-sigs-out.hs │ │ │ ├── instance-sigs.hs │ │ │ ├── multi-parameter-out.hs │ │ │ ├── multi-parameter.hs │ │ │ ├── newlines-after-where-out.hs │ │ │ ├── newlines-after-where.hs │ │ │ ├── newlines-between-methods-out.hs │ │ │ ├── newlines-between-methods.hs │ │ │ ├── overlappable-instances-out.hs │ │ │ ├── overlappable-instances.hs │ │ │ ├── single-parameter-out.hs │ │ │ ├── single-parameter.hs │ │ │ ├── type-family-instances-out.hs │ │ │ └── type-family-instances.hs │ │ ├── rewrite-rule │ │ │ ├── basic1-out.hs │ │ │ ├── basic1.hs │ │ │ ├── basic2-out.hs │ │ │ ├── basic2.hs │ │ │ ├── empty-out.hs │ │ │ ├── empty.hs │ │ │ ├── forall-0-out.hs │ │ │ ├── forall-0.hs │ │ │ ├── forall-1-out.hs │ │ │ ├── forall-1.hs │ │ │ ├── never-active-out.hs │ │ │ ├── never-active.hs │ │ │ ├── phase-out.hs │ │ │ ├── phase.hs │ │ │ ├── prelude1-out.hs │ │ │ ├── prelude1.hs │ │ │ ├── prelude2-out.hs │ │ │ ├── prelude2.hs │ │ │ ├── prelude3-out.hs │ │ │ ├── prelude3.hs │ │ │ ├── prelude4-out.hs │ │ │ ├── prelude4.hs │ │ │ ├── type-signature-out.hs │ │ │ └── type-signature.hs │ │ ├── role-annotation │ │ │ ├── multi-line-out.hs │ │ │ ├── multi-line.hs │ │ │ ├── single-line-out.hs │ │ │ └── single-line.hs │ │ ├── signature │ │ │ ├── complete │ │ │ │ ├── complete-out.hs │ │ │ │ └── complete.hs │ │ │ ├── fixity │ │ │ │ ├── infix-out.hs │ │ │ │ ├── infix.hs │ │ │ │ ├── infixl-out.hs │ │ │ │ ├── infixl.hs │ │ │ │ ├── infixr-out.hs │ │ │ │ └── infixr.hs │ │ │ ├── inline │ │ │ │ ├── conlike-out.hs │ │ │ │ ├── conlike.hs │ │ │ │ ├── inline-out.hs │ │ │ │ ├── inline.hs │ │ │ │ ├── inlineable-out.hs │ │ │ │ ├── inlineable.hs │ │ │ │ ├── noinline-out.hs │ │ │ │ └── noinline.hs │ │ │ ├── minimal │ │ │ │ ├── minimal-out.hs │ │ │ │ └── minimal.hs │ │ │ ├── pattern │ │ │ │ ├── multiline-out.hs │ │ │ │ ├── multiline.hs │ │ │ │ ├── single-line-out.hs │ │ │ │ └── single-line.hs │ │ │ ├── set-cost-centre │ │ │ │ ├── set-cost-centre-out.hs │ │ │ │ └── set-cost-centre.hs │ │ │ ├── specialize │ │ │ │ ├── specialize-instance-out.hs │ │ │ │ ├── specialize-instance.hs │ │ │ │ ├── specialize-out.hs │ │ │ │ └── specialize.hs │ │ │ ├── standalone-kind-out.hs │ │ │ ├── standalone-kind.hs │ │ │ └── type │ │ │ │ ├── arguments-out.hs │ │ │ │ ├── arguments.hs │ │ │ │ ├── context-multi-line-out.hs │ │ │ │ ├── context-multi-line.hs │ │ │ │ ├── context-single-line-out.hs │ │ │ │ ├── context-single-line.hs │ │ │ │ ├── infix-promoted-type-constructor-out.hs │ │ │ │ ├── infix-promoted-type-constructor.hs │ │ │ │ ├── long-function-name-out.hs │ │ │ │ ├── long-function-name.hs │ │ │ │ ├── long-multiline-applications-out.hs │ │ │ │ ├── long-multiline-applications.hs │ │ │ │ ├── multi-value-out.hs │ │ │ │ ├── multi-value.hs │ │ │ │ ├── unicode-out.hs │ │ │ │ ├── unicode.hs │ │ │ │ ├── unrelated-out.hs │ │ │ │ └── unrelated.hs │ │ ├── splice │ │ │ ├── bracket-declaration-out.hs │ │ │ ├── bracket-declaration.hs │ │ │ ├── bracket-out.hs │ │ │ ├── bracket-unicode-out.hs │ │ │ ├── bracket-unicode.hs │ │ │ ├── bracket.hs │ │ │ ├── grouped-splices-out.hs │ │ │ ├── grouped-splices.hs │ │ │ ├── quasiquote-out.hs │ │ │ ├── quasiquote.hs │ │ │ ├── quotes-out.hs │ │ │ ├── quotes.hs │ │ │ ├── splice-decl-out.hs │ │ │ ├── splice-decl.hs │ │ │ ├── typed-splice-out.hs │ │ │ ├── typed-splice.hs │ │ │ ├── untyped-splice-out.hs │ │ │ └── untyped-splice.hs │ │ ├── type-families │ │ │ ├── closed-type-family │ │ │ │ ├── infix-out.hs │ │ │ │ ├── infix.hs │ │ │ │ ├── injective-out.hs │ │ │ │ ├── injective.hs │ │ │ │ ├── multi-line-out.hs │ │ │ │ ├── multi-line.hs │ │ │ │ ├── no-annotation-out.hs │ │ │ │ ├── no-annotation.hs │ │ │ │ ├── promotion-out.hs │ │ │ │ ├── promotion.hs │ │ │ │ ├── simple-out.hs │ │ │ │ ├── simple.hs │ │ │ │ ├── type-arguments-out.hs │ │ │ │ ├── type-arguments.hs │ │ │ │ ├── with-comments-out.hs │ │ │ │ ├── with-comments.hs │ │ │ │ ├── with-equal-sign-out.hs │ │ │ │ ├── with-equal-sign.hs │ │ │ │ ├── with-forall-out.hs │ │ │ │ └── with-forall.hs │ │ │ ├── data-family │ │ │ │ ├── no-annotation-out.hs │ │ │ │ ├── no-annotation.hs │ │ │ │ ├── simple-out.hs │ │ │ │ ├── simple.hs │ │ │ │ ├── type-arguments-out.hs │ │ │ │ └── type-arguments.hs │ │ │ └── type-family │ │ │ │ ├── injective-out.hs │ │ │ │ ├── injective.hs │ │ │ │ ├── no-annotation-out.hs │ │ │ │ ├── no-annotation.hs │ │ │ │ ├── operator-out.hs │ │ │ │ ├── operator.hs │ │ │ │ ├── simple-out.hs │ │ │ │ └── simple.hs │ │ ├── type-synonyms │ │ │ ├── multi-line-out.hs │ │ │ ├── multi-line.hs │ │ │ ├── simple-out.hs │ │ │ ├── simple.hs │ │ │ ├── with-weird-haddock-out.hs │ │ │ └── with-weird-haddock.hs │ │ ├── type │ │ │ ├── forall-out.hs │ │ │ ├── forall.hs │ │ │ ├── lits-out.hs │ │ │ ├── lits.hs │ │ │ ├── misc-kind-signatures-out.hs │ │ │ ├── misc-kind-signatures.hs │ │ │ ├── parens-comments-out.hs │ │ │ ├── parens-comments.hs │ │ │ ├── promotion-0-out.hs │ │ │ ├── promotion-0.hs │ │ │ ├── promotion-1-out.hs │ │ │ ├── promotion-1.hs │ │ │ ├── promotion-no-puns-out.hs │ │ │ ├── promotion-no-puns.hs │ │ │ ├── splice-out.hs │ │ │ ├── splice.hs │ │ │ ├── type-applications-out.hs │ │ │ ├── type-applications.hs │ │ │ ├── visible-forall-out.hs │ │ │ ├── visible-forall.hs │ │ │ ├── wildcard-binders-out.hs │ │ │ └── wildcard-binders.hs │ │ ├── value │ │ │ ├── function │ │ │ │ ├── application-0-out.hs │ │ │ │ ├── application-0.hs │ │ │ │ ├── application-1-out.hs │ │ │ │ ├── application-1.hs │ │ │ │ ├── application-2-out.hs │ │ │ │ ├── application-2.hs │ │ │ │ ├── arg-breakpoints-out.hs │ │ │ │ ├── arg-breakpoints.hs │ │ │ │ ├── arithmetic-sequences-out.hs │ │ │ │ ├── arithmetic-sequences.hs │ │ │ │ ├── arrow │ │ │ │ │ ├── multiline-case-out.hs │ │ │ │ │ ├── multiline-case.hs │ │ │ │ │ ├── proc-applications-out.hs │ │ │ │ │ ├── proc-applications.hs │ │ │ │ │ ├── proc-applications2-out.hs │ │ │ │ │ ├── proc-applications2.hs │ │ │ │ │ ├── proc-cases-out.hs │ │ │ │ │ ├── proc-cases.hs │ │ │ │ │ ├── proc-do-complex-out.hs │ │ │ │ │ ├── proc-do-complex.hs │ │ │ │ │ ├── proc-do-simple1-out.hs │ │ │ │ │ ├── proc-do-simple1.hs │ │ │ │ │ ├── proc-do-simple2-out.hs │ │ │ │ │ ├── proc-do-simple2.hs │ │ │ │ │ ├── proc-form-do-indent-out.hs │ │ │ │ │ ├── proc-form-do-indent.hs │ │ │ │ │ ├── proc-forms1-out.hs │ │ │ │ │ ├── proc-forms1.hs │ │ │ │ │ ├── proc-forms2-out.hs │ │ │ │ │ ├── proc-forms2.hs │ │ │ │ │ ├── proc-ifs-out.hs │ │ │ │ │ ├── proc-ifs.hs │ │ │ │ │ ├── proc-lambdas-out.hs │ │ │ │ │ ├── proc-lambdas.hs │ │ │ │ │ ├── proc-lets-out.hs │ │ │ │ │ ├── proc-lets.hs │ │ │ │ │ ├── proc-parentheses-out.hs │ │ │ │ │ ├── proc-parentheses.hs │ │ │ │ │ ├── recursive-procs-out.hs │ │ │ │ │ └── recursive-procs.hs │ │ │ │ ├── awkward-comment-0-out.hs │ │ │ │ ├── awkward-comment-0.hs │ │ │ │ ├── awkward-comment-1-out.hs │ │ │ │ ├── awkward-comment-1.hs │ │ │ │ ├── backticks-lhs-out.hs │ │ │ │ ├── backticks-lhs.hs │ │ │ │ ├── backticks-out.hs │ │ │ │ ├── backticks.hs │ │ │ │ ├── blank-lines-let-out.hs │ │ │ │ ├── blank-lines-let.hs │ │ │ │ ├── blank-lines-where-out.hs │ │ │ │ ├── blank-lines-where.hs │ │ │ │ ├── block-arguments-out.hs │ │ │ │ ├── block-arguments.hs │ │ │ │ ├── builtin-syntax-out.hs │ │ │ │ ├── builtin-syntax.hs │ │ │ │ ├── case-empty-out.hs │ │ │ │ ├── case-empty.hs │ │ │ │ ├── case-multi-line-guards-out.hs │ │ │ │ ├── case-multi-line-guards.hs │ │ │ │ ├── case-multi-line-out.hs │ │ │ │ ├── case-multi-line.hs │ │ │ │ ├── case-single-line-out.hs │ │ │ │ ├── case-single-line.hs │ │ │ │ ├── complex-list-out.hs │ │ │ │ ├── complex-list.hs │ │ │ │ ├── comprehension │ │ │ │ │ ├── transform-monad-out.hs │ │ │ │ │ ├── transform-monad.hs │ │ │ │ │ ├── transform-multi-line1-out.hs │ │ │ │ │ ├── transform-multi-line1.hs │ │ │ │ │ ├── transform-multi-line2-out.hs │ │ │ │ │ ├── transform-multi-line2.hs │ │ │ │ │ ├── transform-multi-line3-out.hs │ │ │ │ │ ├── transform-multi-line3.hs │ │ │ │ │ ├── transform-multi-line4-out.hs │ │ │ │ │ ├── transform-multi-line4.hs │ │ │ │ │ ├── transform-single-line-out.hs │ │ │ │ │ └── transform-single-line.hs │ │ │ │ ├── do-single-multi-out.hs │ │ │ │ ├── do-single-multi.hs │ │ │ │ ├── do-where-out.hs │ │ │ │ ├── do-where.hs │ │ │ │ ├── do │ │ │ │ │ ├── applications-and-parens-out.hs │ │ │ │ │ ├── applications-and-parens.hs │ │ │ │ │ ├── blocks-out.hs │ │ │ │ │ ├── blocks.hs │ │ │ │ │ ├── comment-alignment-out.hs │ │ │ │ │ ├── comment-alignment.hs │ │ │ │ │ ├── comment-spacing-out.hs │ │ │ │ │ ├── comment-spacing.hs │ │ │ │ │ ├── do-dollar-mixed-chain-out.hs │ │ │ │ │ ├── do-dollar-mixed-chain.hs │ │ │ │ │ ├── expr-out.hs │ │ │ │ │ ├── expr.hs │ │ │ │ │ ├── hang-rhs-arrow-out.hs │ │ │ │ │ ├── hang-rhs-arrow.hs │ │ │ │ │ ├── let-out.hs │ │ │ │ │ ├── let.hs │ │ │ │ │ ├── operator-and-parens-out.hs │ │ │ │ │ ├── operator-and-parens.hs │ │ │ │ │ ├── recursive-do-mdo-out.hs │ │ │ │ │ ├── recursive-do-mdo.hs │ │ │ │ │ ├── recursive-do-rec-out.hs │ │ │ │ │ └── recursive-do-rec.hs │ │ │ │ ├── equality-constraints-out.hs │ │ │ │ ├── equality-constraints.hs │ │ │ │ ├── explicit-type-out.hs │ │ │ │ ├── explicit-type.hs │ │ │ │ ├── fancy-forall-0-out.hs │ │ │ │ ├── fancy-forall-0.hs │ │ │ │ ├── fancy-forall-1-out.hs │ │ │ │ ├── fancy-forall-1.hs │ │ │ │ ├── guards-out.hs │ │ │ │ ├── guards.hs │ │ │ │ ├── if-multi-line-out.hs │ │ │ │ ├── if-multi-line.hs │ │ │ │ ├── if-single-line-functions-do-out.hs │ │ │ │ ├── if-single-line-functions-do.hs │ │ │ │ ├── if-single-line-functions-out.hs │ │ │ │ ├── if-single-line-functions.hs │ │ │ │ ├── if-single-line-out.hs │ │ │ │ ├── if-single-line.hs │ │ │ │ ├── if-with-comment-above-branches-out.hs │ │ │ │ ├── if-with-comment-above-branches.hs │ │ │ │ ├── if-with-comment-before-do-blocks-out.hs │ │ │ │ ├── if-with-comment-before-do-blocks.hs │ │ │ │ ├── if-with-comment-in-branches-out.hs │ │ │ │ ├── if-with-comment-in-branches-with-functions-out.hs │ │ │ │ ├── if-with-comment-in-branches-with-functions.hs │ │ │ │ ├── if-with-comment-in-branches.hs │ │ │ │ ├── if-with-comment-next-to-keyword-out.hs │ │ │ │ ├── if-with-comment-next-to-keyword.hs │ │ │ │ ├── implicit-params-out.hs │ │ │ │ ├── implicit-params.hs │ │ │ │ ├── infix │ │ │ │ │ ├── applicative-out.hs │ │ │ │ │ ├── applicative.hs │ │ │ │ │ ├── comments-out.hs │ │ │ │ │ ├── comments.hs │ │ │ │ │ ├── do-out.hs │ │ │ │ │ ├── do.hs │ │ │ │ │ ├── dollar-chains-1-out.hs │ │ │ │ │ ├── dollar-chains-1.hs │ │ │ │ │ ├── dollar-chains-2-out.hs │ │ │ │ │ ├── dollar-chains-2.hs │ │ │ │ │ ├── dollar-chains-3-out.hs │ │ │ │ │ ├── dollar-chains-3.hs │ │ │ │ │ ├── dollar-chains-4-out.hs │ │ │ │ │ ├── dollar-chains-4.hs │ │ │ │ │ ├── dollar-chains-5-out.hs │ │ │ │ │ ├── dollar-chains-5.hs │ │ │ │ │ ├── dollar-chains-6-out.hs │ │ │ │ │ ├── dollar-chains-6.hs │ │ │ │ │ ├── esqueleto-0-out.hs │ │ │ │ │ ├── esqueleto-0.hs │ │ │ │ │ ├── esqueleto-1-out.hs │ │ │ │ │ ├── esqueleto-1.hs │ │ │ │ │ ├── fractional-precedence-out.hs │ │ │ │ │ ├── fractional-precedence.hs │ │ │ │ │ ├── hanging-out.hs │ │ │ │ │ ├── hanging.hs │ │ │ │ │ ├── hspec-expectation-out.hs │ │ │ │ │ ├── hspec-expectation.hs │ │ │ │ │ ├── lenses-out.hs │ │ │ │ │ ├── lenses.hs │ │ │ │ │ ├── op-chain-colon-do-out.hs │ │ │ │ │ ├── op-chain-colon-do.hs │ │ │ │ │ ├── op-chain-l-eq-out.hs │ │ │ │ │ ├── op-chain-l-eq.hs │ │ │ │ │ ├── op-chain-l-gt-out.hs │ │ │ │ │ ├── op-chain-l-gt.hs │ │ │ │ │ ├── op-chain-l-lt-out.hs │ │ │ │ │ ├── op-chain-l-lt.hs │ │ │ │ │ ├── op-chain-l-s-out.hs │ │ │ │ │ ├── op-chain-l-s.hs │ │ │ │ │ ├── op-chain-r-eq-colon-1-out.hs │ │ │ │ │ ├── op-chain-r-eq-colon-1.hs │ │ │ │ │ ├── op-chain-r-eq-colon-2-out.hs │ │ │ │ │ ├── op-chain-r-eq-colon-2.hs │ │ │ │ │ ├── op-chain-r-eq-dollar-1-out.hs │ │ │ │ │ ├── op-chain-r-eq-dollar-1.hs │ │ │ │ │ ├── op-chain-r-eq-dollar-2-out.hs │ │ │ │ │ ├── op-chain-r-eq-dollar-2.hs │ │ │ │ │ ├── op-chain-r-eq-normal-out.hs │ │ │ │ │ ├── op-chain-r-eq-normal.hs │ │ │ │ │ ├── op-chain-r-gt-colon-1-out.hs │ │ │ │ │ ├── op-chain-r-gt-colon-1.hs │ │ │ │ │ ├── op-chain-r-gt-colon-2-out.hs │ │ │ │ │ ├── op-chain-r-gt-colon-2.hs │ │ │ │ │ ├── op-chain-r-gt-dollar-out.hs │ │ │ │ │ ├── op-chain-r-gt-dollar.hs │ │ │ │ │ ├── op-chain-r-gt-normal-out.hs │ │ │ │ │ ├── op-chain-r-gt-normal.hs │ │ │ │ │ ├── op-chain-r-lt-colon-1-out.hs │ │ │ │ │ ├── op-chain-r-lt-colon-1.hs │ │ │ │ │ ├── op-chain-r-lt-colon-2-out.hs │ │ │ │ │ ├── op-chain-r-lt-colon-2.hs │ │ │ │ │ ├── op-chain-r-lt-dollar-out.hs │ │ │ │ │ ├── op-chain-r-lt-dollar.hs │ │ │ │ │ ├── op-chain-r-lt-normal-out.hs │ │ │ │ │ ├── op-chain-r-lt-normal.hs │ │ │ │ │ ├── op-chain-r-s-colon-out.hs │ │ │ │ │ ├── op-chain-r-s-colon.hs │ │ │ │ │ ├── op-chain-r-s-dollar-out.hs │ │ │ │ │ ├── op-chain-r-s-dollar.hs │ │ │ │ │ ├── op-chain-r-s-normal-out.hs │ │ │ │ │ ├── op-chain-r-s-normal.hs │ │ │ │ │ ├── qualified-ops-out.hs │ │ │ │ │ ├── qualified-ops.hs │ │ │ │ │ ├── qualified-prelude-out.hs │ │ │ │ │ ├── qualified-prelude.hs │ │ │ │ │ ├── simple-out.hs │ │ │ │ │ ├── simple.hs │ │ │ │ │ ├── tricky-colon-chain-out.hs │ │ │ │ │ ├── tricky-colon-chain.hs │ │ │ │ │ ├── unicode-out.hs │ │ │ │ │ └── unicode.hs │ │ │ │ ├── lambda-case-out.hs │ │ │ │ ├── lambda-case.hs │ │ │ │ ├── lambda-multi-line1-out.hs │ │ │ │ ├── lambda-multi-line1.hs │ │ │ │ ├── lambda-multi-line2-out.hs │ │ │ │ ├── lambda-multi-line2.hs │ │ │ │ ├── lambda-single-line-out.hs │ │ │ │ ├── lambda-single-line.hs │ │ │ │ ├── let-multi-line-out.hs │ │ │ │ ├── let-multi-line.hs │ │ │ │ ├── let-nested-out.hs │ │ │ │ ├── let-nested.hs │ │ │ │ ├── let-single-line-out.hs │ │ │ │ ├── let-single-line.hs │ │ │ │ ├── lexical-negation-out.hs │ │ │ │ ├── lexical-negation.hs │ │ │ │ ├── list-comprehensions-out.hs │ │ │ │ ├── list-comprehensions.hs │ │ │ │ ├── list-notation-0-out.hs │ │ │ │ ├── list-notation-0.hs │ │ │ │ ├── list-notation-1-out.hs │ │ │ │ ├── list-notation-1.hs │ │ │ │ ├── list-notation-2-out.hs │ │ │ │ ├── list-notation-2.hs │ │ │ │ ├── list-notation-3-out.hs │ │ │ │ ├── list-notation-3.hs │ │ │ │ ├── multi-way-if-out.hs │ │ │ │ ├── multi-way-if.hs │ │ │ │ ├── multiline-arguments-out.hs │ │ │ │ ├── multiline-arguments.hs │ │ │ │ ├── multiline-strings-0-out.hs │ │ │ │ ├── multiline-strings-0.hs │ │ │ │ ├── multiline-strings-1-out.hs │ │ │ │ ├── multiline-strings-1.hs │ │ │ │ ├── multiline-strings-2-out.hs │ │ │ │ ├── multiline-strings-2.hs │ │ │ │ ├── multiline-strings-3-out.hs │ │ │ │ ├── multiline-strings-3.hs │ │ │ │ ├── multiline-strings-4-out.hs │ │ │ │ ├── multiline-strings-4.hs │ │ │ │ ├── multiline-strings-5-out.hs │ │ │ │ ├── multiline-strings-5.hs │ │ │ │ ├── multiline-strings-6-out.hs │ │ │ │ ├── multiline-strings-6.hs │ │ │ │ ├── multiline-strings-7-out.hs │ │ │ │ ├── multiline-strings-7.hs │ │ │ │ ├── multiline-strings-8-out.hs │ │ │ │ ├── multiline-strings-8.hs │ │ │ │ ├── multiline-types-out.hs │ │ │ │ ├── multiline-types.hs │ │ │ │ ├── multiple-guards-out.hs │ │ │ │ ├── multiple-guards.hs │ │ │ │ ├── multiple-matches-out.hs │ │ │ │ ├── multiple-matches.hs │ │ │ │ ├── negation-out.hs │ │ │ │ ├── negation.hs │ │ │ │ ├── negative-literals-out.hs │ │ │ │ ├── negative-literals.hs │ │ │ │ ├── newline-single-line-body-out.hs │ │ │ │ ├── newline-single-line-body.hs │ │ │ │ ├── operator-comments-0-out.hs │ │ │ │ ├── operator-comments-0.hs │ │ │ │ ├── operator-comments-1-out.hs │ │ │ │ ├── operator-comments-1.hs │ │ │ │ ├── operator-comments-2-out.hs │ │ │ │ ├── operator-comments-2.hs │ │ │ │ ├── operator-fixity-defaulting-out.hs │ │ │ │ ├── operator-fixity-defaulting.hs │ │ │ │ ├── operator-hash-with-unboxed-sums-out.hs │ │ │ │ ├── operator-hash-with-unboxed-sums.hs │ │ │ │ ├── operator-hash-without-unboxed-sums-out.hs │ │ │ │ ├── operator-hash-without-unboxed-sums.hs │ │ │ │ ├── operator-sections-out.hs │ │ │ │ ├── operator-sections.hs │ │ │ │ ├── operators-0-out.hs │ │ │ │ ├── operators-0.hs │ │ │ │ ├── operators-1-out.hs │ │ │ │ ├── operators-1.hs │ │ │ │ ├── operators-2-out.hs │ │ │ │ ├── operators-2.hs │ │ │ │ ├── operators-3-out.hs │ │ │ │ ├── operators-3.hs │ │ │ │ ├── operators-4-out.hs │ │ │ │ ├── operators-4.hs │ │ │ │ ├── operators-5-out.hs │ │ │ │ ├── operators-5.hs │ │ │ │ ├── operators-6-out.hs │ │ │ │ ├── operators-6.hs │ │ │ │ ├── operators-7-out.hs │ │ │ │ ├── operators-7.hs │ │ │ │ ├── overindentation-out.hs │ │ │ │ ├── overindentation.hs │ │ │ │ ├── overloaded-labels-out.hs │ │ │ │ ├── overloaded-labels.hs │ │ │ │ ├── parallel-comprehensions-complex-out.hs │ │ │ │ ├── parallel-comprehensions-complex.hs │ │ │ │ ├── parallel-comprehensions-single-line-out.hs │ │ │ │ ├── parallel-comprehensions-single-line.hs │ │ │ │ ├── parens-comments-out.hs │ │ │ │ ├── parens-comments.hs │ │ │ │ ├── parens-out.hs │ │ │ │ ├── parens.hs │ │ │ │ ├── parenthesis-lhs-out.hs │ │ │ │ ├── parenthesis-lhs.hs │ │ │ │ ├── pattern │ │ │ │ │ ├── as-pattern-out.hs │ │ │ │ │ ├── as-pattern.hs │ │ │ │ │ ├── famous-cardano-pattern-out.hs │ │ │ │ │ ├── famous-cardano-pattern.hs │ │ │ │ │ ├── many-guards-in-singleline-out.hs │ │ │ │ │ ├── many-guards-in-singleline.hs │ │ │ │ │ ├── multiline-case-pattern-out.hs │ │ │ │ │ ├── multiline-case-pattern.hs │ │ │ │ │ ├── multiline-guard-statement-out.hs │ │ │ │ │ ├── multiline-guard-statement.hs │ │ │ │ │ ├── multiple-guard-statements-out.hs │ │ │ │ │ ├── multiple-guard-statements.hs │ │ │ │ │ ├── n-plus-k-pattern-out.hs │ │ │ │ │ ├── n-plus-k-pattern.hs │ │ │ │ │ ├── or-patterns-out.hs │ │ │ │ │ ├── or-patterns.hs │ │ │ │ │ ├── pattern-bind-out.hs │ │ │ │ │ ├── pattern-bind.hs │ │ │ │ │ ├── quasi-quotes-pattern-out.hs │ │ │ │ │ ├── quasi-quotes-pattern.hs │ │ │ │ │ ├── record-patterns-out.hs │ │ │ │ │ ├── record-patterns.hs │ │ │ │ │ ├── sig-pattern-out.hs │ │ │ │ │ ├── sig-pattern.hs │ │ │ │ │ ├── splice-pattern-out.hs │ │ │ │ │ ├── splice-pattern.hs │ │ │ │ │ ├── strictness-out.hs │ │ │ │ │ ├── strictness.hs │ │ │ │ │ ├── unboxed-sum-pattern-out.hs │ │ │ │ │ ├── unboxed-sum-pattern.hs │ │ │ │ │ ├── view-pattern-out.hs │ │ │ │ │ └── view-pattern.hs │ │ │ │ ├── pragmas-out.hs │ │ │ │ ├── pragmas.hs │ │ │ │ ├── prefix-out.hs │ │ │ │ ├── prefix.hs │ │ │ │ ├── primitive-literals-out.hs │ │ │ │ ├── primitive-literals.hs │ │ │ │ ├── quasi-quotes-out.hs │ │ │ │ ├── quasi-quotes.hs │ │ │ │ ├── record │ │ │ │ │ ├── constructors-out.hs │ │ │ │ │ ├── constructors.hs │ │ │ │ │ ├── hanging-after-equal-con-out.hs │ │ │ │ │ ├── hanging-after-equal-con.hs │ │ │ │ │ ├── hanging-after-equal-update-out.hs │ │ │ │ │ ├── hanging-after-equal-update.hs │ │ │ │ │ ├── inter-comments-out.hs │ │ │ │ │ ├── inter-comments.hs │ │ │ │ │ ├── record-dot-out.hs │ │ │ │ │ ├── record-dot.hs │ │ │ │ │ ├── updaters-out.hs │ │ │ │ │ ├── updaters.hs │ │ │ │ │ ├── wildcards-out.hs │ │ │ │ │ └── wildcards.hs │ │ │ │ ├── required-type-arguments-2-out.hs │ │ │ │ ├── required-type-arguments-2.hs │ │ │ │ ├── required-type-arguments-out.hs │ │ │ │ ├── required-type-arguments.hs │ │ │ │ ├── simple-out.hs │ │ │ │ ├── simple.hs │ │ │ │ ├── splice-out.hs │ │ │ │ ├── splice.hs │ │ │ │ ├── static-pointers-out.hs │ │ │ │ ├── static-pointers.hs │ │ │ │ ├── strings-out.hs │ │ │ │ ├── strings.hs │ │ │ │ ├── tricky-parens-out.hs │ │ │ │ ├── tricky-parens.hs │ │ │ │ ├── tuple-sections-out.hs │ │ │ │ ├── tuple-sections.hs │ │ │ │ ├── tuples-out.hs │ │ │ │ ├── tuples.hs │ │ │ │ ├── type-abstractions-out.hs │ │ │ │ ├── type-abstractions.hs │ │ │ │ ├── type-applications-and-splice-out.hs │ │ │ │ ├── type-applications-and-splice.hs │ │ │ │ ├── type-applications-out.hs │ │ │ │ ├── type-applications.hs │ │ │ │ ├── typed-expressions-out.hs │ │ │ │ ├── typed-expressions.hs │ │ │ │ ├── typed-hole-out.hs │ │ │ │ ├── typed-hole.hs │ │ │ │ ├── unboxed-string-lit-out.hs │ │ │ │ ├── unboxed-string-lit.hs │ │ │ │ ├── unboxed-sums-out.hs │ │ │ │ ├── unboxed-sums.hs │ │ │ │ ├── unboxed-tuples-out.hs │ │ │ │ ├── unboxed-tuples.hs │ │ │ │ ├── where-nested-out.hs │ │ │ │ ├── where-nested.hs │ │ │ │ ├── where-out.hs │ │ │ │ └── where.hs │ │ │ ├── other │ │ │ │ ├── comments-get-before-op-out.hs │ │ │ │ ├── comments-get-before-op.hs │ │ │ │ ├── line-multi-line-out.hs │ │ │ │ ├── line-multi-line.hs │ │ │ │ ├── line-single-line-out.hs │ │ │ │ └── line-single-line.hs │ │ │ └── pattern-synonyms │ │ │ │ ├── bidirectional-out.hs │ │ │ │ ├── bidirectional.hs │ │ │ │ ├── explicitely-bidirectional-out.hs │ │ │ │ ├── explicitely-bidirectional.hs │ │ │ │ ├── unidirectional-out.hs │ │ │ │ └── unidirectional.hs │ │ └── warning │ │ │ ├── warning-multiline-out.hs │ │ │ ├── warning-multiline.hs │ │ │ ├── warning-single-line-out.hs │ │ │ └── warning-single-line.hs │ ├── import │ │ ├── comments-inside-imports-out.hs │ │ ├── comments-inside-imports.hs │ │ ├── comments-per-import-out.hs │ │ ├── comments-per-import.hs │ │ ├── deduplication-bug-out.hs │ │ ├── deduplication-bug.hs │ │ ├── deprecated-export-multi-line-out.hs │ │ ├── deprecated-export-multi-line.hs │ │ ├── deprecated-export-single-line-out.hs │ │ ├── deprecated-export-single-line.hs │ │ ├── docstrings-after-exports-out.hs │ │ ├── docstrings-after-exports.hs │ │ ├── explicit-imports-out.hs │ │ ├── explicit-imports-with-comments-out.hs │ │ ├── explicit-imports-with-comments.hs │ │ ├── explicit-imports.hs │ │ ├── explicit-prelude-out.hs │ │ ├── explicit-prelude.hs │ │ ├── merging-0-out.hs │ │ ├── merging-0.hs │ │ ├── merging-1-out.hs │ │ ├── merging-1.hs │ │ ├── merging-2-out.hs │ │ ├── merging-2.hs │ │ ├── misc-out.hs │ │ ├── misc.hs │ │ ├── nested-explicit-imports-out.hs │ │ ├── nested-explicit-imports.hs │ │ ├── qualified-post-out.hs │ │ ├── qualified-post.hs │ │ ├── qualified-prelude-out.hs │ │ ├── qualified-prelude.hs │ │ ├── simple-out.hs │ │ ├── simple.hs │ │ ├── sorted-export-list-out.hs │ │ ├── sorted-export-list.hs │ │ ├── sorted-out.hs │ │ ├── sorted-package-imports-out.hs │ │ ├── sorted-package-imports.hs │ │ └── sorted.hs │ ├── module-header │ │ ├── double-dot-with-names-out.hs │ │ ├── double-dot-with-names.hs │ │ ├── double-shebangs-out.hs │ │ ├── double-shebangs.hs │ │ ├── empty-haddock-out.hs │ │ ├── empty-haddock.hs │ │ ├── empty-out.hs │ │ ├── empty.hs │ │ ├── leading-empty-line-out.hs │ │ ├── leading-empty-line.hs │ │ ├── multiline-empty-comment-out.hs │ │ ├── multiline-empty-comment.hs │ │ ├── multiline-empty-out.hs │ │ ├── multiline-empty.hs │ │ ├── multiline-out.hs │ │ ├── multiline-with-comments-out.hs │ │ ├── multiline-with-comments.hs │ │ ├── multiline.hs │ │ ├── multiline2-out.hs │ │ ├── multiline2.hs │ │ ├── named-section-out.hs │ │ ├── named-section.hs │ │ ├── preceding-comment-with-haddock-out.hs │ │ ├── preceding-comment-with-haddock.hs │ │ ├── shebang-out.hs │ │ ├── shebang-with-pragmas-out.hs │ │ ├── shebang-with-pragmas.hs │ │ ├── shebang.hs │ │ ├── simple-out.hs │ │ ├── simple-with-comments-out.hs │ │ ├── simple-with-comments.hs │ │ ├── simple.hs │ │ ├── singleline-empty-out.hs │ │ ├── singleline-empty.hs │ │ ├── singleline-out.hs │ │ ├── singleline.hs │ │ ├── stack-header-0-out.hs │ │ ├── stack-header-0.hs │ │ ├── stack-header-1-out.hs │ │ ├── stack-header-1.hs │ │ ├── stack-header-2-out.hs │ │ ├── stack-header-2.hs │ │ ├── warning-pragma-list-multiline-out.hs │ │ ├── warning-pragma-list-multiline.hs │ │ ├── warning-pragma-multiline-out.hs │ │ ├── warning-pragma-multiline.hs │ │ ├── warning-pragma-out.hs │ │ ├── warning-pragma-singleton-list-out.hs │ │ ├── warning-pragma-singleton-list.hs │ │ └── warning-pragma.hs │ └── other │ │ ├── argument-comment-out.hs │ │ ├── argument-comment.hs │ │ ├── ascii-out.hs │ │ ├── ascii.hs │ │ ├── comment-after-preceding-haddock-out.hs │ │ ├── comment-after-preceding-haddock.hs │ │ ├── comment-alignment-out.hs │ │ ├── comment-alignment.hs │ │ ├── comment-before-hanging-out.hs │ │ ├── comment-before-hanging.hs │ │ ├── comment-empty-let-out.hs │ │ ├── comment-empty-let.hs │ │ ├── comment-following-preceding-gap-out.hs │ │ ├── comment-following-preceding-gap.hs │ │ ├── comment-glued-together-out.hs │ │ ├── comment-glued-together.hs │ │ ├── comment-inside-construct-out.hs │ │ ├── comment-inside-construct.hs │ │ ├── comment-multiline-after-out.hs │ │ ├── comment-multiline-after.hs │ │ ├── comment-spacing-out.hs │ │ ├── comment-spacing.hs │ │ ├── comment-style-transform-out.hs │ │ ├── comment-style-transform.hs │ │ ├── comment-trailing-space-out.hs │ │ ├── comment-trailing-space.hs │ │ ├── comment-two-blocks-out.hs │ │ ├── comment-two-blocks.hs │ │ ├── consequetive-pipe-comments-out.hs │ │ ├── consequetive-pipe-comments.hs │ │ ├── cpp │ │ ├── continuation-out.hs │ │ ├── continuation.hs │ │ ├── cpp-and-imports-out.hs │ │ ├── cpp-and-imports.hs │ │ ├── lonely-hash-out.hs │ │ ├── lonely-hash.hs │ │ ├── separation-0a-out.hs │ │ ├── separation-0a.hs │ │ ├── separation-0b-out.hs │ │ ├── separation-0b.hs │ │ ├── separation-1a-out.hs │ │ ├── separation-1a.hs │ │ ├── separation-1b-out.hs │ │ ├── separation-1b.hs │ │ ├── separation-2a-out.hs │ │ ├── separation-2a.hs │ │ ├── separation-2b-out.hs │ │ ├── separation-2b.hs │ │ ├── shifted-out.hs │ │ ├── shifted.hs │ │ ├── simple-import-out.hs │ │ └── simple-import.hs │ │ ├── disabling │ │ ├── closing-comment-in-disabled-region-out.hs │ │ ├── closing-comment-in-disabled-region.hs │ │ ├── empty-disabled-region-out.hs │ │ ├── empty-disabled-region.hs │ │ ├── line-pragma-in-disabled-region-out.hs │ │ ├── line-pragma-in-disabled-region.hs │ │ ├── normalize-magic-comments-out.hs │ │ ├── normalize-magic-comments.hs │ │ ├── preserve-empty-lines-out.hs │ │ ├── preserve-empty-lines.hs │ │ ├── preserve-trailing-whitespace-out.hs │ │ ├── preserve-trailing-whitespace.hs │ │ ├── single-definition-out.hs │ │ ├── single-definition.hs │ │ ├── suffix-comment-out.hs │ │ ├── suffix-comment.hs │ │ ├── whole-file-out.hs │ │ └── whole-file.hs │ │ ├── empty-forall-out.hs │ │ ├── empty-forall.hs │ │ ├── empty-haddock-out.hs │ │ ├── empty-haddock.hs │ │ ├── following-comment-last-0-out.hs │ │ ├── following-comment-last-0.hs │ │ ├── following-comment-last-1-out.hs │ │ ├── following-comment-last-1.hs │ │ ├── following-comment-last-2-out.hs │ │ ├── following-comment-last-2.hs │ │ ├── following-comment-last-3-out.hs │ │ ├── following-comment-last-3.hs │ │ ├── haddock-sections-out.hs │ │ ├── haddock-sections.hs │ │ ├── haddock-without-module-header-out.hs │ │ ├── haddock-without-module-header.hs │ │ ├── inline-comment-0-out.hs │ │ ├── inline-comment-0.hs │ │ ├── inline-comment-1-out.hs │ │ ├── inline-comment-1.hs │ │ ├── invalid-haddock-1-out.hs │ │ ├── invalid-haddock-1.hs │ │ ├── invalid-haddock-2-out.hs │ │ ├── invalid-haddock-2.hs │ │ ├── invalid-haddock-double-trigger-out.hs │ │ ├── invalid-haddock-double-trigger.hs │ │ ├── invalid-haddock-weird-out.hs │ │ ├── invalid-haddock-weird.hs │ │ ├── jsffi-out.hs │ │ ├── jsffi.hs │ │ ├── linear-arrows-out.hs │ │ ├── linear-arrows.hs │ │ ├── merging-comments-out.hs │ │ ├── merging-comments.hs │ │ ├── multiline-comments-reindent-out.hs │ │ ├── multiline-comments-reindent.hs │ │ ├── multiline-forall-out.hs │ │ ├── multiline-forall.hs │ │ ├── multiple-blank-line-comment-out.hs │ │ ├── multiple-blank-line-comment.hs │ │ ├── necessary-brackets-out.hs │ │ ├── necessary-brackets.hs │ │ ├── overly-indented-out.hs │ │ ├── overly-indented.hs │ │ ├── pragma-comments-after-out.hs │ │ ├── pragma-comments-after.hs │ │ ├── pragma-comments-out.hs │ │ ├── pragma-comments.hs │ │ ├── pragma-no-header-out.hs │ │ ├── pragma-no-header.hs │ │ ├── pragma-out.hs │ │ ├── pragma-sorting-out.hs │ │ ├── pragma-sorting.hs │ │ ├── pragma.hs │ │ ├── trailing-whitespace-out.hs │ │ └── trailing-whitespace.hs └── parse-failures │ ├── disabling-preserves-error-location.hs │ └── line-pragma.hs ├── expected-failures ├── brittany.txt ├── default.nix ├── esqueleto.txt ├── hlint.txt ├── leksah.txt ├── lens.txt ├── pandoc.txt ├── pipes.txt └── postgrest.txt ├── extract-hackage-info.sh ├── extract-hackage-info ├── README.md ├── extract-hackage-info.cabal ├── hackage-info.bin └── src │ ├── Hoogle.hs │ └── Main.hs ├── fixity-tests ├── .ormolu ├── default.nix ├── dummy.cabal ├── test-0-input.hs ├── test-0-ugly-expected.hs ├── test-0-with-fixity-info-expected.hs ├── test-1-input.hs ├── test-1-no-extra-info-expected.hs ├── test-1-with-fixity-info-expected.hs ├── test-1-with-fixity-info-weird-overwrite-expected.hs ├── test-2-input.hs ├── test-2-no-extra-info-expected.hs └── test-2-with-reexports-expected.hs ├── flake.lock ├── flake.nix ├── nix ├── format.sh └── ormolize │ └── default.nix ├── ormolu-live ├── .envrc ├── .gitignore ├── README.md ├── app │ ├── Pregen.hs │ └── Worker.hs ├── build.sh ├── cabal.project ├── default.nix ├── ormolu-live.cabal ├── package-lock.json ├── package.json ├── src │ └── Ormolu │ │ ├── Live.hs │ │ └── Live │ │ ├── AceEditor.hs │ │ ├── CommitRev.hs │ │ └── JSUtil.hs └── www │ ├── index.js │ └── worker.js ├── ormolu.cabal ├── region-tests ├── default.nix ├── expected-result-11-14.hs ├── expected-result-19-23.hs ├── expected-result-8-10.hs ├── expected-result-8-9.hs ├── expected-result-all.hs └── src.hs ├── src ├── GHC │ └── DynFlags.hs ├── Ormolu.hs └── Ormolu │ ├── Config.hs │ ├── Diff │ ├── ParseResult.hs │ └── Text.hs │ ├── Exception.hs │ ├── Fixity.hs │ ├── Fixity │ ├── Imports.hs │ ├── Internal.hs │ ├── Parser.hs │ └── Printer.hs │ ├── Imports.hs │ ├── Parser.hs │ ├── Parser │ ├── CommentStream.hs │ ├── Pragma.hs │ └── Result.hs │ ├── Printer.hs │ ├── Printer │ ├── Combinators.hs │ ├── Comments.hs │ ├── Internal.hs │ ├── Meat │ │ ├── Common.hs │ │ ├── Declaration.hs │ │ ├── Declaration.hs-boot │ │ ├── Declaration │ │ │ ├── Annotation.hs │ │ │ ├── Class.hs │ │ │ ├── Data.hs │ │ │ ├── Default.hs │ │ │ ├── Foreign.hs │ │ │ ├── Instance.hs │ │ │ ├── OpTree.hs │ │ │ ├── OpTree.hs-boot │ │ │ ├── RoleAnnotation.hs │ │ │ ├── Rule.hs │ │ │ ├── Signature.hs │ │ │ ├── Splice.hs │ │ │ ├── StringLiteral.hs │ │ │ ├── Type.hs │ │ │ ├── TypeFamily.hs │ │ │ ├── Value.hs │ │ │ ├── Value.hs-boot │ │ │ └── Warning.hs │ │ ├── ImportExport.hs │ │ ├── Module.hs │ │ ├── Pragma.hs │ │ └── Type.hs │ ├── Operators.hs │ └── SpanStream.hs │ ├── Processing │ ├── Common.hs │ ├── Cpp.hs │ └── Preprocess.hs │ ├── Terminal.hs │ ├── Terminal │ └── QualifiedDo.hs │ ├── Utils.hs │ └── Utils │ ├── Cabal.hs │ ├── Fixity.hs │ └── IO.hs ├── stack.yaml ├── tests ├── Ormolu │ ├── CabalInfoSpec.hs │ ├── Diff │ │ └── TextSpec.hs │ ├── Fixity │ │ ├── ParserSpec.hs │ │ └── PrinterSpec.hs │ ├── FixitySpec.hs │ ├── OpTreeSpec.hs │ ├── Parser │ │ ├── OptionsSpec.hs │ │ ├── ParseFailureSpec.hs │ │ └── PragmaSpec.hs │ └── PrinterSpec.hs └── Spec.hs └── weeder.toml /.envrc: -------------------------------------------------------------------------------- 1 | use flake 2 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | -------------------------------------------------------------------------------- /cabal.project: -------------------------------------------------------------------------------- 1 | packages: . extract-hackage-info 2 | 3 | index-state: 2025-01-16T23:07:37Z 4 | 5 | tests: True 6 | multi-repl: True 7 | 8 | constraints: ormolu +dev 9 | -------------------------------------------------------------------------------- /data/cabal-tests/Bar.hs: -------------------------------------------------------------------------------- 1 | module Foo where 2 | 3 | import Data.List qualified as List 4 | -------------------------------------------------------------------------------- /data/cabal-tests/Foo.hs: -------------------------------------------------------------------------------- 1 | module Foo where 2 | 3 | import Data.List qualified as List 4 | -------------------------------------------------------------------------------- /data/diff-tests/inputs/applicative-after.hs: -------------------------------------------------------------------------------- 1 | testPermParser :: Permutation Parser String 2 | testPermParser = 3 | f 4 | <$> toPermutationWithDefault 'x' (char 'a') 5 | <*> toPermutationWithDefault 'y' (char 'b') 6 | <*> toPermutationWithDefault 'z' (char 'c') 7 | where 8 | f a b c = [a, b, c] 9 | -------------------------------------------------------------------------------- /data/diff-tests/inputs/applicative-before.hs: -------------------------------------------------------------------------------- 1 | testPermParser :: Permutation Parser String 2 | testPermParser = 3 | f <$> toPermutationWithDefault 'x' (char 'a') 4 | <*> toPermutationWithDefault 'y' (char 'b') 5 | <*> toPermutationWithDefault 'z' (char 'c') 6 | where 7 | f a b c = [a, b, c] 8 | -------------------------------------------------------------------------------- /data/diff-tests/inputs/empty.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweag/ormolu/383313eead4a1a263ad7dcb5698a14ef58bb9b43/data/diff-tests/inputs/empty.hs -------------------------------------------------------------------------------- /data/diff-tests/inputs/longer-v2.hs: -------------------------------------------------------------------------------- 1 | module Main (foo) where 2 | 3 | a 4 | b 5 | c 6 | 7 | main :: IO () 8 | main = return () 9 | 10 | d 11 | e 12 | f 13 | g 14 | 15 | foo :: Int 16 | foo = 6 17 | -------------------------------------------------------------------------------- /data/diff-tests/inputs/longer.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | a 4 | b 5 | c 6 | 7 | main :: IO () 8 | main = return () 9 | 10 | d 11 | e 12 | f 13 | g 14 | 15 | foo :: Int 16 | foo = 5 17 | -------------------------------------------------------------------------------- /data/diff-tests/inputs/main-and-bar-v2.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | main :: IO () 4 | main = pure () 5 | 6 | foo :: Int 7 | foo = 8 | 5 9 | 10 | bar :: Int 11 | bar = 7 12 | -------------------------------------------------------------------------------- /data/diff-tests/inputs/main-and-bar.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | main :: IO () 4 | main = return () 5 | 6 | foo :: Int 7 | foo = 8 | 5 9 | 10 | bar :: Int 11 | bar = 6 12 | -------------------------------------------------------------------------------- /data/diff-tests/inputs/main-and-baz-v2.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | main :: IO () 4 | main = pure () 5 | 6 | foo :: Int 7 | foo = 8 | 5 9 | + 5 10 | 11 | bar :: Int 12 | bar = 7 13 | -------------------------------------------------------------------------------- /data/diff-tests/inputs/main-and-baz.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | main :: IO () 4 | main = return () 5 | 6 | foo :: Int 7 | foo = 8 | 5 9 | + 5 10 | 11 | bar :: Int 12 | bar = 6 13 | -------------------------------------------------------------------------------- /data/diff-tests/inputs/main-and-foo-v2.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | main :: IO () 4 | main = pure () 5 | 6 | foo :: Int 7 | foo = 5 8 | -------------------------------------------------------------------------------- /data/diff-tests/inputs/main-and-foo.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | main :: IO () 4 | main = return () 5 | 6 | foo :: Int 7 | foo = 5 8 | -------------------------------------------------------------------------------- /data/diff-tests/inputs/main-foo.hs: -------------------------------------------------------------------------------- 1 | module Main (foo) where 2 | 3 | main :: IO () 4 | main = return () 5 | -------------------------------------------------------------------------------- /data/diff-tests/inputs/main-v2.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | main :: IO () 4 | main = pure () 5 | -------------------------------------------------------------------------------- /data/diff-tests/inputs/main.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | main :: IO () 4 | main = return () 5 | -------------------------------------------------------------------------------- /data/diff-tests/inputs/no-trailing-blank-line.hs: -------------------------------------------------------------------------------- 1 | data Test = Test -------------------------------------------------------------------------------- /data/diff-tests/inputs/one-line.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | -------------------------------------------------------------------------------- /data/diff-tests/inputs/spaced-v2.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | 4 | 5 | 6 | 7 | main :: IO () 8 | main = pure () 9 | 10 | 11 | 12 | 13 | 14 | 15 | foo :: Int 16 | foo = 5 17 | -------------------------------------------------------------------------------- /data/diff-tests/inputs/spaced.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | 4 | 5 | 6 | 7 | main :: IO () 8 | main = return () 9 | 10 | 11 | 12 | 13 | 14 | 15 | foo :: Int 16 | foo = 5 17 | -------------------------------------------------------------------------------- /data/diff-tests/inputs/with-trailing-blank-line.hs: -------------------------------------------------------------------------------- 1 | data Test = Test 2 | -------------------------------------------------------------------------------- /data/diff-tests/outputs/joined-hunk.txt: -------------------------------------------------------------------------------- 1 | TEST 2 | @@ -1,11 +1,11 @@ 3 | module Main (main) where 4 | 5 | main :: IO () 6 | - main = return () 7 | + main = pure () 8 | 9 | foo :: Int 10 | foo = 11 | 5 12 | 13 | bar :: Int 14 | - bar = 6 15 | + bar = 7 16 | -------------------------------------------------------------------------------- /data/diff-tests/outputs/no-following.txt: -------------------------------------------------------------------------------- 1 | TEST 2 | @@ -1,4 +1,4 @@ 3 | module Main (main) where 4 | 5 | main :: IO () 6 | - main = return () 7 | + main = pure () 8 | -------------------------------------------------------------------------------- /data/diff-tests/outputs/no-preceding.txt: -------------------------------------------------------------------------------- 1 | TEST 2 | @@ -1,4 +1,4 @@ 3 | - module Main (foo) where 4 | + module Main (main) where 5 | 6 | main :: IO () 7 | main = return () 8 | -------------------------------------------------------------------------------- /data/diff-tests/outputs/one-line-added.txt: -------------------------------------------------------------------------------- 1 | TEST 2 | @@ -1,0 +1,1 @@ 3 | + module Main (main) where 4 | -------------------------------------------------------------------------------- /data/diff-tests/outputs/one-line-removed.txt: -------------------------------------------------------------------------------- 1 | TEST 2 | @@ -1,1 +1,0 @@ 3 | - module Main (main) where 4 | -------------------------------------------------------------------------------- /data/diff-tests/outputs/simple-hunk.txt: -------------------------------------------------------------------------------- 1 | TEST 2 | @@ -1,7 +1,7 @@ 3 | module Main (main) where 4 | 5 | main :: IO () 6 | - main = return () 7 | + main = pure () 8 | 9 | foo :: Int 10 | foo = 5 11 | -------------------------------------------------------------------------------- /data/diff-tests/outputs/trailing-blank-line.txt: -------------------------------------------------------------------------------- 1 | TEST 2 | @@ -1,1 +1,2 @@ 3 | data Test = Test 4 | + 5 | -------------------------------------------------------------------------------- /data/diff-tests/outputs/trimming-trailing-both-out-of-margin.txt: -------------------------------------------------------------------------------- 1 | TEST 2 | @@ -1,4 +1,4 @@ 3 | - module Main (main) where 4 | + module Main (foo) where 5 | 6 | a 7 | b 8 | @@ -13,4 +13,4 @@ 9 | g 10 | 11 | foo :: Int 12 | - foo = 5 13 | + foo = 6 14 | -------------------------------------------------------------------------------- /data/diff-tests/outputs/trimming.txt: -------------------------------------------------------------------------------- 1 | TEST 2 | @@ -7,2 +7,2 @@ 3 | main :: IO () 4 | - main = return () 5 | + main = pure () 6 | -------------------------------------------------------------------------------- /data/diff-tests/outputs/two-hunks.txt: -------------------------------------------------------------------------------- 1 | TEST 2 | @@ -1,7 +1,7 @@ 3 | module Main (main) where 4 | 5 | main :: IO () 6 | - main = return () 7 | + main = pure () 8 | 9 | foo :: Int 10 | foo = 11 | @@ -9,4 +9,4 @@ 12 | + 5 13 | 14 | bar :: Int 15 | - bar = 6 16 | + bar = 7 17 | -------------------------------------------------------------------------------- /data/examples/declaration/class/associated-data1-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TypeFamilies #-} 2 | 3 | class Foo a where data FooBar a 4 | 5 | -- | Something. 6 | class Bar a where 7 | -- | Bar bar 8 | data BarBar a 9 | 10 | -- | Bar baz 11 | data 12 | BarBaz 13 | a 14 | -------------------------------------------------------------------------------- /data/examples/declaration/class/associated-data1.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TypeFamilies #-} 2 | 3 | class Foo a where data FooBar a 4 | 5 | -- | Something. 6 | class Bar a 7 | where 8 | -- | Bar bar 9 | data BarBar a 10 | -- | Bar baz 11 | data family BarBaz 12 | a 13 | -------------------------------------------------------------------------------- /data/examples/declaration/class/associated-types1-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TypeFamilies #-} 2 | 3 | class Foo a where type FooBar a 4 | 5 | -- | Something. 6 | class Bar a where 7 | -- | Bar bar 8 | type BarBar a 9 | 10 | -- | Bar baz 11 | type 12 | BarBaz 13 | a 14 | -------------------------------------------------------------------------------- /data/examples/declaration/class/associated-types1.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TypeFamilies #-} 2 | 3 | class Foo a where type FooBar a 4 | 5 | -- | Something. 6 | class Bar a 7 | where 8 | -- | Bar bar 9 | type BarBar a 10 | -- | Bar baz 11 | type BarBaz 12 | a 13 | -------------------------------------------------------------------------------- /data/examples/declaration/class/default-implementations-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Foo 4 | class Foo a where 5 | foo :: a -> a 6 | foo a = a 7 | 8 | -- | Bar 9 | class Bar a where 10 | bar :: 11 | a -> 12 | Int 13 | bar = const 0 14 | -------------------------------------------------------------------------------- /data/examples/declaration/class/default-implementations.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Foo 4 | class Foo a where 5 | foo :: a -> a 6 | foo a = a 7 | 8 | -- | Bar 9 | class Bar a where 10 | bar :: 11 | a 12 | -> Int 13 | bar = const 0 14 | -------------------------------------------------------------------------------- /data/examples/declaration/class/default-signatures-simple-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Something. 4 | class Foo a where 5 | -- | Foo 6 | foo :: a -> String 7 | default foo :: (Show a) => a -> String 8 | foo = show 9 | -------------------------------------------------------------------------------- /data/examples/declaration/class/default-signatures-simple.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Something. 4 | class Foo a where 5 | -- | Foo 6 | foo :: a -> String 7 | default foo :: Show a => a -> String 8 | foo = show 9 | -------------------------------------------------------------------------------- /data/examples/declaration/class/empty-classes-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Foo! 4 | class Foo a 5 | 6 | -- | Bar! 7 | class Bar a 8 | -------------------------------------------------------------------------------- /data/examples/declaration/class/empty-classes.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Foo! 4 | class Foo a where 5 | -- | Bar! 6 | class Bar a 7 | -------------------------------------------------------------------------------- /data/examples/declaration/class/newlines-after-where-out.hs: -------------------------------------------------------------------------------- 1 | class Num a where 2 | (+) :: a -> a -> a 3 | 4 | class Num a where 5 | (+) :: a -> a -> a 6 | -------------------------------------------------------------------------------- /data/examples/declaration/class/newlines-after-where.hs: -------------------------------------------------------------------------------- 1 | class Num a where 2 | (+) :: a -> a -> a 3 | 4 | class Num a where 5 | 6 | 7 | (+) :: a -> a -> a 8 | -------------------------------------------------------------------------------- /data/examples/declaration/class/newlines-and-default-decls-out.hs: -------------------------------------------------------------------------------- 1 | class Foo a where 2 | foo :: a 3 | default foo :: () 4 | foo = () 5 | bar :: a 6 | default bar :: () 7 | bar = () 8 | 9 | qux :: a 10 | default qux :: () 11 | qux = () 12 | -------------------------------------------------------------------------------- /data/examples/declaration/class/newlines-and-default-decls.hs: -------------------------------------------------------------------------------- 1 | class Foo a where 2 | foo :: a 3 | default foo :: () 4 | foo = () 5 | bar :: a 6 | default bar :: () 7 | bar = () 8 | 9 | qux :: a 10 | 11 | default qux :: () 12 | 13 | qux = () 14 | -------------------------------------------------------------------------------- /data/examples/declaration/class/poly-kinded-classes-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE PolyKinds #-} 2 | 3 | class Foo (a :: k) 4 | 5 | class 6 | Bar 7 | ( a :: -- Variable 8 | * -- Star 9 | ) 10 | -------------------------------------------------------------------------------- /data/examples/declaration/class/poly-kinded-classes.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE PolyKinds #-} 2 | 3 | class Foo (a::k) 4 | 5 | class Bar 6 | (a -- Variable 7 | :: * -- Star 8 | ) 9 | -------------------------------------------------------------------------------- /data/examples/declaration/class/super-classes-out.hs: -------------------------------------------------------------------------------- 1 | class Foo a 2 | 3 | class (Foo a) => Bar a 4 | 5 | class 6 | (Foo a, Bar a) => 7 | Baz a 8 | 9 | class 10 | ( Foo a, -- Foo? 11 | Bar a, -- Bar? 12 | Baz a -- Baz 13 | ) => 14 | BarBar a 15 | -------------------------------------------------------------------------------- /data/examples/declaration/class/super-classes.hs: -------------------------------------------------------------------------------- 1 | class () => Foo a 2 | class Foo a => Bar a 3 | class (Foo a,Bar a) => 4 | Baz a 5 | class ( 6 | Foo a, -- Foo? 7 | Bar a, -- Bar? 8 | Baz a -- Baz 9 | ) => BarBar a 10 | -------------------------------------------------------------------------------- /data/examples/declaration/class/type-operators2-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MultiParamTypeClasses #-} 2 | {-# LANGUAGE TypeOperators #-} 3 | 4 | class a `Pair` b 5 | 6 | class 7 | a 8 | `Sum` b 9 | 10 | class (f `Product` g) a 11 | 12 | class 13 | ( f 14 | `Sum` g 15 | ) 16 | a 17 | -------------------------------------------------------------------------------- /data/examples/declaration/class/type-operators2.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MultiParamTypeClasses #-} 2 | {-# LANGUAGE TypeOperators #-} 3 | 4 | class 5 | a`Pair`b 6 | 7 | class 8 | a 9 | `Sum` b 10 | 11 | class (f`Product`g)a 12 | 13 | class ( 14 | f `Sum` g 15 | ) a 16 | 17 | -------------------------------------------------------------------------------- /data/examples/declaration/class/type-operators3-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE PolyKinds #-} 2 | {-# LANGUAGE TypeFamilies #-} 3 | {-# LANGUAGE TypeOperators #-} 4 | {-# LANGUAGE NoStarIsType #-} 5 | 6 | class PNum x where 7 | type (a :: x) * (b :: x) 8 | 9 | instance PNum Nat where 10 | type a * b = () 11 | -------------------------------------------------------------------------------- /data/examples/declaration/class/type-operators3.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TypeFamilies, TypeOperators, NoStarIsType, PolyKinds #-} 2 | 3 | class PNum x where 4 | type (a :: x) * (b :: x) 5 | 6 | instance PNum Nat where 7 | type a * b = () 8 | -------------------------------------------------------------------------------- /data/examples/declaration/data/ctype-0-out.hs: -------------------------------------------------------------------------------- 1 | data {-# CTYPE "unistd.h" "useconds_t" #-} T 2 | -------------------------------------------------------------------------------- /data/examples/declaration/data/ctype-0.hs: -------------------------------------------------------------------------------- 1 | data {-# CTYPE "unistd.h" "useconds_t" #-} T 2 | -------------------------------------------------------------------------------- /data/examples/declaration/data/ctype-1-out.hs: -------------------------------------------------------------------------------- 1 | data 2 | {-# CTYPE "header.h" "an-ffi-type-with-along-name" #-} 3 | AnFFITypeWithAlongName = AnFFITypeWithAlongName 4 | { a :: X, 5 | b :: Y 6 | } 7 | -------------------------------------------------------------------------------- /data/examples/declaration/data/ctype-1.hs: -------------------------------------------------------------------------------- 1 | data 2 | {-# CTYPE "header.h" "an-ffi-type-with-along-name" #-} 3 | AnFFITypeWithAlongName = AnFFITypeWithAlongName 4 | { a :: X, 5 | b :: Y 6 | } 7 | -------------------------------------------------------------------------------- /data/examples/declaration/data/datatype-contexts-out.hs: -------------------------------------------------------------------------------- 1 | data (IsString s) => T s = T 2 | 3 | data 4 | (IsString s) => 5 | T s = T 6 | 7 | data 8 | ( IsString s, 9 | IsString s 10 | ) => 11 | T s = T 12 | -------------------------------------------------------------------------------- /data/examples/declaration/data/datatype-contexts.hs: -------------------------------------------------------------------------------- 1 | data IsString s => T s = T 2 | 3 | data IsString s => 4 | T s = T 5 | 6 | data 7 | ( IsString s 8 | , IsString s ) => T s = T 9 | -------------------------------------------------------------------------------- /data/examples/declaration/data/deriving-out.hs: -------------------------------------------------------------------------------- 1 | newtype R r a = R (ReaderT r IO a) 2 | deriving (MonadReader r) 3 | -------------------------------------------------------------------------------- /data/examples/declaration/data/deriving.hs: -------------------------------------------------------------------------------- 1 | newtype R r a = R (ReaderT r IO a) 2 | deriving (MonadReader r) 3 | -------------------------------------------------------------------------------- /data/examples/declaration/data/empty-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE EmptyDataDecls #-} 2 | 3 | data Foo 4 | -------------------------------------------------------------------------------- /data/examples/declaration/data/empty.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE EmptyDataDecls #-} 2 | 3 | data Foo 4 | -------------------------------------------------------------------------------- /data/examples/declaration/data/existential-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ExistentialQuantification #-} 2 | 3 | data Foo = forall a. MkFoo a (a -> Bool) 4 | 5 | data Bar = forall a b. (a + b) => Bar a b 6 | -------------------------------------------------------------------------------- /data/examples/declaration/data/existential-unicode-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE UnicodeSyntax #-} 2 | 3 | data Foo 4 | = forall a. 5 | Foo 6 | 7 | data Bar 8 | = forall a. 9 | Bar 10 | -------------------------------------------------------------------------------- /data/examples/declaration/data/existential-unicode.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE UnicodeSyntax #-} 2 | 3 | data Foo = forall 4 | a. Foo 5 | 6 | data Bar = ∀ 7 | a. Bar 8 | -------------------------------------------------------------------------------- /data/examples/declaration/data/existential.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ExistentialQuantification #-} 2 | 3 | data Foo = forall a. MkFoo a (a -> Bool) 4 | 5 | data Bar = forall a b. a + b => Bar a b 6 | -------------------------------------------------------------------------------- /data/examples/declaration/data/fat-multiline-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Something. 4 | data Foo 5 | = -- | Foo 6 | Foo 7 | Int 8 | Int 9 | | -- | Bar 10 | Bar 11 | Bool 12 | Bool 13 | -------------------------------------------------------------------------------- /data/examples/declaration/data/fat-multiline.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Something. 4 | 5 | data Foo 6 | = Foo Int 7 | Int 8 | -- ^ Foo 9 | | Bar Bool 10 | Bool 11 | -- ^ Bar 12 | -------------------------------------------------------------------------------- /data/examples/declaration/data/field-layout/gadt-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Foo. 4 | data Foo a b where 5 | -- | Something 6 | Foo :: Foo Int Int 7 | -- | Something else 8 | Bar :: 9 | Foo 10 | Char 11 | Char 12 | -------------------------------------------------------------------------------- /data/examples/declaration/data/field-layout/gadt.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Foo. 4 | 5 | data Foo a b where 6 | -- | Something 7 | Foo :: Foo Int Int 8 | -- | Something else 9 | Bar :: Foo Char 10 | Char 11 | -------------------------------------------------------------------------------- /data/examples/declaration/data/field-layout/record-0-out.hs: -------------------------------------------------------------------------------- 1 | -- | Foo. 2 | data Foo = Foo 3 | { -- | Something 4 | foo :: Foo Int Int, 5 | -- | Something else 6 | bar :: 7 | Bar 8 | Char 9 | Char 10 | } 11 | -------------------------------------------------------------------------------- /data/examples/declaration/data/field-layout/record-0.hs: -------------------------------------------------------------------------------- 1 | -- | Foo. 2 | 3 | data Foo = Foo 4 | { foo :: Foo Int Int 5 | -- ^ Something 6 | , bar :: Bar Char 7 | Char 8 | -- ^ Something else 9 | } 10 | -------------------------------------------------------------------------------- /data/examples/declaration/data/field-layout/record-1-out.hs: -------------------------------------------------------------------------------- 1 | -- | Foo. 2 | data Foo 3 | = Foo 4 | { -- | Something 5 | foo :: Foo Int Int, 6 | -- | Something else 7 | bar :: 8 | Bar 9 | Char 10 | Char 11 | } 12 | -------------------------------------------------------------------------------- /data/examples/declaration/data/field-layout/record-1.hs: -------------------------------------------------------------------------------- 1 | -- | Foo. 2 | 3 | data Foo = 4 | Foo 5 | { foo :: Foo Int Int 6 | -- ^ Something 7 | , bar :: Bar Char 8 | Char 9 | -- ^ Something else 10 | } 11 | -------------------------------------------------------------------------------- /data/examples/declaration/data/field-layout/record-2-out.hs: -------------------------------------------------------------------------------- 1 | data IndexWithInfo schema 2 | = forall x. 3 | IndexWithInfo 4 | { checkedIndex :: Index schema x, 5 | checkedIndexName :: U.Variable, 6 | checkedIndexType :: Type x 7 | } 8 | -------------------------------------------------------------------------------- /data/examples/declaration/data/field-layout/record-2.hs: -------------------------------------------------------------------------------- 1 | data IndexWithInfo schema = 2 | forall x. 3 | IndexWithInfo 4 | { checkedIndex :: Index schema x 5 | , checkedIndexName :: U.Variable 6 | , checkedIndexType :: Type x 7 | } 8 | -------------------------------------------------------------------------------- /data/examples/declaration/data/field-layout/variants-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Foo. 4 | data Foo 5 | = -- | Something 6 | Foo Int Int 7 | | -- | Something else 8 | Bar 9 | Char 10 | Char 11 | -------------------------------------------------------------------------------- /data/examples/declaration/data/field-layout/variants.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Foo. 4 | 5 | data Foo = 6 | Foo Int Int 7 | -- ^ Something 8 | | Bar Char 9 | Char 10 | -- ^ Something else 11 | -------------------------------------------------------------------------------- /data/examples/declaration/data/gadt-syntax-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE GADTSyntax #-} 2 | 3 | data Foo where MKFoo :: a -> (a -> Bool) -> Foo 4 | -------------------------------------------------------------------------------- /data/examples/declaration/data/gadt-syntax.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE GADTSyntax #-} 2 | 3 | data Foo where { MKFoo :: a -> (a->Bool) -> Foo } 4 | -------------------------------------------------------------------------------- /data/examples/declaration/data/gadt/multiple-declaration.hs: -------------------------------------------------------------------------------- 1 | data GADT0 a where 2 | GADT01, GADT02 :: Int -> GADT0 a 3 | 4 | data GADT1 a where 5 | GADT11 6 | , GADT12 :: Int -> GADT1 a 7 | 8 | data GADT2 a where 9 | GADT21 10 | , GADT21 11 | , GADT22 :: Int -> GADT2 a 12 | -------------------------------------------------------------------------------- /data/examples/declaration/data/gadt/strictness-out.hs: -------------------------------------------------------------------------------- 1 | data Foo a where 2 | Foo1 :: !Int -> {-# UNPACK #-} !Bool -> Foo Int 3 | Foo2 :: {-# UNPACK #-} Maybe Int && Bool -> Foo Int 4 | -------------------------------------------------------------------------------- /data/examples/declaration/data/gadt/strictness.hs: -------------------------------------------------------------------------------- 1 | data Foo a where 2 | Foo1 :: !Int -> {-# UNPACK #-} !Bool -> Foo Int 3 | Foo2 :: {-# UNPACK #-} Maybe Int && Bool -> Foo Int 4 | -------------------------------------------------------------------------------- /data/examples/declaration/data/gadt/unicode-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE UnicodeSyntax #-} 2 | 3 | data Foo :: Type -> Type where 4 | Foo :: a -> Foo a 5 | -------------------------------------------------------------------------------- /data/examples/declaration/data/gadt/unicode.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE UnicodeSyntax #-} 2 | 3 | data Foo ∷ Type → Type where 4 | Foo ∷ a → Foo a 5 | -------------------------------------------------------------------------------- /data/examples/declaration/data/infix-out.hs: -------------------------------------------------------------------------------- 1 | data Foo a b = a `Foo` b 2 | -------------------------------------------------------------------------------- /data/examples/declaration/data/infix.hs: -------------------------------------------------------------------------------- 1 | data Foo a b = a `Foo` b 2 | -------------------------------------------------------------------------------- /data/examples/declaration/data/invisible-binders-out.hs: -------------------------------------------------------------------------------- 1 | type T :: forall k. k -> forall j. j -> Type 2 | data T @k (a :: k) @(j :: Type) (b :: j) 3 | -------------------------------------------------------------------------------- /data/examples/declaration/data/invisible-binders.hs: -------------------------------------------------------------------------------- 1 | type T :: forall k. k -> forall j. j -> Type 2 | data T @k (a :: k) @(j :: Type) (b :: j) 3 | -------------------------------------------------------------------------------- /data/examples/declaration/data/multiline-arg-parens-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Something. 4 | data Foo 5 | = Foo 6 | Bar 7 | (Set Baz) -- and here we go 8 | -- and that's it 9 | Text 10 | deriving (Eq) 11 | -------------------------------------------------------------------------------- /data/examples/declaration/data/multiline-arg-parens.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Something. 4 | 5 | data Foo 6 | = Foo Bar 7 | (Set Baz) -- and here we go 8 | -- and that's it 9 | Text 10 | deriving (Eq) 11 | -------------------------------------------------------------------------------- /data/examples/declaration/data/multiline-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Here we have 'Foo'. 4 | data Foo 5 | = -- | One 6 | Foo 7 | | -- | Two 8 | Bar Int 9 | | -- | Three 10 | Baz 11 | deriving 12 | (Eq, Show) 13 | -------------------------------------------------------------------------------- /data/examples/declaration/data/multiline.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Here we have 'Foo'. 4 | 5 | data Foo 6 | = Foo -- ^ One 7 | | Bar Int -- ^ Two 8 | | Baz -- ^ Three 9 | deriving 10 | (Eq, Show) 11 | -------------------------------------------------------------------------------- /data/examples/declaration/data/newtype-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Something. 4 | newtype Foo = Foo Int 5 | deriving (Eq, Show) 6 | -------------------------------------------------------------------------------- /data/examples/declaration/data/newtype.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Something. 4 | 5 | newtype Foo = Foo Int 6 | deriving (Eq, Show) 7 | -------------------------------------------------------------------------------- /data/examples/declaration/data/partly-documented-out.hs: -------------------------------------------------------------------------------- 1 | data Optimisation 2 | = PETransform 3 | | -- | partial eval and associated transforms 4 | GeneralisedNatHack 5 | deriving (Show, Eq, Generic) 6 | -------------------------------------------------------------------------------- /data/examples/declaration/data/partly-documented.hs: -------------------------------------------------------------------------------- 1 | data Optimisation = PETransform | GeneralisedNatHack -- ^ partial eval and associated transforms 2 | deriving (Show, Eq, Generic) 3 | -------------------------------------------------------------------------------- /data/examples/declaration/data/record-fancy-existential-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ExistentialQuantification #-} 2 | 3 | data Foo = forall a b. (Show a, Eq b) => Bar 4 | { foo :: a, 5 | bars :: b 6 | } 7 | -------------------------------------------------------------------------------- /data/examples/declaration/data/record-fancy-existential.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ExistentialQuantification #-} 2 | data Foo = forall a b . (Show a, Eq b) => Bar 3 | { foo :: a 4 | , bars :: b 5 | } 6 | -------------------------------------------------------------------------------- /data/examples/declaration/data/record-multi-const.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Something. 4 | 5 | data Foo = Foo 6 | { fooX :: Int -- ^ X 7 | , fooY :: Int -- ^ Y 8 | } | 9 | Bar 10 | { barX :: Int -- ^ X 11 | , barY :: Int -- ^ Y 12 | } 13 | deriving (Eq, Show) 14 | -------------------------------------------------------------------------------- /data/examples/declaration/data/record-singleline-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Something. 4 | data Foo = Foo {fooX :: Int, fooY :: Int} 5 | deriving (Eq, Show) 6 | -------------------------------------------------------------------------------- /data/examples/declaration/data/record-singleline.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Something. 4 | 5 | data Foo = Foo { fooX :: Int , fooY :: Int } 6 | deriving (Eq, Show) 7 | -------------------------------------------------------------------------------- /data/examples/declaration/data/simple-broken-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Here we go. 4 | data Foo 5 | = Foo {unFoo :: Int} 6 | deriving (Eq) 7 | 8 | -- | And once again. 9 | data Bar = Bar {unBar :: Int} 10 | deriving (Eq) 11 | -------------------------------------------------------------------------------- /data/examples/declaration/data/simple-broken.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Here we go. 4 | 5 | data Foo 6 | = Foo { unFoo :: Int } 7 | deriving (Eq) 8 | 9 | -- | And once again. 10 | 11 | data Bar = Bar { unBar :: Int } 12 | deriving (Eq) 13 | -------------------------------------------------------------------------------- /data/examples/declaration/data/simple-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | And here we have 'Foo'. 4 | data Foo = Foo | Bar Int | Baz 5 | deriving (Eq, Show) 6 | -------------------------------------------------------------------------------- /data/examples/declaration/data/simple.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | And here we have 'Foo'. 4 | 5 | data Foo = Foo | Bar Int | Baz 6 | deriving (Eq, Show) 7 | -------------------------------------------------------------------------------- /data/examples/declaration/data/strictness-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Something. 4 | data Foo 5 | = Foo1 !Int {-# UNPACK #-} !Bool {-# NOUNPACK #-} !String 6 | | Foo2 {a :: {-# UNPACK #-} Maybe Int && Bool} 7 | -------------------------------------------------------------------------------- /data/examples/declaration/data/strictness.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Something. 4 | 5 | data Foo 6 | = Foo1 !Int {-# UNPACK #-} !Bool {-# NOUNPACK #-} !String 7 | | Foo2 { a :: {-# UNPACK #-} Maybe Int && Bool } 8 | -------------------------------------------------------------------------------- /data/examples/declaration/data/type-data-out.hs: -------------------------------------------------------------------------------- 1 | type data Universe = Character | Number | Boolean 2 | 3 | type data Maybe a 4 | = Just a 5 | | Nothing 6 | 7 | type data P :: Type -> Type -> Type where 8 | MkP :: (a ~ Natural, b ~~ Char) => P a b 9 | -------------------------------------------------------------------------------- /data/examples/declaration/data/type-data.hs: -------------------------------------------------------------------------------- 1 | type data Universe = Character | Number | Boolean 2 | 3 | type data Maybe a = Just a 4 | | Nothing 5 | 6 | type data P :: Type -> Type -> Type where 7 | MkP :: (a ~ Natural, b ~~ Char) => P a b 8 | -------------------------------------------------------------------------------- /data/examples/declaration/data/unnamed-field-comment-0-out.hs: -------------------------------------------------------------------------------- 1 | data Foo 2 | = -- | Bar 3 | Bar 4 | -- | Field 1 5 | Field1 6 | -- | Field 2 7 | Field2 8 | -------------------------------------------------------------------------------- /data/examples/declaration/data/unnamed-field-comment-0.hs: -------------------------------------------------------------------------------- 1 | data Foo 2 | = -- | Bar 3 | Bar 4 | Field1 -- ^ Field 1 5 | Field2 -- ^ Field 2 6 | -------------------------------------------------------------------------------- /data/examples/declaration/data/unnamed-field-comment-1-out.hs: -------------------------------------------------------------------------------- 1 | data X 2 | = B 3 | -- | y 4 | !Int 5 | C 6 | -------------------------------------------------------------------------------- /data/examples/declaration/data/unnamed-field-comment-1.hs: -------------------------------------------------------------------------------- 1 | data X 2 | = B 3 | !Int -- ^ y 4 | C 5 | -------------------------------------------------------------------------------- /data/examples/declaration/data/unnamed-field-comment-3-out.hs: -------------------------------------------------------------------------------- 1 | data A 2 | = A 3 | -- | a number 4 | Int 5 | Bool 6 | -------------------------------------------------------------------------------- /data/examples/declaration/data/unnamed-field-comment-3.hs: -------------------------------------------------------------------------------- 1 | data A = A {- | a number -} Int Bool 2 | -------------------------------------------------------------------------------- /data/examples/declaration/data/wildcard-binders-out.hs: -------------------------------------------------------------------------------- 1 | data Proxy _ = Proxy 2 | -------------------------------------------------------------------------------- /data/examples/declaration/data/wildcard-binders.hs: -------------------------------------------------------------------------------- 1 | data Proxy _ = Proxy 2 | -------------------------------------------------------------------------------- /data/examples/declaration/data/with-comment-out.hs: -------------------------------------------------------------------------------- 1 | data A 2 | = B -- C 3 | | -- D 4 | E 5 | -------------------------------------------------------------------------------- /data/examples/declaration/data/with-comment.hs: -------------------------------------------------------------------------------- 1 | data A = 2 | B -- C 3 | 4 | -- D 5 | | E 6 | -------------------------------------------------------------------------------- /data/examples/declaration/data/with-weird-haddock-out.hs: -------------------------------------------------------------------------------- 1 | data PlusLevel' t 2 | = -- | @n + ℓ@. 3 | Plus Integer (LevelAtom' t) 4 | deriving (Show, Data) 5 | -------------------------------------------------------------------------------- /data/examples/declaration/data/with-weird-haddock.hs: -------------------------------------------------------------------------------- 1 | data PlusLevel' t = Plus Integer (LevelAtom' t) -- ^ @n + ℓ@. 2 | deriving (Show, Data) 3 | -------------------------------------------------------------------------------- /data/examples/declaration/instance/associated-types-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TypeFamilies #-} 2 | 3 | instance Foo Int where type Bar Int = Double 4 | 5 | instance Foo Double where 6 | type 7 | Bar 8 | Double = 9 | [Double] 10 | 11 | type 12 | Baz Double = 13 | [Double] 14 | -------------------------------------------------------------------------------- /data/examples/declaration/instance/data-family-instances-newtype-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE GADTSyntax #-} 2 | {-# LANGUAGE TypeFamilies #-} 3 | 4 | newtype instance Foo [Double] = DoubleListFoo 5 | { unDoubleListFoo :: Double 6 | } 7 | -------------------------------------------------------------------------------- /data/examples/declaration/instance/data-family-instances-newtype.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE GADTSyntax #-} 2 | {-# LANGUAGE TypeFamilies #-} 3 | newtype instance Foo [Double] = DoubleListFoo { 4 | unDoubleListFoo :: Double 5 | } 6 | 7 | -------------------------------------------------------------------------------- /data/examples/declaration/instance/empty-instance-out.hs: -------------------------------------------------------------------------------- 1 | instance Typeable Int 2 | 3 | instance Generic Int 4 | -------------------------------------------------------------------------------- /data/examples/declaration/instance/empty-instance.hs: -------------------------------------------------------------------------------- 1 | instance Typeable Int 2 | instance Generic Int where 3 | -------------------------------------------------------------------------------- /data/examples/declaration/instance/instance-sigs-multiple-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE InstanceSigs #-} 2 | 3 | instance Applicative [] where 4 | pure :: 5 | a -> 6 | [a] 7 | pure a = [a] 8 | (<*>) :: 9 | [a] -> [a] -> [a] 10 | (<*>) _ _ = [] 11 | -------------------------------------------------------------------------------- /data/examples/declaration/instance/instance-sigs-multiple.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE InstanceSigs #-} 2 | 3 | instance Applicative [] where 4 | pure :: 5 | a 6 | -> [a] 7 | pure a = [a] 8 | (<*>) 9 | :: [ a ] -> [ a ] -> [ a ] 10 | (<*>) _ _ = [] 11 | -------------------------------------------------------------------------------- /data/examples/declaration/instance/multi-parameter-out.hs: -------------------------------------------------------------------------------- 1 | instance MonadReader a ((->) a) where ask = id 2 | 3 | instance MonadState s (State s) where 4 | get = State.get 5 | put = State.put 6 | -------------------------------------------------------------------------------- /data/examples/declaration/instance/multi-parameter.hs: -------------------------------------------------------------------------------- 1 | instance MonadReader a ((->) a) where ask = id 2 | 3 | instance MonadState s (State s) 4 | where 5 | get = State.get 6 | put = State.put 7 | -------------------------------------------------------------------------------- /data/examples/declaration/instance/newlines-after-where-out.hs: -------------------------------------------------------------------------------- 1 | instance Num X where 2 | (+) = undefined 3 | 4 | instance Num Y where 5 | (+) = undefined 6 | -------------------------------------------------------------------------------- /data/examples/declaration/instance/newlines-after-where.hs: -------------------------------------------------------------------------------- 1 | instance Num X where 2 | (+) = undefined 3 | 4 | instance Num Y where 5 | 6 | 7 | (+) = undefined 8 | -------------------------------------------------------------------------------- /data/examples/declaration/instance/single-parameter-out.hs: -------------------------------------------------------------------------------- 1 | instance Monoid Int where (<>) x y = x + y 2 | 3 | instance Enum Int where 4 | fromEnum x = x 5 | toEnum = 6 | \x -> 7 | x 8 | 9 | instance Foo Int where foo x = x; bar y = y 10 | -------------------------------------------------------------------------------- /data/examples/declaration/instance/single-parameter.hs: -------------------------------------------------------------------------------- 1 | instance Monoid Int where (<>) x y = x+y 2 | 3 | instance Enum Int 4 | where 5 | fromEnum x = x 6 | toEnum 7 | = \x -> 8 | x 9 | 10 | instance Foo Int where { foo x = x; bar y = y } 11 | -------------------------------------------------------------------------------- /data/examples/declaration/rewrite-rule/empty-out.hs: -------------------------------------------------------------------------------- 1 | {-# RULES 2 | 3 | #-} 4 | -------------------------------------------------------------------------------- /data/examples/declaration/rewrite-rule/empty.hs: -------------------------------------------------------------------------------- 1 | {-# RULES 2 | #-} 3 | -------------------------------------------------------------------------------- /data/examples/declaration/rewrite-rule/forall-0-out.hs: -------------------------------------------------------------------------------- 1 | {-# RULES 2 | "fold/build" forall k z. foldr k z (build g) = g k z 3 | #-} 4 | 5 | {-# RULES 6 | "fusable/aux" forall x y. 7 | fusable x (aux y) = 8 | faux x y 9 | #-} 10 | -------------------------------------------------------------------------------- /data/examples/declaration/rewrite-rule/forall-0.hs: -------------------------------------------------------------------------------- 1 | {-# RULES 2 | "fold/build" forall k z . foldr k z (build g) = g k z 3 | #-} 4 | 5 | {-# RULES 6 | "fusable/aux" forall x y. 7 | fusable x (aux y) = faux x y 8 | #-} 9 | -------------------------------------------------------------------------------- /data/examples/declaration/rewrite-rule/never-active-out.hs: -------------------------------------------------------------------------------- 1 | {-# RULES "map-loop" [~] forall f. map' f = map' (id . f) #-} 2 | -------------------------------------------------------------------------------- /data/examples/declaration/rewrite-rule/never-active.hs: -------------------------------------------------------------------------------- 1 | {-# RULES "map-loop" [ ~ ] forall f . map' f = map' (id . f) #-} 2 | -------------------------------------------------------------------------------- /data/examples/declaration/role-annotation/multi-line-out.hs: -------------------------------------------------------------------------------- 1 | type role 2 | D 3 | phantom 4 | nominal 5 | 6 | type role 7 | E 8 | _ 9 | nominal 10 | 11 | type role 12 | E 13 | _ 14 | nominal 15 | phantom 16 | -------------------------------------------------------------------------------- /data/examples/declaration/role-annotation/multi-line.hs: -------------------------------------------------------------------------------- 1 | type role 2 | D phantom nominal 3 | 4 | type 5 | role 6 | E 7 | _ 8 | nominal 9 | 10 | type 11 | role 12 | E 13 | _ 14 | nominal 15 | phantom 16 | -------------------------------------------------------------------------------- /data/examples/declaration/role-annotation/single-line-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MagicHash #-} 2 | {-# LANGUAGE RoleAnnotations #-} 3 | 4 | type role Ptr representational 5 | 6 | type role A nominal nominal 7 | 8 | type role B _ phantom 9 | 10 | type role C _ _ 11 | -------------------------------------------------------------------------------- /data/examples/declaration/role-annotation/single-line.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE RoleAnnotations #-} 2 | {-# LANGUAGE MagicHash #-} 3 | 4 | type role Ptr representational 5 | 6 | type role A nominal nominal 7 | 8 | type role B _ phantom 9 | type role C _ _ 10 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/complete/complete-out.hs: -------------------------------------------------------------------------------- 1 | {-# COMPLETE A, B, C :: Foo #-} 2 | 3 | {-# COMPLETE A, B #-} 4 | 5 | {-# COMPLETE 6 | A, 7 | B, 8 | C :: 9 | Foo 10 | #-} 11 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/complete/complete.hs: -------------------------------------------------------------------------------- 1 | {-# ComPlETe A , B, C:: Foo 2 | 3 | #-} 4 | 5 | {-# COMPLETE A , B 6 | #-} 7 | 8 | {-# ComPlETE 9 | A , 10 | B, C 11 | 12 | 13 | :: Foo#-} 14 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/fixity/infix-out.hs: -------------------------------------------------------------------------------- 1 | infix 0 2 | 3 | infix 9 <^-^> 4 | 5 | infix 2 -> 6 | 7 | infix 0 type 8 | 9 | infix 9 + 10 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/fixity/infix.hs: -------------------------------------------------------------------------------- 1 | infix 0 2 | infix 9 <^-^> 3 | 4 | infix 2 -> 5 | 6 | infix 0 type 7 | 8 | infix + 9 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/fixity/infixl-out.hs: -------------------------------------------------------------------------------- 1 | infixl 8 *** 2 | 3 | infixl 0 $, *, +, &&, ** 4 | 5 | infixl 9 type $ 6 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/fixity/infixl.hs: -------------------------------------------------------------------------------- 1 | infixl 8 *** 2 | infixl 0 $, *, +, &&, ** 3 | 4 | infixl 9 type $ 5 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/fixity/infixr-out.hs: -------------------------------------------------------------------------------- 1 | infixr 8 `Foo` 2 | 3 | infixr 0 ***, &&& 4 | 5 | infixr 0 data $ 6 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/fixity/infixr.hs: -------------------------------------------------------------------------------- 1 | infixr 8 `Foo` 2 | infixr 0 ***, &&& 3 | 4 | infixr 0 data $ 5 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/inline/conlike-out.hs: -------------------------------------------------------------------------------- 1 | foo :: Int 2 | foo = 5 3 | {-# INLINE CONLIKE foo #-} 4 | 5 | bar :: Int 6 | bar = 6 7 | {-# INLINE CONLIKE bar #-} 8 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/inline/conlike.hs: -------------------------------------------------------------------------------- 1 | foo :: Int 2 | foo = 5 3 | {-# INLINE CONLIKE foo #-} 4 | 5 | bar :: Int 6 | bar = 6 7 | {-# INLINE CONLIKE bar #-} 8 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/inline/inlineable-out.hs: -------------------------------------------------------------------------------- 1 | foo :: Int -> Int 2 | foo = id 3 | {-# INLINEABLE foo #-} 4 | 5 | {-# INLINEABLE [2] bar #-} 6 | bar :: Int -> Int 7 | bar = id 8 | 9 | baz :: Int -> Int 10 | baz = id 11 | {-# INLINEABLE [~2] baz #-} 12 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/inline/inlineable.hs: -------------------------------------------------------------------------------- 1 | foo :: Int -> Int 2 | foo = id 3 | 4 | {-# INLINEABLE foo #-} 5 | 6 | {-# INLINEABLE [2] bar #-} 7 | 8 | bar :: Int -> Int 9 | bar = id 10 | 11 | baz :: Int -> Int 12 | baz = id 13 | {-# INLINEABLE [~2] baz #-} 14 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/minimal/minimal.hs: -------------------------------------------------------------------------------- 1 | class Foo a where 2 | 3 | {-# MINIMAL (==) |( (/=) , foo) #-} 4 | 5 | {-# MINIMAL a | (b , c , d | e 6 | , f) 7 | | g #-} 8 | 9 | (==) :: a -> a -> Bool 10 | (/=) :: a -> a -> Bool 11 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/pattern/single-line-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE PatternSynonyms #-} 2 | 3 | pattern Arrow :: Type -> Type -> Type 4 | 5 | pattern Foo, Bar :: Type -> Type -> Type 6 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/pattern/single-line.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE PatternSynonyms #-} 2 | 3 | pattern Arrow :: Type -> Type -> Type 4 | 5 | pattern Foo, Bar :: Type -> Type -> Type 6 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/type/context-multi-line-out.hs: -------------------------------------------------------------------------------- 1 | functionName :: 2 | ( C1, 3 | C2, 4 | C3 5 | ) => 6 | a -> 7 | b -> 8 | c -> 9 | d -> 10 | (a, b, c, d) 11 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/type/context-multi-line.hs: -------------------------------------------------------------------------------- 1 | functionName 2 | :: ( C1 3 | , C2 4 | , C3 5 | ) 6 | => a 7 | -> b 8 | -> c 9 | -> d 10 | -> (a, b, c, d) 11 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/type/context-single-line-out.hs: -------------------------------------------------------------------------------- 1 | functionName :: 2 | (C1, C2, C3) => 3 | a -> 4 | b -> 5 | c -> 6 | d -> 7 | (a, b, c, d) 8 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/type/context-single-line.hs: -------------------------------------------------------------------------------- 1 | functionName 2 | :: (C1, C2, C3) 3 | => a 4 | -> b 5 | -> c 6 | -> d 7 | -> (a, b, c, d) 8 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/type/infix-promoted-type-constructor-out.hs: -------------------------------------------------------------------------------- 1 | fun1 :: Def ('[Ref s (Stored Uint32), IBool] 'T.:-> IBool) 2 | fun2 :: Def ('[Ref s (Stored Uint32), IBool] ':-> IBool) 3 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/type/infix-promoted-type-constructor.hs: -------------------------------------------------------------------------------- 1 | fun1 :: Def ('[ Ref s (Stored Uint32), IBool] 'T.:-> IBool) 2 | fun2 :: Def ('[ Ref s (Stored Uint32), IBool] ':-> IBool) 3 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/type/long-function-name-out.hs: -------------------------------------------------------------------------------- 1 | longFunctionName :: 2 | a -> 3 | b -> 4 | c -> 5 | d -> 6 | (a, b, c, d) 7 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/type/long-function-name.hs: -------------------------------------------------------------------------------- 1 | longFunctionName 2 | :: a 3 | -> b 4 | -> c 5 | -> d 6 | -> (a, b, c, d) 7 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/type/multi-value-out.hs: -------------------------------------------------------------------------------- 1 | foo, bar :: Int 2 | foo = 1 3 | bar = 2 4 | 5 | a, b, c :: Int 6 | a = 1 7 | b = 2 8 | c = 3 9 | 10 | foo, 11 | bar, 12 | baz :: 13 | Int 14 | bar = 2 15 | baz = 3 16 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/type/multi-value.hs: -------------------------------------------------------------------------------- 1 | foo, bar :: Int 2 | foo = 1 3 | bar = 2 4 | 5 | a, b, c :: Int 6 | a = 1 7 | b = 2 8 | c = 3 9 | 10 | foo, 11 | bar, 12 | baz :: Int 13 | bar = 2 14 | baz = 3 15 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/type/unicode-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE UnicodeSyntax #-} 2 | 3 | foo :: forall a. (Show a) => a -> String 4 | foo = const () 5 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/type/unicode.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE UnicodeSyntax #-} 2 | 3 | foo ∷ ∀a. Show a ⇒ a → String 4 | foo = const () 5 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/type/unrelated-out.hs: -------------------------------------------------------------------------------- 1 | clientFunc1 :: SomeType1 2 | clientFunc2 :: SomeType2 3 | clientFunc3 :: SomeType3 4 | clientFunc1 :<|> clientFunc2 :<|> clientFunc3 = hoistClient foo bar baz 5 | -------------------------------------------------------------------------------- /data/examples/declaration/signature/type/unrelated.hs: -------------------------------------------------------------------------------- 1 | clientFunc1 :: SomeType1 2 | clientFunc2 :: SomeType2 3 | clientFunc3 :: SomeType3 4 | clientFunc1 :<|> clientFunc2 :<|> clientFunc3 = hoistClient foo bar baz 5 | -------------------------------------------------------------------------------- /data/examples/declaration/splice/bracket-unicode-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | {-# LANGUAGE UnicodeSyntax #-} 3 | 4 | ascii = [|x|] 5 | 6 | unicode = [|x|] 7 | -------------------------------------------------------------------------------- /data/examples/declaration/splice/bracket-unicode.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | {-# LANGUAGE UnicodeSyntax #-} 3 | 4 | ascii = [|x|] 5 | 6 | unicode = ⟦x⟧ 7 | -------------------------------------------------------------------------------- /data/examples/declaration/splice/bracket.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | 3 | foo = [| foo bar 4 | |] 5 | 6 | foo = [e| foo bar 7 | |] 8 | 9 | foo = [t| Char |] 10 | 11 | foo = [|| foo bar 12 | ||] 13 | 14 | foo = [t| * |] 15 | 16 | foo = [t|a -> * -> a|] 17 | -------------------------------------------------------------------------------- /data/examples/declaration/splice/grouped-splices-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | 3 | $(deriveJSON fieldLabelMod ''A) 4 | $(deriveJSON fieldLabelMod ''B) 5 | $(deriveJSON fieldLabelMod ''C) 6 | -------------------------------------------------------------------------------- /data/examples/declaration/splice/grouped-splices.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | 3 | $(deriveJSON fieldLabelMod ''A) 4 | $(deriveJSON fieldLabelMod ''B) 5 | $(deriveJSON fieldLabelMod ''C) 6 | -------------------------------------------------------------------------------- /data/examples/declaration/splice/quasiquote-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE QuasiQuotes #-} 2 | 3 | x = [foo| foo bar |] 4 | 5 | x = 6 | [e| foo 7 | bar {- -} 8 | |] 9 | 10 | [d| foo bar 11 | 12 | |] 13 | 14 | header = 15 | [here| 16 | #include foo|] 17 | -------------------------------------------------------------------------------- /data/examples/declaration/splice/quasiquote.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE QuasiQuotes #-} 2 | 3 | x = [foo| foo bar |] 4 | 5 | x = [e| foo 6 | bar {- -} 7 | |] 8 | 9 | [d| foo bar 10 | 11 | |] 12 | 13 | header = [here| 14 | #include foo|] 15 | -------------------------------------------------------------------------------- /data/examples/declaration/splice/quotes-out.hs: -------------------------------------------------------------------------------- 1 | foo = ''R 2 | 3 | bar = 'foo 4 | 5 | bar' = 'foo_bar 6 | 7 | baz = ''(:#) 8 | 9 | baz' = ''(Foo.Bar.:#) 10 | 11 | equals = ''(==) 12 | 13 | unit = ''() 14 | 15 | list = ''[] 16 | 17 | quolified = ''Semigroup.Option 18 | -------------------------------------------------------------------------------- /data/examples/declaration/splice/quotes.hs: -------------------------------------------------------------------------------- 1 | foo = ''R 2 | 3 | bar = 'foo 4 | 5 | bar' = 'foo_bar 6 | 7 | baz = ''(:#) 8 | 9 | baz' = ''(Foo.Bar.:#) 10 | 11 | equals = ''(==) 12 | 13 | unit = ''() 14 | 15 | list = ''[] 16 | 17 | quolified = ''Semigroup.Option 18 | -------------------------------------------------------------------------------- /data/examples/declaration/splice/splice-decl-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | 3 | $(foo bar) 4 | 5 | $foo 6 | 7 | $$(foo bar) 8 | 9 | $$foo 10 | 11 | foo bar 12 | 13 | [|booya|] 14 | 15 | -- TemplateHaskell allows Q () at the top level 16 | do 17 | pure [] 18 | -------------------------------------------------------------------------------- /data/examples/declaration/splice/splice-decl.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | 3 | $( foo bar) 4 | 5 | $foo 6 | 7 | $$( foo bar) 8 | 9 | $$foo 10 | 11 | foo bar 12 | 13 | [|booya|] 14 | 15 | -- TemplateHaskell allows Q () at the top level 16 | do 17 | pure [] 18 | -------------------------------------------------------------------------------- /data/examples/declaration/splice/typed-splice-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | 3 | x = 4 | $$(foo bar) 5 | 6 | x = $$foo 7 | -------------------------------------------------------------------------------- /data/examples/declaration/splice/typed-splice.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | 3 | x = $$( foo bar 4 | ) 5 | 6 | x = $$foo 7 | -------------------------------------------------------------------------------- /data/examples/declaration/splice/untyped-splice-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | 3 | x = $(foo bar) 4 | 5 | x = 6 | $( foo 7 | bar 8 | ) 9 | 10 | x = $foo 11 | -------------------------------------------------------------------------------- /data/examples/declaration/splice/untyped-splice.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | x = $( foo bar ) 3 | 4 | x = $( 5 | foo 6 | bar ) 7 | 8 | x = $foo 9 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/closed-type-family/injective-out.hs: -------------------------------------------------------------------------------- 1 | type family Id a = result | result -> a where 2 | Id a = a 3 | 4 | type family G (a :: k) b c = foo | foo -> k b where 5 | G a b c = (a, b) 6 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/closed-type-family/injective.hs: -------------------------------------------------------------------------------- 1 | type family Id a = result | result -> a where 2 | Id a = a 3 | type family G (a :: k) b c = foo | foo -> k b where 4 | G a b c = (a, b) 5 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/closed-type-family/no-annotation-out.hs: -------------------------------------------------------------------------------- 1 | type family F a where 2 | F Int = Double 3 | F Bool = Char 4 | F a = String 5 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/closed-type-family/no-annotation.hs: -------------------------------------------------------------------------------- 1 | type family F a where 2 | F Int = Double 3 | F Bool = Char 4 | F a = String 5 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/closed-type-family/promotion-out.hs: -------------------------------------------------------------------------------- 1 | type family Foo a where 2 | Foo '( 'x', a) = a 3 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/closed-type-family/promotion.hs: -------------------------------------------------------------------------------- 1 | type family Foo a where 2 | Foo '( 'x', a) = a 3 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/closed-type-family/simple-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Documentation. 4 | type family F a :: * -> * where 5 | F Int = Double 6 | F Bool = Char 7 | F a = String 8 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/closed-type-family/simple.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Documentation. 4 | 5 | type family F a :: * -> * where 6 | F Int = Double 7 | F Bool = Char 8 | F a = String 9 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/closed-type-family/type-arguments-out.hs: -------------------------------------------------------------------------------- 1 | type PickType :: forall k. Nat -> k 2 | type family PickType n where 3 | PickType @Type 1 = Bool 4 | PickType @(Type -> Type) 2 = Maybe 5 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/closed-type-family/type-arguments.hs: -------------------------------------------------------------------------------- 1 | type PickType :: forall k. Nat -> k 2 | type family PickType n where 3 | PickType @Type 1 = Bool 4 | PickType @(Type -> Type) 2 = Maybe 5 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/closed-type-family/with-comments-out.hs: -------------------------------------------------------------------------------- 1 | type family LT a b where 2 | -- 0 3 | LT 0 _ = True 4 | -- 1 5 | LT 1 0 = False 6 | LT 1 _ = True 7 | -- 2 8 | LT 2 0 = False 9 | LT 2 1 = False 10 | LT 2 _ = True 11 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/closed-type-family/with-comments.hs: -------------------------------------------------------------------------------- 1 | type family LT a b where 2 | -- 0 3 | LT 0 _ = True 4 | 5 | -- 1 6 | LT 1 0 = False 7 | LT 1 _ = True 8 | 9 | -- 2 10 | LT 2 0 = False 11 | LT 2 1 = False 12 | LT 2 _ = True 13 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/closed-type-family/with-equal-sign-out.hs: -------------------------------------------------------------------------------- 1 | type family TF a b = result where 2 | TF a b = Int 3 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/closed-type-family/with-equal-sign.hs: -------------------------------------------------------------------------------- 1 | type family TF a b = result where 2 | TF a b = Int 3 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/closed-type-family/with-forall-out.hs: -------------------------------------------------------------------------------- 1 | type family G a b where 2 | forall x y. G [x] (Proxy y) = Double 3 | forall z. z `G` z = Bool 4 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/closed-type-family/with-forall.hs: -------------------------------------------------------------------------------- 1 | type family G a b where 2 | forall x y. G [x] (Proxy y) = Double 3 | forall z. z `G` z = Bool 4 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/data-family/no-annotation-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Documentation. 4 | data family Array e 5 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/data-family/no-annotation.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Documentation. 4 | 5 | data family Array e 6 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/data-family/simple-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Documentation. 4 | data family GMap k :: Type -> Type 5 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/data-family/simple.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Documentation. 4 | 5 | data family GMap k :: Type -> Type 6 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/data-family/type-arguments-out.hs: -------------------------------------------------------------------------------- 1 | type PickType :: forall k. (k -> Type) -> Type 2 | data family PickType m 3 | 4 | data instance PickType @Nat M where 5 | Foo :: PickType M 6 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/data-family/type-arguments.hs: -------------------------------------------------------------------------------- 1 | type PickType :: forall k. (k -> Type) -> Type 2 | data family PickType m 3 | 4 | data instance PickType @Nat M where 5 | Foo :: PickType M 6 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/type-family/injective-out.hs: -------------------------------------------------------------------------------- 1 | type family Id a = r | r -> a 2 | 3 | type family F a b c = d | d -> a c b 4 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/type-family/injective.hs: -------------------------------------------------------------------------------- 1 | type family Id a = r | r -> a 2 | type family F a b c = d | d -> a c b 3 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/type-family/no-annotation-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Documentation. 4 | type family F a b :: Type -> Type 5 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/type-family/no-annotation.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Documentation. 4 | 5 | type family F a b :: Type -> Type 6 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/type-family/operator-out.hs: -------------------------------------------------------------------------------- 1 | type family a ! b 2 | 3 | type family a . b 4 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/type-family/operator.hs: -------------------------------------------------------------------------------- 1 | type family a ! b 2 | type family a . b 3 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/type-family/simple-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Documentation. 4 | type family Elem c :: Type 5 | -------------------------------------------------------------------------------- /data/examples/declaration/type-families/type-family/simple.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Documentation. 4 | 5 | type family Elem c :: Type 6 | -------------------------------------------------------------------------------- /data/examples/declaration/type-synonyms/simple-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Documentation. 4 | type Foo a b c = Bar c a b 5 | 6 | type a ~> b = TyFun a b -> Type 7 | 8 | type (a :+: b) c d e = () 9 | -------------------------------------------------------------------------------- /data/examples/declaration/type-synonyms/simple.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Documentation. 4 | 5 | type Foo a b c = Bar c a b 6 | 7 | type a ~> b = TyFun a b -> Type 8 | 9 | type (a :+: b) c d e = () 10 | -------------------------------------------------------------------------------- /data/examples/declaration/type-synonyms/with-weird-haddock-out.hs: -------------------------------------------------------------------------------- 1 | type Elims = 2 | -- | eliminations ordered left-to-right. 3 | [Elim] 4 | -------------------------------------------------------------------------------- /data/examples/declaration/type-synonyms/with-weird-haddock.hs: -------------------------------------------------------------------------------- 1 | type Elims = [Elim] -- ^ eliminations ordered left-to-right. 2 | -------------------------------------------------------------------------------- /data/examples/declaration/type/forall-out.hs: -------------------------------------------------------------------------------- 1 | type CoerceLocalSig m m' = 2 | forall r a. 3 | LocalSig m r a -> 4 | LocalSig m' r a 5 | -------------------------------------------------------------------------------- /data/examples/declaration/type/forall.hs: -------------------------------------------------------------------------------- 1 | type CoerceLocalSig m m' = 2 | forall r a. 3 | LocalSig m r a -> 4 | LocalSig m' r a 5 | -------------------------------------------------------------------------------- /data/examples/declaration/type/lits-out.hs: -------------------------------------------------------------------------------- 1 | type A = "foo" 2 | 3 | type B = 4 | "foo\ 5 | \bar" -> 6 | () 7 | -------------------------------------------------------------------------------- /data/examples/declaration/type/lits.hs: -------------------------------------------------------------------------------- 1 | type A = "foo" 2 | 3 | type B = "foo\ 4 | \bar" -> () 5 | -------------------------------------------------------------------------------- /data/examples/declaration/type/parens-comments-out.hs: -------------------------------------------------------------------------------- 1 | type Test = 2 | ( -- a 3 | x 4 | ) 5 | -------------------------------------------------------------------------------- /data/examples/declaration/type/parens-comments.hs: -------------------------------------------------------------------------------- 1 | type Test = ( 2 | -- a 3 | x) 4 | -------------------------------------------------------------------------------- /data/examples/declaration/type/promotion-0-out.hs: -------------------------------------------------------------------------------- 1 | type Foo = Cluster '[ 'NodeCore, 'NodeRelay', 'NodeEdge] 2 | 3 | type Query = Query '[] '[] DB '[ 'NotNull 'PGint4] (RowPG RawElementData) 4 | 5 | data T = T' | T'T 6 | 7 | type S0 = ' T' 8 | 9 | type S1 = ' T'T 10 | -------------------------------------------------------------------------------- /data/examples/declaration/type/promotion-0.hs: -------------------------------------------------------------------------------- 1 | type Foo = Cluster '[ 'NodeCore, 'NodeRelay', 'NodeEdge ] 2 | 3 | type Query = Query '[] '[] DB '[ 'NotNull 'PGint4] (RowPG RawElementData) 4 | 5 | data T = T' | T'T 6 | 7 | type S0 = ' T' 8 | 9 | type S1 = ' T'T 10 | -------------------------------------------------------------------------------- /data/examples/declaration/type/promotion-no-puns-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE NoListTuplePuns #-} 2 | 3 | type X = (Int, String) 4 | 5 | type Y = [String, Int] 6 | -------------------------------------------------------------------------------- /data/examples/declaration/type/promotion-no-puns.hs: -------------------------------------------------------------------------------- 1 | {-# Language NoListTuplePuns #-} 2 | 3 | type X = (Int, String) 4 | 5 | type Y = [String, Int] 6 | -------------------------------------------------------------------------------- /data/examples/declaration/type/splice-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | 3 | type Foo = $(bar [t|Int|]) 4 | -------------------------------------------------------------------------------- /data/examples/declaration/type/splice.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | 3 | type Foo = $( bar [t|Int|] ) 4 | -------------------------------------------------------------------------------- /data/examples/declaration/type/type-applications-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TypeApplications #-} 2 | 3 | type P = K @Bool @(Bool :: *) 'True 'False 4 | -------------------------------------------------------------------------------- /data/examples/declaration/type/type-applications.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TypeApplications #-} 2 | 3 | type P = K @Bool @(Bool :: *) 'True 'False 4 | -------------------------------------------------------------------------------- /data/examples/declaration/type/visible-forall-out.hs: -------------------------------------------------------------------------------- 1 | -- source: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0081-forall-arrow.rst 2 | data T :: forall k -> k -> Type 3 | -------------------------------------------------------------------------------- /data/examples/declaration/type/visible-forall.hs: -------------------------------------------------------------------------------- 1 | -- source: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0081-forall-arrow.rst 2 | data T :: forall k -> k -> Type 3 | -------------------------------------------------------------------------------- /data/examples/declaration/type/wildcard-binders-out.hs: -------------------------------------------------------------------------------- 1 | type Const a _ = a 2 | -------------------------------------------------------------------------------- /data/examples/declaration/type/wildcard-binders.hs: -------------------------------------------------------------------------------- 1 | type Const a _ = a 2 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/application-0-out.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | f1 3 | p1 4 | p2 5 | p3 6 | 7 | foo' = 8 | f2 9 | p1 10 | p2 11 | p3 12 | 13 | foo'' = 14 | f3 15 | p1 16 | p2 17 | p3 18 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/application-0.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | f1 3 | p1 4 | p2 p3 5 | 6 | foo' = f2 p1 7 | p2 8 | p3 9 | 10 | foo'' = 11 | f3 p1 p2 12 | p3 13 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/application-1-out.hs: -------------------------------------------------------------------------------- 1 | main = 2 | do 3 | x 4 | y 5 | z 6 | 7 | main = 8 | case foo of 9 | x -> a 10 | foo 11 | a 12 | b 13 | 14 | main = 15 | do 16 | if x then y else z 17 | foo 18 | a 19 | b 20 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/application-1.hs: -------------------------------------------------------------------------------- 1 | main = 2 | do 3 | x 4 | y 5 | z 6 | 7 | main = 8 | case foo of 9 | x -> a 10 | foo a b 11 | 12 | main = do 13 | if x then y else z 14 | foo a b 15 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/arg-breakpoints-out.hs: -------------------------------------------------------------------------------- 1 | foo 2 | bar = 3 | body 4 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/arg-breakpoints.hs: -------------------------------------------------------------------------------- 1 | foo 2 | bar = 3 | body 4 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/arrow/multiline-case-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE Arrows #-} 2 | 3 | f = proc x -> do 4 | x <- 5 | case x of X -> x 6 | -< 7 | y 8 | a -< b 9 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/arrow/multiline-case.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE Arrows #-} 2 | 3 | f = proc x -> do 4 | x 5 | <- case x of X -> x 6 | -< y 7 | a -< b 8 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/arrow/proc-lambdas-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE Arrows #-} 2 | 3 | foo = proc a -> \f b -> a -< f b -- Foo 4 | 5 | bar = 6 | proc x -> \f g h -> 7 | \() -> 8 | \(Left (x, y)) -> 9 | -- Tuple value 10 | f (g (h x)) -< y 11 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/arrow/proc-lambdas.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE Arrows #-} 2 | 3 | foo = proc a-> \f b->a- 7 | \f g h -> 8 | \() -> 9 | \( Left (x,y )) -> -- Tuple value 10 | f (g (h x)) -< y 11 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/arrow/proc-lets-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE Arrows #-} 2 | 3 | foo f = proc a -> let b = a in f -< b 4 | 5 | bar f g = proc a -> 6 | let h = 7 | f 8 | . g a 9 | j = 10 | g 11 | . h 12 | in id -< (h, j) 13 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/arrow/proc-parentheses.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE Arrows #-} 2 | foo f = proc a -> ( f -< a ) 3 | 4 | bar f g = proc a -> 5 | ( ((f) ( 6 | g 7 | )) 8 | -< ((((( 9 | (g 10 | a) 11 | ))))) 12 | ) 13 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/backticks-lhs-out.hs: -------------------------------------------------------------------------------- 1 | x `op1` (Just 0) = True 2 | op1 x (Just _) = False 3 | op1 x Nothing = undefined 4 | 5 | op2 1 y = False 6 | x `op2` y = 7 | True 8 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/backticks-lhs.hs: -------------------------------------------------------------------------------- 1 | x `op1` (Just 0) = True 2 | op1 x (Just _) = False 3 | op1 x Nothing = undefined 4 | 5 | op2 1 y = False 6 | x `op2` y = 7 | True 8 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/backticks-out.hs: -------------------------------------------------------------------------------- 1 | foo x y = x `bar` y 2 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/backticks.hs: -------------------------------------------------------------------------------- 1 | foo x y = x `bar` y 2 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/blank-lines-let-out.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | let x = 10 3 | 4 | y = 11 5 | z = 12 6 | in x + y + z 7 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/blank-lines-let.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | let 3 | 4 | x = 10 5 | 6 | y = 11 7 | z = 12 8 | 9 | in x + y + z 10 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/blank-lines-where-out.hs: -------------------------------------------------------------------------------- 1 | foo = x + y + z 2 | where 3 | x = 10 4 | 5 | y = 11 6 | z = 12 7 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/blank-lines-where.hs: -------------------------------------------------------------------------------- 1 | foo = x + y + z 2 | where 3 | 4 | x = 10 5 | 6 | y = 11 7 | z = 12 8 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/builtin-syntax-out.hs: -------------------------------------------------------------------------------- 1 | x = return () 2 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/builtin-syntax.hs: -------------------------------------------------------------------------------- 1 | x = return () 2 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/case-empty-out.hs: -------------------------------------------------------------------------------- 1 | absurd x = case x of {} 2 | absurd = \case {} 3 | absurd x = case x of {} 4 | absurd = \case {} 5 | 6 | foo = case () of {} 1 7 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/case-empty.hs: -------------------------------------------------------------------------------- 1 | absurd x = case x of 2 | absurd = \case 3 | absurd x = case x of {} 4 | absurd = \case {} 5 | 6 | foo = case () of {} 1 7 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/case-single-line-out.hs: -------------------------------------------------------------------------------- 1 | foo :: Int -> Int 2 | foo x = case x of x -> x 3 | 4 | foo :: IO () 5 | foo = case [1] of [_] -> "singleton"; _ -> "not singleton" 6 | foo = case [1] of { [] -> foo; _ -> bar } `finally` baz 7 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/case-single-line.hs: -------------------------------------------------------------------------------- 1 | foo :: Int -> Int 2 | foo x = case x of x -> x 3 | 4 | foo :: IO () 5 | foo = case [1] of [_] -> "singleton"; _ -> "not singleton" 6 | foo = case [1] of { [] -> foo; _ -> bar } `finally` baz 7 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/comprehension/transform-multi-line1-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TransformListComp #-} 2 | 3 | foo' xs ys = 4 | [ ( x, 5 | y 6 | ) 7 | | x <- xs, 8 | y <- ys, 9 | then 10 | -- First comment 11 | reverse -- Second comment 12 | ] 13 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/comprehension/transform-multi-line1.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TransformListComp #-} 2 | 3 | foo' xs ys = [ 4 | (x, 5 | y) | 6 | x <- xs, 7 | y <- ys, 8 | then -- First comment 9 | reverse -- Second comment 10 | ] 11 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/comprehension/transform-multi-line3.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TransformListComp #-} 2 | 3 | baz' xs ys = [ 4 | (x, 5 | y) | 6 | x <- xs, 7 | y <- ys, 8 | then 9 | group 10 | using -- First comment 11 | permutations -- Second comment 12 | ] 13 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/do-single-multi-out.hs: -------------------------------------------------------------------------------- 1 | foo = do 2 | ( bar 3 | baz 4 | ) 5 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/do-single-multi.hs: -------------------------------------------------------------------------------- 1 | foo = do (bar 2 | baz) 3 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/do-where-out.hs: -------------------------------------------------------------------------------- 1 | f :: Maybe Int 2 | f = do 3 | return c 4 | where 5 | c = 0 6 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/do-where.hs: -------------------------------------------------------------------------------- 1 | f :: Maybe Int 2 | f = do 3 | return c 4 | where 5 | c = 0 6 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/do/applications-and-parens.hs: -------------------------------------------------------------------------------- 1 | warningFor var place = do 2 | guard $ isVariableName var 3 | guard . not $ isInArray var place || isGuarded place 4 | (if includeGlobals || isLocal var 5 | then warningForLocals 6 | else warningForGlobals) var place 7 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/do/comment-alignment-out.hs: -------------------------------------------------------------------------------- 1 | main = do 2 | case blah of 3 | Nothing -> return () 4 | Just xs -> do 5 | forM_ xs foo 6 | bar 7 | -- and here it goes 8 | unless bobla $ 9 | quux 10 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/do/comment-alignment.hs: -------------------------------------------------------------------------------- 1 | main = do 2 | case blah of 3 | Nothing -> return () 4 | Just xs -> do 5 | forM_ xs foo 6 | bar 7 | -- and here it goes 8 | unless bobla $ 9 | quux 10 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/do/comment-spacing-out.hs: -------------------------------------------------------------------------------- 1 | foo = do 2 | bar 3 | -- foo 4 | baz 5 | 6 | -- foo 7 | quux 8 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/do/comment-spacing.hs: -------------------------------------------------------------------------------- 1 | foo = do 2 | bar 3 | -- foo 4 | baz 5 | 6 | -- foo 7 | quux 8 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/do/expr-out.hs: -------------------------------------------------------------------------------- 1 | quux = something $ do 2 | foo 3 | case x of 4 | 1 -> 10 5 | 2 -> 20 6 | bar 7 | if something 8 | then x 9 | else y 10 | baz 11 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/do/expr.hs: -------------------------------------------------------------------------------- 1 | quux = something $ do 2 | foo 3 | case x of 4 | 1 -> 10 5 | 2 -> 20 6 | bar 7 | if something 8 | then x 9 | else y 10 | baz 11 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/do/hang-rhs-arrow-out.hs: -------------------------------------------------------------------------------- 1 | foo = do 2 | something <- case bar of 3 | Foo -> return 1 4 | Bar -> return 2 5 | somethingElse <- 6 | case boom of 7 | Foo -> return 1 8 | Bar -> return 2 9 | quux something somethingElse 10 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/do/hang-rhs-arrow.hs: -------------------------------------------------------------------------------- 1 | foo = do 2 | something <- case bar of 3 | Foo -> return 1 4 | Bar -> return 2 5 | somethingElse <- 6 | case boom of 7 | Foo -> return 1 8 | Bar -> return 2 9 | quux something somethingElse 10 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/do/recursive-do-mdo-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE RecursiveDo #-} 2 | 3 | baz = 4 | mdo 5 | bar a 6 | a <- foo 7 | b <- 8 | bar 9 | 1 10 | 2 11 | 3 12 | return (a + b) 13 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/do/recursive-do-mdo.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE RecursiveDo #-} 2 | 3 | baz = 4 | mdo bar a 5 | a <- foo 6 | b <- bar 7 | 1 2 3 8 | return (a + b) 9 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/equality-constraints-out.hs: -------------------------------------------------------------------------------- 1 | foo :: (a ~ b) => a -> b -> Int 2 | foo = undefined 3 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/equality-constraints.hs: -------------------------------------------------------------------------------- 1 | foo :: (a ~ b) => a -> b -> Int 2 | foo = undefined 3 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/explicit-type-out.hs: -------------------------------------------------------------------------------- 1 | foo = 5 :: Int 2 | 3 | bar = 4 | 5 :: 5 | Int 6 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/explicit-type.hs: -------------------------------------------------------------------------------- 1 | foo = 5 :: Int 2 | 3 | bar = 5 4 | :: Int 5 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/if-single-line-functions-do-out.hs: -------------------------------------------------------------------------------- 1 | foo x = do 2 | y <- quux 3 | if x > 2 4 | then bar x 5 | else baz y 6 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/if-single-line-functions-do.hs: -------------------------------------------------------------------------------- 1 | foo x = do 2 | y <- quux 3 | if x > 2 4 | then bar x 5 | else baz y 6 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/if-single-line-functions-out.hs: -------------------------------------------------------------------------------- 1 | foo x = 2 | if x > 2 3 | then bar x 4 | else baz x 5 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/if-single-line-functions.hs: -------------------------------------------------------------------------------- 1 | foo x = 2 | if x > 2 3 | then bar x 4 | else baz x 5 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/if-single-line-out.hs: -------------------------------------------------------------------------------- 1 | foo :: Int -> Int 2 | foo x = if x > 5 then 10 else 12 3 | 4 | bar :: Int -> Int 5 | bar x = 6 | if x > 5 then 10 else 12 7 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/if-single-line.hs: -------------------------------------------------------------------------------- 1 | foo :: Int -> Int 2 | foo x = if x > 5 then 10 else 12 3 | 4 | bar :: Int -> Int 5 | bar x = 6 | if x > 5 then 10 else 12 7 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/if-with-comment-above-branches-out.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | if undefined 3 | -- then comment 4 | then undefined 5 | -- else comment 6 | else do 7 | undefined 8 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/if-with-comment-above-branches.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | if undefined 3 | -- then comment 4 | then undefined 5 | -- else comment 6 | else 7 | do 8 | undefined 9 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/if-with-comment-before-do-blocks-out.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | if something 3 | -- then comment 4 | then do 5 | stuff 6 | stuff 7 | -- else comment 8 | else do 9 | stuff 10 | stuff 11 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/if-with-comment-before-do-blocks.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | if something 3 | -- then comment 4 | then do 5 | stuff 6 | stuff 7 | -- else comment 8 | else do 9 | stuff 10 | stuff 11 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/if-with-comment-in-branches-with-functions.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | if x 3 | then 4 | -- comment 1 5 | -- comment 2 6 | foo 1 2 3 7 | else 8 | -- comment 3 9 | -- comment 4 10 | foo 11 | "here" 12 | "there" 13 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/if-with-comment-next-to-keyword-out.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | if x 3 | then -- comment 1 4 | -- comment 2 5 | foo 1 2 3 6 | else -- comment 3 7 | -- comment 4 8 | foo 9 | "here" 10 | "there" 11 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/if-with-comment-next-to-keyword.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | if x 3 | then -- comment 1 4 | -- comment 2 5 | foo 1 2 3 6 | else -- comment 3 7 | -- comment 4 8 | foo 9 | "here" 10 | "there" 11 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/applicative-out.hs: -------------------------------------------------------------------------------- 1 | f = 2 | Foo 3 | <$> bar 4 | <*> baz 5 | <*> baz' 6 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/applicative.hs: -------------------------------------------------------------------------------- 1 | f = 2 | Foo <$> bar 3 | <*> baz 4 | <*> baz' 5 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/comments-out.hs: -------------------------------------------------------------------------------- 1 | main = 2 | bar $ -- bar 3 | baz -- baz 4 | 5 | bar $ 6 | {- foo 7 | -} 8 | bar 9 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/comments.hs: -------------------------------------------------------------------------------- 1 | main = 2 | bar $ -- bar 3 | baz -- baz 4 | 5 | bar $ 6 | {- foo 7 | -} 8 | bar 9 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/do-out.hs: -------------------------------------------------------------------------------- 1 | main = 2 | do stuff 3 | `finally` do 4 | recover 5 | 6 | main = do stuff `finally` recover 7 | 8 | main = do { stuff } `finally` recover 9 | 10 | foo = 11 | do 12 | 1 13 | + 2 14 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/do.hs: -------------------------------------------------------------------------------- 1 | main = 2 | do stuff 3 | `finally` do 4 | recover 5 | 6 | main = do stuff `finally` recover 7 | 8 | main = do { stuff } `finally` recover 9 | 10 | foo = do 11 | 1 12 | + 13 | 2 14 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/dollar-chains-2-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | foo = 4 | bar 5 | $ do 1 6 | $ quux 7 | 8 | abc = 9 | a1 $ 10 | a2 $ do 11 | 3 12 | 13 | cde = 14 | b1 $ 15 | b2 $ 16 | b3 $ \c -> 17 | putStrLn "foo" 18 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/dollar-chains-2.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | foo = 4 | bar $ 5 | do 1 6 | $ 7 | quux 8 | 9 | abc = 10 | a1 $ 11 | a2 $ do 12 | 3 13 | 14 | cde = 15 | b1 16 | $ b2 17 | $ b3 $ \c -> 18 | putStrLn "foo" 19 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/dollar-chains-3-out.hs: -------------------------------------------------------------------------------- 1 | ex1 = 2 | f1 $ 3 | arg1 $ 4 | arg2 $ 5 | arg3 6 | 7 | ex3 = 8 | f1 $ 9 | arg1 $ 10 | arg2 $ 11 | 1 + 3 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/dollar-chains-3.hs: -------------------------------------------------------------------------------- 1 | ex1 = 2 | f1 $ 3 | arg1 $ 4 | arg2 $ arg3 5 | 6 | ex3 = 7 | f1 $ 8 | arg1 $ 9 | arg2 $ 1 + 3 10 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/dollar-chains-4-out.hs: -------------------------------------------------------------------------------- 1 | ex2 = 2 | f1 $ 3 | arg1 $ 4 | arg2 $ 5 | f2 arg3 6 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/dollar-chains-4.hs: -------------------------------------------------------------------------------- 1 | ex2 = 2 | f1 $ 3 | arg1 $ 4 | arg2 $ f2 arg3 5 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/dollar-chains-5-out.hs: -------------------------------------------------------------------------------- 1 | ex4 = 2 | f1 $ 3 | arg1 $ 4 | arg2 $ do 5 | arg3 6 | 7 | ex6 = 8 | f1 $ 9 | arg1 $ 10 | arg2 $ 11 | do arg3 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/dollar-chains-5.hs: -------------------------------------------------------------------------------- 1 | ex4 = 2 | f1 $ 3 | arg1 $ 4 | arg2 $ do 5 | arg3 6 | 7 | ex6 = 8 | f1 $ 9 | arg1 $ 10 | arg2 $ do arg3 11 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/dollar-chains-6-out.hs: -------------------------------------------------------------------------------- 1 | ex5 = 2 | f1 $ 3 | arg1 $ 4 | arg2 $ \c -> 5 | 3 * c 6 | 7 | ex7 = 8 | f1 $ 9 | arg1 $ 10 | arg2 $ 11 | \c -> 3 * c 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/dollar-chains-6.hs: -------------------------------------------------------------------------------- 1 | ex5 = 2 | f1 $ 3 | arg1 $ 4 | arg2 $ \c -> 5 | 3 * c 6 | 7 | ex7 = 8 | f1 $ 9 | arg1 $ 10 | arg2 $ \c -> 3 * c 11 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/esqueleto-1.hs: -------------------------------------------------------------------------------- 1 | import qualified Database.Esqueleto.Experimental as E 2 | 3 | foo = 4 | E.from $ 5 | E.table 6 | `E.innerJoin` E.table 7 | `E.on` ( \(a :& b) -> 8 | a E.^. AField E.==. b E.^. BField 9 | ) 10 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/fractional-precedence-out.hs: -------------------------------------------------------------------------------- 1 | startFormTok |~| messageTag 2 | >~< startMessageTok |~| name 3 | >~< p' |~| endMessageTok |~| endFormTok 4 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/fractional-precedence.hs: -------------------------------------------------------------------------------- 1 | startFormTok |~| messageTag 2 | >~< startMessageTok |~| name 3 | >~< p' |~| endMessageTok |~| endFormTok 4 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-colon-do-out.hs: -------------------------------------------------------------------------------- 1 | -- chain mixing : and do-blocks 2 | d = 3 | do 4 | 1 5 | : do 6 | 2 7 | : do 8 | 3 9 | : do 10 | 4 11 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-colon-do.hs: -------------------------------------------------------------------------------- 1 | -- chain mixing : and do-blocks 2 | d = 3 | do 4 | 1 5 | : do 6 | 2 7 | : do 8 | 3 9 | : do 10 | 4 11 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-l-eq-out.hs: -------------------------------------------------------------------------------- 1 | -- Left chain, 2 operators with p(a) == p(b) 2 | s :: Int 3 | s = 4 | 1 5 | + 2 6 | + 3 7 | + 4 8 | - 5 9 | + 6 10 | + 7 11 | + 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-l-eq.hs: -------------------------------------------------------------------------------- 1 | -- Left chain, 2 operators with p(a) == p(b) 2 | s :: Int 3 | s = 4 | 1 + 5 | 2 + 6 | 3 + 7 | 4 - 8 | 5 + 9 | 6 + 10 | 7 + 11 | 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-l-gt-out.hs: -------------------------------------------------------------------------------- 1 | -- Left chain, 2 operators with p(a) > p(b) 2 | t :: Int 3 | t = 4 | 1 5 | + 2 6 | + 3 7 | + 4 8 | >> 5 9 | + 6 10 | + 7 11 | + 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-l-gt.hs: -------------------------------------------------------------------------------- 1 | -- Left chain, 2 operators with p(a) > p(b) 2 | t :: Int 3 | t = 4 | 1 + 5 | 2 + 6 | 3 + 7 | 4 >> 8 | 5 + 9 | 6 + 10 | 7 + 11 | 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-l-lt-out.hs: -------------------------------------------------------------------------------- 1 | -- Left chain, 2 operators with p(a) < p(b) 2 | u :: Int 3 | u = 4 | 1 5 | + 2 6 | + 3 7 | + 4 8 | * 5 9 | + 6 10 | + 7 11 | + 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-l-lt.hs: -------------------------------------------------------------------------------- 1 | -- Left chain, 2 operators with p(a) < p(b) 2 | u :: Int 3 | u = 4 | 1 + 5 | 2 + 6 | 3 + 7 | 4 * 8 | 5 + 9 | 6 + 10 | 7 + 11 | 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-l-s-out.hs: -------------------------------------------------------------------------------- 1 | -- Left chain, 1 operator type 2 | r :: Int 3 | r = 4 | 1 5 | + 2 6 | + 3 7 | + 4 8 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-l-s.hs: -------------------------------------------------------------------------------- 1 | -- Left chain, 1 operator type 2 | r :: Int 3 | r = 4 | 1 + 5 | 2 + 6 | 3 + 7 | 4 8 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-eq-colon-1-out.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, : case, 2 operators with p(:) == p(b) 2 | h :: Int 3 | h = 4 | 1 5 | : 2 6 | : 3 7 | : 4 8 | ++ 5 9 | : 6 10 | : 7 11 | : 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-eq-colon-1.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, : case, 2 operators with p(:) == p(b) 2 | h :: Int 3 | h = 4 | 1 : 5 | 2 : 6 | 3 : 7 | 4 ++ 8 | 5 : 9 | 6 : 10 | 7 : 11 | 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-eq-colon-2-out.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, : case, 2 operators with p(a) == p(:) 2 | k :: Int 3 | k = 4 | 1 5 | ++ 2 6 | ++ 3 7 | ++ 4 8 | : 5 9 | ++ 6 10 | ++ 7 11 | ++ 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-eq-colon-2.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, : case, 2 operators with p(a) == p(:) 2 | k :: Int 3 | k = 4 | 1 ++ 5 | 2 ++ 6 | 3 ++ 7 | 4 : 8 | 5 ++ 9 | 6 ++ 10 | 7 ++ 11 | 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-eq-dollar-1-out.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, $ case, 2 operators with p($) == p(b) 2 | n :: Int 3 | n = 4 | 1 $ 5 | 2 $ 6 | 3 $ 7 | 4 `seq` 8 | 5 $ 9 | 6 $ 10 | 7 $ 11 | 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-eq-dollar-1.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, $ case, 2 operators with p($) == p(b) 2 | n :: Int 3 | n = 4 | 1 $ 5 | 2 $ 6 | 3 $ 7 | 4 `seq` 8 | 5 $ 9 | 6 $ 10 | 7 $ 11 | 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-eq-dollar-2.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, $ case, 2 operators with p(a) == p($) 2 | p :: Int 3 | p = 4 | 1 `seq` 5 | 2 `seq` 6 | 3 `seq` 7 | 4 $ 8 | 5 `seq` 9 | 6 `seq` 10 | 7 `seq` 11 | 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-eq-normal-out.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, normal case, 2 operators with p(a) == p(b) 2 | e :: Int 3 | e = 4 | 1 5 | ^^ 2 6 | ^^ 3 7 | ^^ 4 8 | ^ 5 9 | ^^ 6 10 | ^^ 7 11 | ^^ 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-eq-normal.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, normal case, 2 operators with p(a) == p(b) 2 | e :: Int 3 | e = 4 | 1 ^^ 5 | 2 ^^ 6 | 3 ^^ 7 | 4 ^ 8 | 5 ^^ 9 | 6 ^^ 10 | 7 ^^ 11 | 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-gt-colon-1-out.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, : case, 2 operators with p(:) > p(b) 2 | i :: Int 3 | i = 4 | 1 5 | : 2 6 | : 3 7 | : 4 8 | `seq` 5 9 | : 6 10 | : 7 11 | : 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-gt-colon-1.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, : case, 2 operators with p(:) > p(b) 2 | i :: Int 3 | i = 4 | 1 : 5 | 2 : 6 | 3 : 7 | 4 `seq` 8 | 5 : 9 | 6 : 10 | 7 : 11 | 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-gt-colon-2-out.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, : case, 2 operators with p(a) > p(:) 2 | l :: Int 3 | l = 4 | 1 5 | ^^ 2 6 | ^^ 3 7 | ^^ 4 8 | : 5 9 | ^^ 6 10 | ^^ 7 11 | ^^ 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-gt-colon-2.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, : case, 2 operators with p(a) > p(:) 2 | l :: Int 3 | l = 4 | 1 ^^ 5 | 2 ^^ 6 | 3 ^^ 7 | 4 : 8 | 5 ^^ 9 | 6 ^^ 10 | 7 ^^ 11 | 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-gt-dollar-out.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, $ case, 2 operators with p(a) > p($) 2 | q :: Int 3 | q = 4 | 1 5 | ++ 2 6 | ++ 3 7 | ++ 4 8 | $ 5 9 | ++ 6 10 | ++ 7 11 | ++ 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-gt-dollar.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, $ case, 2 operators with p(a) > p($) 2 | q :: Int 3 | q = 4 | 1 ++ 5 | 2 ++ 6 | 3 ++ 7 | 4 $ 8 | 5 ++ 9 | 6 ++ 10 | 7 ++ 11 | 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-gt-normal-out.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, normal case, 2 operators with p(a) > p(b) 2 | f :: Int 3 | f = 4 | 1 5 | ^^ 2 6 | ^^ 3 7 | ^^ 4 8 | ++ 5 9 | ^^ 6 10 | ^^ 7 11 | ^^ 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-gt-normal.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, normal case, 2 operators with p(a) > p(b) 2 | f :: Int 3 | f = 4 | 1 ^^ 5 | 2 ^^ 6 | 3 ^^ 7 | 4 ++ 8 | 5 ^^ 9 | 6 ^^ 10 | 7 ^^ 11 | 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-lt-colon-1-out.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, : case, 2 operators with p(:) < p(b) 2 | j :: Int 3 | j = 4 | 1 5 | : 2 6 | : 3 7 | : 4 8 | ^^ 5 9 | : 6 10 | : 7 11 | : 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-lt-colon-1.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, : case, 2 operators with p(:) < p(b) 2 | j :: Int 3 | j = 4 | 1 : 5 | 2 : 6 | 3 : 7 | 4 ^^ 8 | 5 : 9 | 6 : 10 | 7 : 11 | 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-lt-colon-2-out.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, : case, 2 operators with p(a) < p(:) 2 | m :: Int 3 | m = 4 | 1 5 | || 2 6 | || 3 7 | || 4 8 | : 5 9 | || 6 10 | || 7 11 | || 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-lt-colon-2.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, : case, 2 operators with p(a) < p(:) 2 | m :: Int 3 | m = 4 | 1 || 5 | 2 || 6 | 3 || 7 | 4 : 8 | 5 || 9 | 6 || 10 | 7 || 11 | 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-lt-dollar-out.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, $ case, 2 operators with p($) < p(b) 2 | o :: Int 3 | o = 4 | 1 5 | $ 2 6 | $ 3 7 | $ 4 8 | ++ 5 9 | $ 6 10 | $ 7 11 | $ 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-lt-dollar.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, $ case, 2 operators with p($) < p(b) 2 | o :: Int 3 | o = 4 | 1 $ 5 | 2 $ 6 | 3 $ 7 | 4 ++ 8 | 5 $ 9 | 6 $ 10 | 7 $ 11 | 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-lt-normal-out.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, normal case, 2 operators with p(a) < p(b) 2 | g :: Int 3 | g = 4 | 1 5 | ++ 2 6 | ++ 3 7 | ++ 4 8 | ^^ 5 9 | ++ 6 10 | ++ 7 11 | ++ 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-lt-normal.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, normal case, 2 operators with p(a) < p(b) 2 | g :: Int 3 | g = 4 | 1 ++ 5 | 2 ++ 6 | 3 ++ 7 | 4 ^^ 8 | 5 ++ 9 | 6 ++ 10 | 7 ++ 11 | 8 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-s-colon-out.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, : case, 1 operator type 2 | b :: Int 3 | b = 4 | 1 5 | : 2 6 | : 3 7 | : 4 8 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-s-colon.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, : case, 1 operator type 2 | b :: Int 3 | b = 4 | 1 : 5 | 2 : 6 | 3 : 7 | 4 8 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-s-dollar-out.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, $ case, 1 operator type 2 | c :: Int 3 | c = 4 | 1 $ 5 | 2 $ 6 | 3 $ 7 | 4 8 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-s-dollar.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, $ case, 1 operator type 2 | c :: Int 3 | c = 4 | 1 $ 5 | 2 $ 6 | 3 $ 7 | 4 8 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-s-normal-out.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, normal case, 1 operator type 2 | a :: Int 3 | a = 4 | 1 5 | ++ 2 6 | ++ 3 7 | ++ 4 8 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/op-chain-r-s-normal.hs: -------------------------------------------------------------------------------- 1 | -- Right chain, normal case, 1 operator type 2 | a :: Int 3 | a = 4 | 1 ++ 5 | 2 ++ 6 | 3 ++ 7 | 4 8 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/simple-out.hs: -------------------------------------------------------------------------------- 1 | (*) :: Int -> Int -> Int 2 | x * y = z 3 | 4 | foo :: Int -> Int -> Int 5 | x `foo` y = z 6 | 7 | bar :: Int -> Int -> Int -> Int 8 | (x `bar` y) z = z 9 | 10 | multiline :: Int -> Int -> Int 11 | x 12 | `multiline` y = z 13 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/simple.hs: -------------------------------------------------------------------------------- 1 | (*) :: Int -> Int -> Int 2 | x * y = z 3 | 4 | foo :: Int -> Int -> Int 5 | x `foo` y = z 6 | 7 | bar :: Int -> Int -> Int -> Int 8 | (x `bar` y) z = z 9 | 10 | multiline :: Int -> Int -> Int 11 | x `multiline` 12 | y = z 13 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/tricky-colon-chain-out.hs: -------------------------------------------------------------------------------- 1 | b :: [Int] 2 | b = 3 | 1 4 | : do 5 | 2 6 | : do 7 | 3 8 | : do 9 | [4] 10 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/tricky-colon-chain.hs: -------------------------------------------------------------------------------- 1 | b :: [Int] 2 | b = 3 | 1 : 4 | do 5 | 2 6 | : do 7 | 3 8 | : do 9 | [4] 10 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/unicode-out.hs: -------------------------------------------------------------------------------- 1 | main = print ('a' → 'a') 2 | where 3 | (→) = (,) 4 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/infix/unicode.hs: -------------------------------------------------------------------------------- 1 | main = print ('a' → 'a') 2 | where 3 | (→) = (,) 4 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/let-nested-out.hs: -------------------------------------------------------------------------------- 1 | _ = _ 2 | where 3 | _ = [_ | let _ = _] 4 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/let-nested.hs: -------------------------------------------------------------------------------- 1 | _ = _ 2 | where 3 | _ = [_ | let _ = _] 4 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/lexical-negation-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE LexicalNegation #-} 2 | 3 | foo = -1 4 | 5 | foo = -x 6 | 7 | weird :: (Int -> Int) -> Int -> Int 8 | weird x y = x -y 9 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/lexical-negation.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE LexicalNegation #-} 2 | 3 | foo = -1 4 | 5 | foo = -x 6 | 7 | weird :: (Int -> Int) -> Int -> Int 8 | weird x y = x -y 9 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/list-notation-0-out.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | testCase "Foo" testFoo 3 | : testCase "Bar" testBar 4 | : testCase "Baz" testBaz 5 | : [] 6 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/list-notation-0.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | testCase "Foo" testFoo : 3 | testCase "Bar" testBar : 4 | testCase "Baz" testBaz : 5 | [] 6 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/list-notation-2-out.hs: -------------------------------------------------------------------------------- 1 | -- A list of the element and all its parents up to the root node. 2 | getPath tree t = 3 | t 4 | : case Map.lookup (getId t) tree of 5 | Nothing -> [] 6 | Just parent -> getPath tree parent 7 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/list-notation-2.hs: -------------------------------------------------------------------------------- 1 | -- A list of the element and all its parents up to the root node. 2 | getPath tree t = t : 3 | case Map.lookup (getId t) tree of 4 | Nothing -> [] 5 | Just parent -> getPath tree parent 6 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/multi-way-if.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MultiWayIf #-} 2 | 3 | foo x = if | x == 5 -> 5 4 | 5 | bar x y = if 6 | | x > y -> x 7 | | x < y 8 | -> y 9 | | otherwise -> x 10 | 11 | baz = 12 | if | p -> f 13 | | otherwise -> g 14 | x 15 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/multiline-arguments-out.hs: -------------------------------------------------------------------------------- 1 | foo :: Int -> Int -> Int -> Int 2 | foo 3 | (Foo g o) 4 | ( Bar 5 | x 6 | y 7 | ) 8 | z = x 9 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/multiline-arguments.hs: -------------------------------------------------------------------------------- 1 | foo :: Int -> Int -> Int -> Int 2 | foo (Foo g o) 3 | (Bar 4 | x y) z = x 5 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/multiline-strings-1-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MultilineStrings #-} 2 | 3 | s = 4 | """ 5 | a b\ \ c d e 6 | f g 7 | """ 8 | 9 | -- equivalent to 10 | s' = "a b c d e\nf g" 11 | 12 | weirdGap = """\65\ \0""" 13 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/multiline-strings-1.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MultilineStrings #-} 2 | 3 | s = 4 | """ 5 | a b\ 6 | \ c d e 7 | f g 8 | """ 9 | 10 | -- equivalent to 11 | s' = "a b c d e\nf g" 12 | 13 | weirdGap = """\65\ \0""" 14 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/multiline-strings-2-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MultilineStrings #-} 2 | 3 | s = 4 | """ 5 | a 6 | b 7 | c 8 | """ 9 | 10 | -- equivalent to 11 | s' = "a\nb\nc" 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/multiline-strings-2.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MultilineStrings #-} 2 | 3 | s = 4 | """ 5 | a 6 | b 7 | c 8 | """ 9 | 10 | -- equivalent to 11 | s' = "a\nb\nc" 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/multiline-strings-6-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MultilineStrings #-} 2 | 3 | x = 4 | """ 5 | This is a literal multiline string: 6 | \"\"\" 7 | Hello 8 | world! 9 | \""" 10 | """ 11 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/multiline-strings-6.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MultilineStrings #-} 2 | 3 | x = 4 | """ 5 | This is a literal multiline string: 6 | \"\"\" 7 | Hello 8 | world! 9 | \""" 10 | """ 11 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/multiline-strings-8-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MultilineStrings #-} 2 | 3 | type Foo = 4 | """ 5 | yeah 6 | yeah""" 7 | 8 | foo = 9 | foo 10 | @"""yeah 11 | yeah 12 | """ 13 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/multiline-strings-8.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MultilineStrings #-} 2 | 3 | type Foo = """ 4 | yeah 5 | yeah""" 6 | 7 | foo = foo @"""yeah 8 | yeah 9 | """ 10 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/multiple-guards.hs: -------------------------------------------------------------------------------- 1 | foo :: Int -> Int 2 | foo x | x == 5 = 10 3 | | otherwise = 12 4 | 5 | bar :: Int -> Int 6 | bar x 7 | | x == 5 = foo x 8 | + foo 10 9 | | x == 6 = foo x 10 | + foo 20 11 | | otherwise = foo 100 12 | 13 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/multiple-matches-out.hs: -------------------------------------------------------------------------------- 1 | foo :: Int -> Int 2 | foo 5 = 10 3 | foo _ = 12 4 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/multiple-matches.hs: -------------------------------------------------------------------------------- 1 | foo :: Int -> Int 2 | foo 5 = 10 3 | foo _ = 12 4 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/negative-literals-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE NegativeLiterals #-} 2 | 3 | foo = - 1 4 | 5 | foo = -1 6 | 7 | foo = -x 8 | 9 | foo = -x 10 | 11 | pat = \case -1 -> 1 12 | 13 | pat = \case - 1 -> 1 14 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/negative-literals.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE NegativeLiterals #-} 2 | 3 | foo = - 1 4 | 5 | foo = -1 6 | 7 | foo = - x 8 | 9 | foo = -x 10 | 11 | pat = \case -1 -> 1 12 | 13 | pat = \case - 1 -> 1 14 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/operator-comments-2-out.hs: -------------------------------------------------------------------------------- 1 | x = 2 | y 3 | ++ f g -- commentA 4 | -- commentB 5 | -- commentC 6 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/operator-comments-2.hs: -------------------------------------------------------------------------------- 1 | x = 2 | y ++ -- commentA 3 | -- commentB 4 | f g -- commentC 5 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/operator-hash-with-unboxed-sums-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE UnboxedSums #-} 2 | 3 | module Foo (( #<| )) where 4 | 5 | ( #<| ) :: Int -> Int -> Int 6 | ( #<| ) = (+) 7 | 8 | (+) = (+) 9 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/operator-hash-with-unboxed-sums.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE UnboxedSums #-} 2 | 3 | module Foo (( #<| )) where 4 | 5 | ( #<| ) :: Int -> Int -> Int 6 | ( #<| ) = (+) 7 | 8 | (+) = (+) 9 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/operator-hash-without-unboxed-sums-out.hs: -------------------------------------------------------------------------------- 1 | module Foo ((#<|)) where 2 | 3 | (#<|) :: Int -> Int -> Int 4 | (#<|) = (+) 5 | 6 | (+) = (+) 7 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/operator-hash-without-unboxed-sums.hs: -------------------------------------------------------------------------------- 1 | module Foo (( #<| )) where 2 | 3 | ( #<| ) :: Int -> Int -> Int 4 | ( #<| ) = (+) 5 | 6 | (+) = (+) 7 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/operator-sections-out.hs: -------------------------------------------------------------------------------- 1 | foo = (0 +) 2 | 3 | bar = (<> "hello") 4 | 5 | baz = 6 | ( 1 * 2 7 | + 8 | ) 9 | ( * 10 | 3 ^ 5 11 | ) 12 | 13 | quux = (,) <$> foo <$> bar 14 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/operator-sections.hs: -------------------------------------------------------------------------------- 1 | foo = (0 +) 2 | bar = ( <> "hello" ) 3 | baz = 4 | ( 1 * 2 5 | + ) 6 | ( * 7 | 3 ^ 5) 8 | 9 | quux = (,) <$> foo <$> bar 10 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/operators-0-out.hs: -------------------------------------------------------------------------------- 1 | import Control.Lens.Operators 2 | 3 | a = 4 | b 5 | & c .~ d 6 | & e 7 | %~ f 8 | g 9 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/operators-0.hs: -------------------------------------------------------------------------------- 1 | import Control.Lens.Operators 2 | 3 | a = 4 | b & c .~ d 5 | & e %~ f 6 | g 7 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/operators-1-out.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | f 3 | . g 4 | =<< h . i 5 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/operators-1.hs: -------------------------------------------------------------------------------- 1 | foo = f 2 | . g 3 | =<< h . i 4 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/operators-2-out.hs: -------------------------------------------------------------------------------- 1 | foo n 2 | | x 3 | || y && z 4 | || n ** x 5 | || x && n = 6 | 42 7 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/operators-2.hs: -------------------------------------------------------------------------------- 1 | foo n 2 | | x || y && z || n ** x 3 | || x && n = 4 | 42 5 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/operators-3-out.hs: -------------------------------------------------------------------------------- 1 | import Control.Arrow 2 | 3 | foo = 4 | op <> n 5 | <+> colon 6 | <+> prettySe 7 | <+> text "=" 8 | <+> prettySe <> text sc 9 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/operators-3.hs: -------------------------------------------------------------------------------- 1 | import Control.Arrow 2 | 3 | foo = 4 | op <> n <+> colon <+> prettySe <+> text "=" <+> 5 | prettySe <> text sc 6 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/operators-4-out.hs: -------------------------------------------------------------------------------- 1 | import Control.Arrow 2 | 3 | foo = 4 | line <> bindingOf 5 | <+> text "=" 6 | <+> tPretty 7 | <+> colon 8 | <+> align <> prettyPs 9 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/operators-4.hs: -------------------------------------------------------------------------------- 1 | import Control.Arrow 2 | 3 | foo = 4 | line <> bindingOf <+> text "=" <+> tPretty <+> colon <+> 5 | align <> prettyPs 6 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/operators-5-out.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | map bar $ 3 | [ baz 4 | ] 5 | ++ quux 6 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/operators-5.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | map bar $ 3 | [ baz 4 | ] ++ quux 5 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/operators-7-out.hs: -------------------------------------------------------------------------------- 1 | foo c = case c of { _ -> c } : [] 2 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/operators-7.hs: -------------------------------------------------------------------------------- 1 | foo c = case c of {_->c} : [] 2 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/overindentation-out.hs: -------------------------------------------------------------------------------- 1 | reallyincrediblyLongName = 2 | f 3 | a 4 | A 5 | { reallyincrediblyLongName = 6 | f 7 | a 8 | A 9 | { reallyincrediblyLongName 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/overindentation.hs: -------------------------------------------------------------------------------- 1 | reallyincrediblyLongName = f 2 | a 3 | A 4 | { reallyincrediblyLongName = f 5 | a 6 | A 7 | { reallyincrediblyLongName 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/parallel-comprehensions-single-line-out.hs: -------------------------------------------------------------------------------- 1 | foo x y = [(a, b) | a <- x | b <- y] 2 | 3 | bar x y z w = [(a, b, c, d) | a <- x, b <- y, a `mod` b == 0 | c <- z | d <- w] 4 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/parallel-comprehensions-single-line.hs: -------------------------------------------------------------------------------- 1 | foo x y = [(a,b) | a<-x | b<-y] 2 | 3 | bar x y z w = [(a,b,c,d) | a<-x, b<-y, a`mod`b == 0|c<-z|d<-w ] 4 | 5 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/parens-comments-out.hs: -------------------------------------------------------------------------------- 1 | test = 2 | ( -- a 3 | x 4 | ) 5 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/parens-comments.hs: -------------------------------------------------------------------------------- 1 | test = ( 2 | -- a 3 | x) 4 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/parens-out.hs: -------------------------------------------------------------------------------- 1 | f = p (do foo; bar) baz 2 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/parens.hs: -------------------------------------------------------------------------------- 1 | f = p (do foo; bar) baz 2 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/parenthesis-lhs-out.hs: -------------------------------------------------------------------------------- 1 | (!=!) 2 y = 1 2 | x !=! y = 2 3 | 4 | x ?=? [] = 123 5 | (?=?) x (_ : []) = 456 6 | x ?=? _ = f x x 7 | where 8 | f x 7 = 789 9 | x `f` _ = 101 10 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/parenthesis-lhs.hs: -------------------------------------------------------------------------------- 1 | (!=!) 2 y = 1 2 | x !=! y = 2 3 | 4 | x ?=? [] = 123 5 | (?=?) x (_:[]) = 456 6 | x ?=? _ = f x x 7 | where 8 | f x 7 = 789 9 | x `f` _ = 101 10 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/pattern/as-pattern-out.hs: -------------------------------------------------------------------------------- 1 | main = case [1] of 2 | xs@(x : _) -> print (x, xs) 3 | xs@[] -> print xs 4 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/pattern/as-pattern.hs: -------------------------------------------------------------------------------- 1 | main = case [1] of 2 | xs@(x:_) -> print (x, xs) 3 | xs@[] -> print xs 4 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/pattern/famous-cardano-pattern-out.hs: -------------------------------------------------------------------------------- 1 | ( getNodeSettingsR 2 | :<|> getNodeInfoR 3 | :<|> getNextUpdateR 4 | :<|> restartNodeR 5 | ) 6 | :<|> ( getUtxoR 7 | :<|> getConfirmedProposalsR 8 | ) = client nodeV1Api 9 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/pattern/famous-cardano-pattern.hs: -------------------------------------------------------------------------------- 1 | ( getNodeSettingsR 2 | :<|> getNodeInfoR 3 | :<|> getNextUpdateR 4 | :<|> restartNodeR 5 | ):<|>( getUtxoR 6 | :<|> getConfirmedProposalsR 7 | ) = client nodeV1Api 8 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/pattern/many-guards-in-singleline-out.hs: -------------------------------------------------------------------------------- 1 | foobar x | x <- 5 = 5 | x <- 6 = 6 | otherwise = 7 2 | 3 | foobaz | x <- 5 = 5 | x <- 6 = 6 | otherwise = 7 4 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/pattern/many-guards-in-singleline.hs: -------------------------------------------------------------------------------- 1 | foobar x | x <- 5 = 5 | x <- 6 = 6 | otherwise = 7 2 | 3 | foobaz | x <- 5 = 5 | x <- 6 = 6 | otherwise = 7 4 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/pattern/multiline-guard-statement-out.hs: -------------------------------------------------------------------------------- 1 | foobarbar :: Int -> Bool 2 | foobarbar 3 | | x <- 4 | 5 = case x of 5 | 5 -> True 6 | _ -> False 7 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/pattern/multiline-guard-statement.hs: -------------------------------------------------------------------------------- 1 | foobarbar :: Int -> Bool 2 | foobarbar | x <- 3 | 5 = case x of 4 | 5 -> True 5 | _ -> False 6 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/pattern/multiple-guard-statements-out.hs: -------------------------------------------------------------------------------- 1 | foobarbar :: Int -> Bool 2 | foobarbar 3 | | x <- 5, 4 | y <- 6 = case x of 5 | 5 -> True 6 | _ -> False 7 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/pattern/multiple-guard-statements.hs: -------------------------------------------------------------------------------- 1 | foobarbar :: Int -> Bool 2 | foobarbar | x <- 5, y <- 6 = case x of 3 | 5 -> True 4 | _ -> False 5 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/pattern/n-plus-k-pattern-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE NPlusKPatterns #-} 2 | 3 | singleline :: Int 4 | singleline (n + 1) = n 5 | 6 | multiline :: Int 7 | multiline 8 | ( n 9 | + 1 10 | ) = n 11 | 12 | n :: Int 13 | (n + 1) = 3 14 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/pattern/n-plus-k-pattern.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE NPlusKPatterns #-} 2 | singleline :: Int 3 | singleline (n + 1) = n 4 | 5 | multiline :: Int 6 | multiline(n 7 | + 1) = n 8 | 9 | n :: Int 10 | (n + 1) = 3 11 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/pattern/pattern-bind-out.hs: -------------------------------------------------------------------------------- 1 | foo = bar 2 | where 3 | Foo bar baz = quux 4 | Baz 5 | quux = zoo 6 | 7 | foo = bar 8 | where 9 | Foo bar baz = quux 10 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/pattern/pattern-bind.hs: -------------------------------------------------------------------------------- 1 | foo = bar 2 | where 3 | Foo bar baz = quux 4 | Baz 5 | quux = zoo 6 | 7 | foo = bar 8 | where Foo bar baz = quux 9 | 10 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/pattern/quasi-quotes-pattern-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE QuasiQuotes #-} 2 | 3 | singleline :: () 4 | singleline [yamlQQ|something|] = () 5 | 6 | multiline :: () 7 | multiline = case y of 8 | [yamlQQ| name: John Doe 9 | age: 23 10 | |] -> () 11 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/pattern/quasi-quotes-pattern.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE QuasiQuotes #-} 2 | singleline :: () 3 | singleline [yamlQQ|something|] = () 4 | 5 | multiline :: () 6 | multiline = case y of 7 | [yamlQQ| name: John Doe 8 | age: 23 9 | |] -> () 10 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/pattern/sig-pattern-out.hs: -------------------------------------------------------------------------------- 1 | f = do 2 | x :: a <- g 3 | 4 | f = do 5 | (x, y) :: 6 | (a, b) <- 7 | g 8 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/pattern/sig-pattern.hs: -------------------------------------------------------------------------------- 1 | f = do 2 | x :: a <- g 3 | 4 | f = do 5 | (x, y) 6 | :: (a, b) 7 | <- g 8 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/pattern/splice-pattern.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | 3 | singleLine = case () of 4 | $x -> () 5 | $(y "something") -> () 6 | 7 | multiline = case () of 8 | $(x 9 | + y) -> () 10 | $(y 11 | "something") -> () 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/pattern/strictness-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE BangPatterns #-} 2 | 3 | !a = () 4 | 5 | ~b = () 6 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/pattern/strictness.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE BangPatterns #-} 2 | 3 | !a = () 4 | ~b = () 5 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/prefix-out.hs: -------------------------------------------------------------------------------- 1 | foo x y = (+) x y 2 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/prefix.hs: -------------------------------------------------------------------------------- 1 | foo x y = (+) x y 2 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/primitive-literals-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ExtendedLiterals #-} 2 | {-# LANGUAGE MagicHash #-} 3 | 4 | foo = 1# 5 | 6 | bar = 2## 7 | 8 | baz = 3#Word32 9 | 10 | baz = 0b1010#Int64 11 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/primitive-literals.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ExtendedLiterals, MagicHash #-} 2 | 3 | foo = 1# 4 | 5 | bar = 2## 6 | 7 | baz = 3#Word32 8 | 9 | baz = 0b1010#Int64 10 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/quasi-quotes-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE QuasiQuotes #-} 2 | 3 | singleline :: Value 4 | singleline = [yamlQQ|something|] 5 | 6 | multiline :: Value 7 | multiline = 8 | [yamlQQ| name: John Doe 9 | age: 23 10 | 11 | something: foo 12 | |] 13 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/quasi-quotes.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE QuasiQuotes #-} 2 | singleline :: Value 3 | singleline = [yamlQQ|something|] 4 | 5 | multiline :: Value 6 | multiline = [yamlQQ| name: John Doe 7 | age: 23 8 | 9 | something: foo 10 | |] 11 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/record/hanging-after-equal-con-out.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | Foo 3 | { foo = 4 | -- Blah blah 5 | case x of 6 | Blah -> 1 7 | Blim -> 2 8 | } 9 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/record/hanging-after-equal-con.hs: -------------------------------------------------------------------------------- 1 | foo = Foo 2 | { foo = 3 | -- Blah blah 4 | case x of 5 | Blah -> 1 6 | Blim -> 2 7 | } 8 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/record/hanging-after-equal-update-out.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | foo 3 | { foo = 4 | -- Blah blah 5 | case x of 6 | Blah -> 1 7 | Blim -> 2 8 | } 9 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/record/hanging-after-equal-update.hs: -------------------------------------------------------------------------------- 1 | foo = foo 2 | { foo = 3 | -- Blah blah 4 | case x of 5 | Blah -> 1 6 | Blim -> 2 7 | } 8 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/record/inter-comments-out.hs: -------------------------------------------------------------------------------- 1 | x = 2 | Just 3 | -- comment 4 | A 5 | { x 6 | } 7 | 8 | x = 9 | Just 10 | -- comment 11 | a 12 | { x 13 | } 14 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/record/inter-comments.hs: -------------------------------------------------------------------------------- 1 | x = Just 2 | -- comment 3 | A 4 | { x 5 | } 6 | 7 | x = Just 8 | -- comment 9 | a 10 | { x 11 | } 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/record/updaters-out.hs: -------------------------------------------------------------------------------- 1 | foo x = x {a = 3} 2 | 3 | bar x = 4 | x 5 | { abc = foo, 6 | def = Foo {a = 10} 7 | } 8 | 9 | baz x = x {} 10 | 11 | sym x = x {(+) = 4} 12 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/record/updaters.hs: -------------------------------------------------------------------------------- 1 | foo x = x { a = 3 } 2 | bar x = x { 3 | abc = foo, 4 | def = Foo {a = 10} 5 | } 6 | baz x = x{ } 7 | sym x = x { (+) = 4 } 8 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/record/wildcards-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE NamedFieldPuns #-} 2 | {-# LANGUAGE RecordWildCards #-} 3 | 4 | foo x y = Foo {x, y} 5 | 6 | bar x y z = 7 | Bar 8 | { x, 9 | y, 10 | z, 11 | .. 12 | } 13 | 14 | baz = Baz {..} 15 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/record/wildcards.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE NamedFieldPuns #-} 2 | {-# LANGUAGE RecordWildCards #-} 3 | 4 | foo x y = Foo { x, y } 5 | 6 | bar x y z = Bar { 7 | x, 8 | y, 9 | z, 10 | .. 11 | } 12 | 13 | baz = Baz { .. } 14 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/simple-out.hs: -------------------------------------------------------------------------------- 1 | bar x = x 2 | 3 | baz = x 4 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/simple.hs: -------------------------------------------------------------------------------- 1 | bar x = x 2 | baz = x 3 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/splice-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | 3 | bar = $bar 4 | 5 | bar' = $(bar "something") 6 | 7 | baz = $$baz 8 | 9 | baz' = $$(baz "something") 10 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/splice.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | 3 | bar = $bar 4 | 5 | bar' = $(bar "something") 6 | 7 | baz = $$baz 8 | 9 | baz' = $$(baz "something") 10 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/strings-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MagicHash #-} 2 | 3 | foo = "foobar" 4 | 5 | bar = "foo\&bar\ \baz" 6 | 7 | baz = 8 | "foo\ 9 | \bar\ 10 | \baz" 11 | 12 | weirdGap = "\65\ \0" 13 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/strings.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MagicHash #-} 2 | 3 | foo = "foobar" 4 | bar = "foo\&bar\ \baz" 5 | baz = "foo\ 6 | \bar\ 7 | \baz" 8 | 9 | weirdGap = "\65\ \0" 10 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/tricky-parens-out.hs: -------------------------------------------------------------------------------- 1 | handleStuff = 2 | ( let foo = foo 3 | in foo 4 | ) 5 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/tricky-parens.hs: -------------------------------------------------------------------------------- 1 | handleStuff = 2 | ( let foo = foo 3 | in foo 4 | ) 5 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/tuple-sections-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TupleSections #-} 2 | 3 | foo = (,2) 4 | 5 | bar = (,5,) 6 | 7 | baz = 8 | (,,5,6,7,,,) 9 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/tuple-sections.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TupleSections #-} 2 | 3 | foo = (,2) 4 | bar = (,5,) 5 | baz = ( 6 | ,,5,6, 7 | 7,,, 8 | ) 9 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/tuples-out.hs: -------------------------------------------------------------------------------- 1 | foo = (1, 2, 3) 2 | 3 | bar = 4 | ( 1, 5 | 2, 6 | 3 7 | ) 8 | 9 | handleStuff = 10 | ( let foo = foo 11 | in foo, 12 | let bar = bar 13 | in bar 14 | ) 15 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/tuples.hs: -------------------------------------------------------------------------------- 1 | foo = ( 1,2,3 ) 2 | bar = ( 3 | 1, 4 | 2, 5 | 3 6 | ) 7 | 8 | handleStuff = 9 | ( let foo = foo 10 | in foo 11 | , let bar = bar 12 | in bar 13 | ) 14 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/type-abstractions-out.hs: -------------------------------------------------------------------------------- 1 | id :: forall a. a -> a 2 | id @t x = x :: t 3 | 4 | f1 :: forall a. a -> forall b. b -> (a, b) 5 | f1 @a x @b y = (x :: a, y :: b) 6 | 7 | f2 = 8 | (\ @a x @b y -> (x :: a, y :: b)) :: 9 | forall a. a -> forall b. b -> (a, b) 10 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/type-abstractions.hs: -------------------------------------------------------------------------------- 1 | id :: forall a. a -> a 2 | id @t x = x :: t 3 | 4 | f1 :: forall a. a -> forall b. b -> (a, b) 5 | f1 @a x @b y = (x :: a, y :: b) 6 | 7 | f2 = (\ @a x @b y -> (x :: a, y :: b) ) 8 | :: forall a. a -> forall b. b -> (a, b) 9 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/type-applications-and-splice-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | {-# LANGUAGE TypeApplications #-} 3 | 4 | staticKey name = [|sing @ $(symFQN name)|] 5 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/type-applications-and-splice.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | {-# LANGUAGE TypeApplications #-} 3 | 4 | staticKey name = [| sing @ $(symFQN name) |] 5 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/typed-expressions-out.hs: -------------------------------------------------------------------------------- 1 | foo x = x :: Int 2 | 3 | bar x = 4 | Just x :: 5 | Maybe String 6 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/typed-expressions.hs: -------------------------------------------------------------------------------- 1 | foo x = x::Int 2 | bar x = Just x :: 3 | Maybe String 4 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/typed-hole-out.hs: -------------------------------------------------------------------------------- 1 | foo = 1 `_` 2 2 | 3 | bar = 1 `_a` 2 4 | 5 | baz = _ `something` _ 6 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/typed-hole.hs: -------------------------------------------------------------------------------- 1 | foo = 1 `_` 2 2 | 3 | bar = 1 `_a` 2 4 | 5 | baz = _ `something` _ 6 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/unboxed-string-lit-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MagicHash #-} 2 | 3 | main = new "p"# 4 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/unboxed-string-lit.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE MagicHash #-} 2 | 3 | main = new "p"# 4 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/unboxed-tuples-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE UnboxedTuples #-} 2 | 3 | foo = (# 1, 2, 3 #) 4 | 5 | bar = 6 | (# 7 | 1, 8 | 2, 9 | 3 10 | #) 11 | 12 | unit :: (# #) 13 | unit = (# #) 14 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/unboxed-tuples.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE UnboxedTuples #-} 2 | 3 | foo = (# 1,2,3 #) 4 | bar = (# 5 | 1, 6 | 2, 7 | 3 #) 8 | 9 | unit :: (##) 10 | unit = (##) 11 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/where-nested-out.hs: -------------------------------------------------------------------------------- 1 | foo = bar 2 | where 3 | f1 = f1 4 | where 5 | f1 = 3 6 | f2 = f2 7 | where 8 | f2 = 3 9 | 10 | foo2 = bar 11 | where 12 | f1 = f1 where { f1 = 3; f1' = 4 }; f2 = f2 where f2 = 3; f2' = 4 13 | -------------------------------------------------------------------------------- /data/examples/declaration/value/function/where-nested.hs: -------------------------------------------------------------------------------- 1 | foo = bar 2 | where 3 | f1 = f1 4 | where 5 | f1 = 3 6 | f2 = f2 7 | where 8 | f2 = 3 9 | 10 | foo2 = bar 11 | where 12 | { f1 = f1 where { f1 = 3; f1' = 4 }; f2 = f2 where { f2 = 3; f2' = 4 } } 13 | -------------------------------------------------------------------------------- /data/examples/declaration/value/other/line-multi-line-out.hs: -------------------------------------------------------------------------------- 1 | x :: [Int] 2 | x = 3 | [ 1, 4 | 2, 5 | somethingSomething 3 6 | ] 7 | -------------------------------------------------------------------------------- /data/examples/declaration/value/other/line-multi-line.hs: -------------------------------------------------------------------------------- 1 | x :: [Int] 2 | x = [ 3 | 1 4 | , 2 5 | , somethingSomething 3 6 | ] 7 | -------------------------------------------------------------------------------- /data/examples/declaration/value/other/line-single-line-out.hs: -------------------------------------------------------------------------------- 1 | x :: [Int] 2 | x = [1, 2, 3] 3 | -------------------------------------------------------------------------------- /data/examples/declaration/value/other/line-single-line.hs: -------------------------------------------------------------------------------- 1 | x :: [Int] 2 | x = [1,2,3] 3 | -------------------------------------------------------------------------------- /data/examples/import/comments-inside-imports-out.hs: -------------------------------------------------------------------------------- 1 | -- x 2 | 3 | import qualified -- x 4 | Bar 5 | import qualified -- x 6 | Baz 7 | import Foo 8 | -------------------------------------------------------------------------------- /data/examples/import/comments-inside-imports.hs: -------------------------------------------------------------------------------- 1 | import -- x 2 | Foo 3 | 4 | import -- x 5 | qualified Bar 6 | 7 | import qualified 8 | -- x 9 | Baz 10 | -------------------------------------------------------------------------------- /data/examples/import/comments-per-import-out.hs: -------------------------------------------------------------------------------- 1 | -- (1) 2 | import Bar -- (2) 3 | import Baz -- (3) 4 | import Foo 5 | -------------------------------------------------------------------------------- /data/examples/import/comments-per-import.hs: -------------------------------------------------------------------------------- 1 | import Foo -- (1) 2 | import Bar -- (2) 3 | import Baz -- (3) 4 | -------------------------------------------------------------------------------- /data/examples/import/deduplication-bug-out.hs: -------------------------------------------------------------------------------- 1 | import Foo1 (Bar1 (..), Baz1) 2 | import Foo2 (Bar2 (..), Baz2) 3 | import Foo3 (Bar3 (x1, x2, x3)) 4 | import Foo4 (Bar4 (x1, x2)) 5 | import Foo5 (Bar5 (x1)) 6 | import Foo6 (Bar6 (..)) 7 | -------------------------------------------------------------------------------- /data/examples/import/deduplication-bug.hs: -------------------------------------------------------------------------------- 1 | import Foo1 (Bar1, Baz1, Bar1(..)) 2 | import Foo2 (Bar2(..), Baz2, Bar2) 3 | import Foo3 (Bar3(x1,x3), Bar3(x1, x2)) 4 | import Foo4 (Bar4(x1), Bar4(x2)) 5 | import Foo5 (Bar5, Bar5(x1)) 6 | import Foo6 (Bar6(x1), Bar6(..)) 7 | -------------------------------------------------------------------------------- /data/examples/import/deprecated-export-multi-line-out.hs: -------------------------------------------------------------------------------- 1 | module X 2 | ( {-# DEPRECATE D(D1) "D1 will not be exposed in a version 0.2 and later" #-} 3 | D (D1, D2), 4 | ) 5 | where 6 | 7 | data D = D1 | D2 8 | -------------------------------------------------------------------------------- /data/examples/import/deprecated-export-multi-line.hs: -------------------------------------------------------------------------------- 1 | module X 2 | ( {-# DEPRECATE D(D1) "D1 will not be exposed in a version 0.2 and later" #-} 3 | D(D1, D2) 4 | ) where 5 | data D = D1 | D2 6 | -------------------------------------------------------------------------------- /data/examples/import/deprecated-export-single-line-out.hs: -------------------------------------------------------------------------------- 1 | module A ({-# DEPRECATED "blah" #-} x) where 2 | 3 | x = True 4 | -------------------------------------------------------------------------------- /data/examples/import/deprecated-export-single-line.hs: -------------------------------------------------------------------------------- 1 | module A ( {-# DEPRECATED "blah" #-} x ) where { x = True } 2 | -------------------------------------------------------------------------------- /data/examples/import/explicit-imports-out.hs: -------------------------------------------------------------------------------- 1 | import qualified MegaModule as M 2 | ( Either, 3 | Maybe (Just, Nothing), 4 | MaybeT (..), 5 | Monad (return, (>>), (>>=)), 6 | MonadBaseControl, 7 | join, 8 | liftIO, 9 | void, 10 | (<<<), 11 | (>>>), 12 | ) 13 | -------------------------------------------------------------------------------- /data/examples/import/explicit-imports-with-comments-out.hs: -------------------------------------------------------------------------------- 1 | import qualified MegaModule as M 2 | ( -- (1) 3 | -- (2) 4 | Either, -- (3) 5 | (<<<), 6 | (>>>), 7 | ) 8 | -------------------------------------------------------------------------------- /data/examples/import/explicit-imports-with-comments.hs: -------------------------------------------------------------------------------- 1 | import qualified MegaModule as M 2 | ( (>>>) -- (1) 3 | , (<<<) -- (2) 4 | , Either -- (3) 5 | ) 6 | -------------------------------------------------------------------------------- /data/examples/import/explicit-imports.hs: -------------------------------------------------------------------------------- 1 | import qualified MegaModule as M 2 | ((>>>), MonadBaseControl, void, MaybeT(..), join, Maybe(Nothing, Just), liftIO, Either, (<<<), Monad(return, (>>=), (>>))) 3 | -------------------------------------------------------------------------------- /data/examples/import/explicit-prelude-out.hs: -------------------------------------------------------------------------------- 1 | import Aaa 2 | import Zzz 3 | import Prelude 4 | -------------------------------------------------------------------------------- /data/examples/import/explicit-prelude.hs: -------------------------------------------------------------------------------- 1 | import Aaa 2 | import Prelude 3 | import Zzz 4 | -------------------------------------------------------------------------------- /data/examples/import/merging-0-out.hs: -------------------------------------------------------------------------------- 1 | import Foo 2 | import Foo (bar, foo) 3 | import Foo as F 4 | -------------------------------------------------------------------------------- /data/examples/import/merging-0.hs: -------------------------------------------------------------------------------- 1 | import Foo 2 | import Foo (foo) 3 | import Foo (bar) 4 | import Foo as F 5 | -------------------------------------------------------------------------------- /data/examples/import/merging-1-out.hs: -------------------------------------------------------------------------------- 1 | import "bar" Foo (bar) 2 | import "foo" Foo (baz, foo) 3 | -------------------------------------------------------------------------------- /data/examples/import/merging-1.hs: -------------------------------------------------------------------------------- 1 | import "foo" Foo (foo) 2 | import "bar" Foo (bar) 3 | import "foo" Foo (baz) 4 | -------------------------------------------------------------------------------- /data/examples/import/merging-2-out.hs: -------------------------------------------------------------------------------- 1 | import Foo hiding (bar4, foo2) 2 | import qualified Foo (bar3, foo1) 3 | -------------------------------------------------------------------------------- /data/examples/import/merging-2.hs: -------------------------------------------------------------------------------- 1 | import qualified Foo (foo1) 2 | import Foo hiding (foo2) 3 | import qualified Foo (bar3) 4 | import Foo hiding (bar4) 5 | -------------------------------------------------------------------------------- /data/examples/import/misc-out.hs: -------------------------------------------------------------------------------- 1 | import A hiding 2 | ( foobarbazqux, 3 | ) 4 | import {-# SOURCE #-} safe qualified Module as M hiding (a, b, c, d, e, f) 5 | import Name hiding () 6 | -------------------------------------------------------------------------------- /data/examples/import/nested-explicit-imports-out.hs: -------------------------------------------------------------------------------- 1 | import qualified MegaModule as M 2 | ( Either, 3 | Monad 4 | ( return, 5 | (>>), 6 | (>>=) 7 | ), 8 | (<<<), 9 | (>>>), 10 | ) 11 | -------------------------------------------------------------------------------- /data/examples/import/nested-explicit-imports.hs: -------------------------------------------------------------------------------- 1 | import qualified MegaModule as M ((>>>), Either, (<<<), Monad( 2 | return, (>>=), (>>))) 3 | -------------------------------------------------------------------------------- /data/examples/import/qualified-post-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ImportQualifiedPost #-} 2 | 3 | import Data.Text qualified (a, b, c) 4 | import Data.Text qualified hiding (a, b, c) 5 | import Data.Text qualified as T 6 | -------------------------------------------------------------------------------- /data/examples/import/qualified-post.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ImportQualifiedPost #-} 2 | 3 | import qualified Data.Text as T 4 | import qualified Data.Text (a, c, b) 5 | import Data.Text qualified hiding (c, b, a) 6 | -------------------------------------------------------------------------------- /data/examples/import/qualified-prelude-out.hs: -------------------------------------------------------------------------------- 1 | module P where 2 | 3 | import Prelude hiding (id, (.)) 4 | import qualified Prelude 5 | -------------------------------------------------------------------------------- /data/examples/import/qualified-prelude.hs: -------------------------------------------------------------------------------- 1 | module P where 2 | 3 | import Prelude hiding (id, (.)) 4 | import qualified Prelude 5 | -------------------------------------------------------------------------------- /data/examples/import/simple-out.hs: -------------------------------------------------------------------------------- 1 | import Data.Text 2 | import Data.Text (a, b, c) 3 | import Data.Text hiding (a, b, c) 4 | import qualified Data.Text (a, b, c) 5 | import qualified Data.Text as T 6 | -------------------------------------------------------------------------------- /data/examples/import/simple.hs: -------------------------------------------------------------------------------- 1 | import Data.Text 2 | import Data.Text 3 | import qualified Data.Text as T 4 | import qualified Data.Text (a, c, b) 5 | import Data.Text (a, b, c) 6 | import Data.Text hiding (c, b, a) 7 | import Data.Text (a, b, c, b, a) 8 | import Data.Text hiding (c, b, a, b, c) 9 | -------------------------------------------------------------------------------- /data/examples/import/sorted-export-list-out.hs: -------------------------------------------------------------------------------- 1 | import Linear.Vector (Additive (..), (*^), (^*)) 2 | -------------------------------------------------------------------------------- /data/examples/import/sorted-export-list.hs: -------------------------------------------------------------------------------- 1 | import Linear.Vector (Additive (..), (*^), (^*)) 2 | -------------------------------------------------------------------------------- /data/examples/import/sorted-out.hs: -------------------------------------------------------------------------------- 1 | import A 2 | import B 3 | import C 4 | -------------------------------------------------------------------------------- /data/examples/import/sorted-package-imports-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE PackageImports #-} 2 | 3 | import D 4 | import "a" Ab 5 | import "b" Aa 6 | import "b" Bb 7 | import "c" Ba 8 | import "zzzz" Z 9 | import "this" Y 10 | -------------------------------------------------------------------------------- /data/examples/import/sorted-package-imports.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE PackageImports #-} 2 | 3 | import "b" Aa 4 | import "a" Ab 5 | import "c" Ba 6 | import D 7 | import "b" Bb 8 | 9 | import "this" Y 10 | import "zzzz" Z 11 | -------------------------------------------------------------------------------- /data/examples/import/sorted.hs: -------------------------------------------------------------------------------- 1 | import B 2 | import A 3 | import C 4 | -------------------------------------------------------------------------------- /data/examples/module-header/double-shebangs-out.hs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env stack 2 | #!/usr/bin/env stack 3 | -------------------------------------------------------------------------------- /data/examples/module-header/double-shebangs.hs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env stack 2 | #!/usr/bin/env stack 3 | -------------------------------------------------------------------------------- /data/examples/module-header/empty-haddock-out.hs: -------------------------------------------------------------------------------- 1 | module Test where 2 | -------------------------------------------------------------------------------- /data/examples/module-header/empty-haddock.hs: -------------------------------------------------------------------------------- 1 | -- | 2 | -- 3 | module Test where 4 | -------------------------------------------------------------------------------- /data/examples/module-header/empty-out.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweag/ormolu/383313eead4a1a263ad7dcb5698a14ef58bb9b43/data/examples/module-header/empty-out.hs -------------------------------------------------------------------------------- /data/examples/module-header/empty.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweag/ormolu/383313eead4a1a263ad7dcb5698a14ef58bb9b43/data/examples/module-header/empty.hs -------------------------------------------------------------------------------- /data/examples/module-header/multiline-empty-comment-out.hs: -------------------------------------------------------------------------------- 1 | module Foo 2 | ( -- test 3 | ) 4 | where 5 | -------------------------------------------------------------------------------- /data/examples/module-header/multiline-empty-comment.hs: -------------------------------------------------------------------------------- 1 | module Foo ( -- test 2 | ) where 3 | -------------------------------------------------------------------------------- /data/examples/module-header/multiline-empty-out.hs: -------------------------------------------------------------------------------- 1 | module Foo 2 | ( 3 | ) 4 | where 5 | -------------------------------------------------------------------------------- /data/examples/module-header/multiline-empty.hs: -------------------------------------------------------------------------------- 1 | module Foo ( 2 | ) where 3 | -------------------------------------------------------------------------------- /data/examples/module-header/multiline-out.hs: -------------------------------------------------------------------------------- 1 | module Foo 2 | ( foo, 3 | bar, 4 | baz, 5 | ) 6 | where 7 | -------------------------------------------------------------------------------- /data/examples/module-header/multiline.hs: -------------------------------------------------------------------------------- 1 | module Foo ( 2 | foo, bar, baz) where 3 | -------------------------------------------------------------------------------- /data/examples/module-header/multiline2-out.hs: -------------------------------------------------------------------------------- 1 | module Foo 2 | ( foo, 3 | bar, 4 | baz, 5 | ) 6 | where 7 | -------------------------------------------------------------------------------- /data/examples/module-header/multiline2.hs: -------------------------------------------------------------------------------- 1 | module Foo ( 2 | foo, bar, baz) where 3 | -------------------------------------------------------------------------------- /data/examples/module-header/named-section-out.hs: -------------------------------------------------------------------------------- 1 | module Magic 2 | ( -- * Something 3 | -- $explanation 4 | 5 | -- ** Another level 6 | foo, 7 | bar, 8 | ) 9 | where 10 | 11 | -- $explanation 12 | -- 13 | -- Here it goes. 14 | -------------------------------------------------------------------------------- /data/examples/module-header/named-section.hs: -------------------------------------------------------------------------------- 1 | module Magic 2 | ( -- * Something 3 | -- $explanation 4 | 5 | -- ** Another level 6 | foo 7 | , bar 8 | ) 9 | where 10 | 11 | -- $explanation 12 | -- 13 | -- Here it goes. 14 | -------------------------------------------------------------------------------- /data/examples/module-header/preceding-comment-with-haddock-out.hs: -------------------------------------------------------------------------------- 1 | {- 2 | Here we go. 3 | -} 4 | 5 | -- | This is the module's Haddock. 6 | module Main (main) where 7 | 8 | main = return () 9 | -------------------------------------------------------------------------------- /data/examples/module-header/preceding-comment-with-haddock.hs: -------------------------------------------------------------------------------- 1 | {- 2 | Here we go. 3 | -} 4 | 5 | -- | This is the module's Haddock. 6 | module Main (main) where 7 | 8 | main = return () 9 | -------------------------------------------------------------------------------- /data/examples/module-header/shebang-out.hs: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env runhaskell 2 | 3 | import Prelude 4 | 5 | main :: IO () 6 | main = putStrLn "hello world" 7 | -------------------------------------------------------------------------------- /data/examples/module-header/shebang-with-pragmas-out.hs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env stack 2 | 3 | {-# LANGUAGE OverloadedStrings #-} 4 | 5 | main = pure () 6 | -------------------------------------------------------------------------------- /data/examples/module-header/shebang-with-pragmas.hs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env stack 2 | 3 | {-# LANGUAGE OverloadedStrings #-} 4 | 5 | main = pure () 6 | -------------------------------------------------------------------------------- /data/examples/module-header/shebang.hs: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env runhaskell 2 | 3 | import Prelude 4 | 5 | main :: IO () 6 | main = putStrLn "hello world" 7 | -------------------------------------------------------------------------------- /data/examples/module-header/simple-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | -------------------------------------------------------------------------------- /data/examples/module-header/simple-with-comments-out.hs: -------------------------------------------------------------------------------- 1 | -- | Here we go. 2 | module Main where 3 | 4 | -- Wow. 5 | -------------------------------------------------------------------------------- /data/examples/module-header/simple-with-comments.hs: -------------------------------------------------------------------------------- 1 | -- | Here we go. 2 | 3 | module Main where 4 | 5 | -- Wow. 6 | -------------------------------------------------------------------------------- /data/examples/module-header/simple.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | -------------------------------------------------------------------------------- /data/examples/module-header/singleline-empty-out.hs: -------------------------------------------------------------------------------- 1 | -- | This demonstrates a BUG. 2 | module Foo () where 3 | -------------------------------------------------------------------------------- /data/examples/module-header/singleline-empty.hs: -------------------------------------------------------------------------------- 1 | -- | This demonstrates a BUG. 2 | module Foo () where 3 | -------------------------------------------------------------------------------- /data/examples/module-header/singleline-out.hs: -------------------------------------------------------------------------------- 1 | module Foo (foo, bar, baz) where 2 | -------------------------------------------------------------------------------- /data/examples/module-header/singleline.hs: -------------------------------------------------------------------------------- 1 | module Foo ( foo, bar, baz ) where 2 | -------------------------------------------------------------------------------- /data/examples/module-header/stack-header-0-out.hs: -------------------------------------------------------------------------------- 1 | -- stack runhaskell 2 | 3 | {-# LANGUAGE OverloadedStrings #-} 4 | 5 | main = return () 6 | 7 | -- stack runhaskell 8 | -------------------------------------------------------------------------------- /data/examples/module-header/stack-header-0.hs: -------------------------------------------------------------------------------- 1 | -- stack runhaskell 2 | {-# LANGUAGE OverloadedStrings #-} 3 | main = return () 4 | -- stack runhaskell 5 | -------------------------------------------------------------------------------- /data/examples/module-header/stack-header-1-out.hs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env stack 2 | -- stack runhaskell 3 | 4 | {-# LANGUAGE OverloadedStrings #-} 5 | 6 | main = return () 7 | 8 | -- stack runhaskell 9 | -------------------------------------------------------------------------------- /data/examples/module-header/stack-header-1.hs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env stack 2 | -- stack runhaskell 3 | {-# LANGUAGE OverloadedStrings #-} 4 | main = return () 5 | -- stack runhaskell 6 | -------------------------------------------------------------------------------- /data/examples/module-header/stack-header-2-out.hs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env stack 2 | {- stack 3 | script 4 | --resolver lts-6.25 5 | --package turtle 6 | --package "stm async" 7 | --package http-client,http-conduit 8 | -} 9 | 10 | {-# LANGUAGE OverloadedStrings #-} 11 | 12 | main = return () 13 | -------------------------------------------------------------------------------- /data/examples/module-header/stack-header-2.hs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env stack 2 | {- stack 3 | script 4 | --resolver lts-6.25 5 | --package turtle 6 | --package "stm async" 7 | --package http-client,http-conduit 8 | -} 9 | 10 | {-# LANGUAGE OverloadedStrings #-} 11 | 12 | main = return () 13 | -------------------------------------------------------------------------------- /data/examples/module-header/warning-pragma-list-multiline-out.hs: -------------------------------------------------------------------------------- 1 | module Test 2 | {-# DEPRECATED 3 | [ "This module is deprecated.", 4 | "Please use OtherModule instead." 5 | ] 6 | #-} 7 | ( foo, 8 | bar, 9 | baz, 10 | ) 11 | where 12 | -------------------------------------------------------------------------------- /data/examples/module-header/warning-pragma-list-multiline.hs: -------------------------------------------------------------------------------- 1 | module Test {-# DEPRECATED ["This module is deprecated.", 2 | "Please use OtherModule instead." 3 | ]#-} 4 | ( foo 5 | , bar 6 | , baz 7 | ) 8 | where 9 | -------------------------------------------------------------------------------- /data/examples/module-header/warning-pragma-multiline-out.hs: -------------------------------------------------------------------------------- 1 | module Test 2 | {-# DEPRECATED "This module is unstable" #-} 3 | (foo, bar, baz) 4 | where 5 | 6 | import Blah 7 | -------------------------------------------------------------------------------- /data/examples/module-header/warning-pragma-multiline.hs: -------------------------------------------------------------------------------- 1 | module Test {-# DEPRECATED "This module is unstable" #-} 2 | (foo, bar, baz) where 3 | 4 | import Blah 5 | -------------------------------------------------------------------------------- /data/examples/module-header/warning-pragma-out.hs: -------------------------------------------------------------------------------- 1 | module Test 2 | {-# WARNING 3 | "This module is very internal" 4 | #-} 5 | where 6 | -------------------------------------------------------------------------------- /data/examples/module-header/warning-pragma-singleton-list-out.hs: -------------------------------------------------------------------------------- 1 | module Test {-# WARNING "There's only one line here." #-} where 2 | -------------------------------------------------------------------------------- /data/examples/module-header/warning-pragma-singleton-list.hs: -------------------------------------------------------------------------------- 1 | module Test {-# WArnING ["There's only one line here."] #-} where 2 | -------------------------------------------------------------------------------- /data/examples/module-header/warning-pragma.hs: -------------------------------------------------------------------------------- 1 | module Test {-# WARNING "This module is very internal" 2 | #-} where 3 | -------------------------------------------------------------------------------- /data/examples/other/argument-comment-out.hs: -------------------------------------------------------------------------------- 1 | foo :: 2 | -- | Documentation 3 | Int -> 4 | Bool 5 | foo _ = True 6 | 7 | foo :: 8 | (Foo a) => 9 | -- | Foo 10 | Int -> 11 | Int 12 | foo :: 13 | (Foo a) => 14 | -- | Foo 15 | Int -> 16 | Int 17 | -------------------------------------------------------------------------------- /data/examples/other/argument-comment.hs: -------------------------------------------------------------------------------- 1 | foo 2 | :: Int -- ^ Documentation 3 | -> Bool 4 | foo _ = True 5 | 6 | foo :: Foo a 7 | => Int -- ^ Foo 8 | -> Int 9 | 10 | foo 11 | :: Foo a 12 | => Int -- ^ Foo 13 | -> Int 14 | -------------------------------------------------------------------------------- /data/examples/other/comment-after-preceding-haddock-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | A 4 | 5 | -- B 6 | 7 | type D = E 8 | 9 | -- | This is 'f' 10 | 11 | -- * Comment 12 | f :: a -> b 13 | -------------------------------------------------------------------------------- /data/examples/other/comment-after-preceding-haddock.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | A 4 | 5 | -- B 6 | 7 | type D = E 8 | 9 | -- | This is 'f' 10 | 11 | -- * Comment 12 | f :: a -> b 13 | -------------------------------------------------------------------------------- /data/examples/other/comment-alignment-out.hs: -------------------------------------------------------------------------------- 1 | class Foo a where 2 | -- | Foo. 3 | foo :: 4 | Int -> 5 | -- | Something 6 | a 7 | 8 | -- | Bar. 9 | bar :: a 10 | -------------------------------------------------------------------------------- /data/examples/other/comment-alignment.hs: -------------------------------------------------------------------------------- 1 | class Foo a where 2 | 3 | -- | Foo. 4 | 5 | foo 6 | :: Int 7 | -> a -- ^ Something 8 | 9 | -- | Bar. 10 | 11 | bar :: a 12 | -------------------------------------------------------------------------------- /data/examples/other/comment-before-hanging-out.hs: -------------------------------------------------------------------------------- 1 | x = Just 2 | -- comment 3 | do 4 | foo 5 | bar 6 | -------------------------------------------------------------------------------- /data/examples/other/comment-before-hanging.hs: -------------------------------------------------------------------------------- 1 | x = Just 2 | -- comment 3 | do 4 | foo 5 | bar 6 | -------------------------------------------------------------------------------- /data/examples/other/comment-empty-let-out.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | let 3 | in 10 4 | 5 | -- a comment 6 | bar = 20 7 | -------------------------------------------------------------------------------- /data/examples/other/comment-empty-let.hs: -------------------------------------------------------------------------------- 1 | foo = 2 | let 3 | in 10 4 | 5 | -- a comment 6 | bar = 20 7 | -------------------------------------------------------------------------------- /data/examples/other/comment-following-preceding-gap-out.hs: -------------------------------------------------------------------------------- 1 | foo = bar 2 | where 3 | baz = return (quux) -- Foo 4 | 5 | -- Bar 6 | meme = gege 7 | -------------------------------------------------------------------------------- /data/examples/other/comment-following-preceding-gap.hs: -------------------------------------------------------------------------------- 1 | foo = bar 2 | where 3 | baz = return (quux) -- Foo 4 | 5 | -- Bar 6 | meme = gege 7 | -------------------------------------------------------------------------------- /data/examples/other/comment-glued-together-out.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | -- | Foo. 4 | 5 | -- Bar 6 | main :: IO () 7 | main = return () 8 | -------------------------------------------------------------------------------- /data/examples/other/comment-glued-together.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | {- | Foo. -} 4 | -- Bar 5 | main :: IO () 6 | main = return () 7 | -------------------------------------------------------------------------------- /data/examples/other/comment-inside-construct-out.hs: -------------------------------------------------------------------------------- 1 | xs = 2 | [ outer list item, 3 | [ inner list first item, 4 | inner list second item 5 | -- inner list last item commented 6 | ], 7 | outer list item 8 | ] 9 | -------------------------------------------------------------------------------- /data/examples/other/comment-inside-construct.hs: -------------------------------------------------------------------------------- 1 | xs = 2 | [ outer list item, 3 | [ inner list first item, 4 | inner list second item 5 | -- inner list last item commented 6 | ], 7 | outer list item 8 | ] 9 | 10 | -------------------------------------------------------------------------------- /data/examples/other/comment-multiline-after-out.hs: -------------------------------------------------------------------------------- 1 | foo :: 2 | -- | start index 3 | Int -> 4 | -- | length 5 | Int -> 6 | t a -> 7 | t a 8 | -------------------------------------------------------------------------------- /data/examples/other/comment-multiline-after.hs: -------------------------------------------------------------------------------- 1 | foo :: Int {- ^ start index -} -> Int {- ^ length -} -> t a -> t a 2 | -------------------------------------------------------------------------------- /data/examples/other/comment-spacing-out.hs: -------------------------------------------------------------------------------- 1 | -- | Something. 2 | foo :: 3 | -- | Foo. 4 | Int -> 5 | -- | Bar. 6 | IO () 7 | foo _ = pure () -- comment 8 | -------------------------------------------------------------------------------- /data/examples/other/comment-spacing.hs: -------------------------------------------------------------------------------- 1 | -- |Something. 2 | foo :: 3 | -- |Foo. 4 | Int -> 5 | -- |Bar. 6 | IO () 7 | foo _ = pure () --comment 8 | -------------------------------------------------------------------------------- /data/examples/other/comment-trailing-space-out.hs: -------------------------------------------------------------------------------- 1 | data T 2 | = {- 3 | 4 | some multi-line comment 5 | 6 | with empty lines 7 | 8 | -} 9 | A 10 | -------------------------------------------------------------------------------- /data/examples/other/comment-trailing-space.hs: -------------------------------------------------------------------------------- 1 | data T 2 | = {- 3 | 4 | some multi-line comment 5 | 6 | with empty lines 7 | 8 | -} 9 | A 10 | -------------------------------------------------------------------------------- /data/examples/other/comment-two-blocks-out.hs: -------------------------------------------------------------------------------- 1 | newNames :: [(String, String)] 2 | newNames = 3 | let (*) = flip (,) 4 | in [ "Control" * "Monad" 5 | -- Foo 6 | 7 | -- Bar 8 | ] 9 | -------------------------------------------------------------------------------- /data/examples/other/comment-two-blocks.hs: -------------------------------------------------------------------------------- 1 | newNames :: [(String, String)] 2 | newNames = let (*) = flip (,) in 3 | ["Control" * "Monad" 4 | 5 | -- Foo 6 | 7 | -- Bar 8 | 9 | ] 10 | -------------------------------------------------------------------------------- /data/examples/other/consequetive-pipe-comments-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Foo. 4 | 5 | -- | Bar. 6 | bar :: Int 7 | bar = 5 8 | -------------------------------------------------------------------------------- /data/examples/other/consequetive-pipe-comments.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Foo. 4 | 5 | -- | Bar. 6 | 7 | bar :: Int 8 | bar = 5 9 | -------------------------------------------------------------------------------- /data/examples/other/cpp/continuation-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE CPP #-} 2 | 3 | foo :: Int 4 | foo = 5 5 | 6 | #define message_for(a, b) \ 7 | printf(#a " and " #b ": We love you!\n") 8 | 9 | bar :: Int 10 | bar = 6 11 | -------------------------------------------------------------------------------- /data/examples/other/cpp/continuation.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE CPP #-} 2 | 3 | foo :: Int 4 | foo = 5 5 | 6 | #define message_for(a, b) \ 7 | printf(#a " and " #b ": We love you!\n") 8 | 9 | bar :: Int 10 | bar = 6 11 | -------------------------------------------------------------------------------- /data/examples/other/cpp/cpp-and-imports-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE CPP #-} 2 | 3 | module Bug where 4 | 5 | #ifdef flag 6 | constant :: Int 7 | constant = 1312 8 | #endif 9 | -------------------------------------------------------------------------------- /data/examples/other/cpp/cpp-and-imports.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE CPP #-} 2 | 3 | module Bug where 4 | 5 | #ifdef flag 6 | constant :: Int 7 | constant = 1312 8 | #endif 9 | -------------------------------------------------------------------------------- /data/examples/other/cpp/separation-0a-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE CPP #-} 2 | 3 | instance (Stream s) => Monad (ParsecT e s m) where 4 | return = pure 5 | (>>=) = pBind 6 | #if !(MIN_VERSION_base(4,13,0)) 7 | fail = Fail.fail 8 | #endif 9 | -------------------------------------------------------------------------------- /data/examples/other/cpp/separation-0a.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE CPP #-} 2 | 3 | instance Stream s => Monad (ParsecT e s m) where 4 | return = pure 5 | (>>=) = pBind 6 | #if !(MIN_VERSION_base(4,13,0)) 7 | fail = Fail.fail 8 | #endif 9 | -------------------------------------------------------------------------------- /data/examples/other/cpp/separation-0b-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE CPP #-} 2 | 3 | instance (Stream s) => Monad (ParsecT e s m) where 4 | return = pure 5 | (>>=) = pBind 6 | #if !(MIN_VERSION_base(4,13,0)) 7 | fail = Fail.fail 8 | #endif 9 | 10 | foo :: Int 11 | foo = undefined 12 | -------------------------------------------------------------------------------- /data/examples/other/cpp/separation-0b.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE CPP #-} 2 | 3 | instance Stream s => Monad (ParsecT e s m) where 4 | return = pure 5 | (>>=) = pBind 6 | #if !(MIN_VERSION_base(4,13,0)) 7 | fail = Fail.fail 8 | #endif 9 | 10 | foo :: Int 11 | foo = undefined 12 | -------------------------------------------------------------------------------- /data/examples/other/cpp/separation-2a-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE CPP #-} 2 | 3 | ffff, ffffffff :: Natural 4 | #ifdef HASKELL_ZIP_DEV_MODE 5 | ffff = 200 6 | ffffffff = 5000 7 | #else 8 | ffff = 0xffff 9 | ffffffff = 0xffffffff 10 | #endif 11 | -------------------------------------------------------------------------------- /data/examples/other/cpp/separation-2a.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE CPP #-} 2 | 3 | ffff, ffffffff :: Natural 4 | #ifdef HASKELL_ZIP_DEV_MODE 5 | ffff = 200 6 | ffffffff = 5000 7 | #else 8 | ffff = 0xffff 9 | ffffffff = 0xffffffff 10 | #endif 11 | -------------------------------------------------------------------------------- /data/examples/other/cpp/separation-2b-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE CPP #-} 2 | 3 | ffff, ffffffff :: Natural 4 | #ifdef HASKELL_ZIP_DEV_MODE 5 | ffff = 200 6 | ffffffff = 5000 7 | #else 8 | ffff = 0xffff 9 | ffffffff = 0xffffffff 10 | #endif 11 | 12 | foo :: Int 13 | foo = undefined 14 | -------------------------------------------------------------------------------- /data/examples/other/cpp/separation-2b.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE CPP #-} 2 | 3 | ffff, ffffffff :: Natural 4 | #ifdef HASKELL_ZIP_DEV_MODE 5 | ffff = 200 6 | ffffffff = 5000 7 | #else 8 | ffff = 0xffff 9 | ffffffff = 0xffffffff 10 | #endif 11 | 12 | foo :: Int 13 | foo = undefined 14 | -------------------------------------------------------------------------------- /data/examples/other/disabling/closing-comment-in-disabled-region-out.hs: -------------------------------------------------------------------------------- 1 | {- ORMOLU_DISABLE -} 2 | a::String 3 | a="-}" 4 | -------------------------------------------------------------------------------- /data/examples/other/disabling/closing-comment-in-disabled-region.hs: -------------------------------------------------------------------------------- 1 | {- ORMOLU_DISABLE -} 2 | a::String 3 | a="-}" 4 | -------------------------------------------------------------------------------- /data/examples/other/disabling/empty-disabled-region-out.hs: -------------------------------------------------------------------------------- 1 | {- ORMOLU_DISABLE -} 2 | {- ORMOLU_ENABLE -} 3 | foo = 0 4 | {- ORMOLU_DISABLE -} 5 | {- ORMOLU_ENABLE -} 6 | bar = 1 7 | {- ORMOLU_DISABLE -} 8 | -------------------------------------------------------------------------------- /data/examples/other/disabling/empty-disabled-region.hs: -------------------------------------------------------------------------------- 1 | {- ORMOLU_DISABLE -} 2 | {- ORMOLU_ENABLE -} 3 | foo = 0 4 | {- ORMOLU_DISABLE -} 5 | {- ORMOLU_ENABLE -} 6 | bar = 1 7 | {- ORMOLU_DISABLE -} 8 | -------------------------------------------------------------------------------- /data/examples/other/disabling/line-pragma-in-disabled-region-out.hs: -------------------------------------------------------------------------------- 1 | module Foo (foo) where 2 | 3 | {- ORMOLU_DISABLE -} 4 | foo= 5 | {-# LINE 11 "Abc.hs" #-} 6 | this . line $ ((is automatically generated) Haskell<>code) 7 | {- ORMOLU_ENABLE -} 8 | -------------------------------------------------------------------------------- /data/examples/other/disabling/line-pragma-in-disabled-region.hs: -------------------------------------------------------------------------------- 1 | module Foo(foo) where 2 | 3 | {- ORMOLU_DISABLE -} 4 | foo= 5 | {-# LINE 11 "Abc.hs" #-} 6 | this . line $ ((is automatically generated) Haskell<>code) 7 | {- ORMOLU_ENABLE -} 8 | -------------------------------------------------------------------------------- /data/examples/other/disabling/normalize-magic-comments-out.hs: -------------------------------------------------------------------------------- 1 | {- ORMOLU_DISABLE -} 2 | {- ORMOLU_DISABLE -} 3 | foo=bar 4 | {- ORMOLU_ENABLE -} 5 | {-ORMOLU_ENABLE -} 6 | bar = baz 7 | {- ORMOLU_DISABLE -} 8 | baz=foo 9 | -------------------------------------------------------------------------------- /data/examples/other/disabling/normalize-magic-comments.hs: -------------------------------------------------------------------------------- 1 | {-ORMOLU_DISABLE -} 2 | {- ORMOLU_DISABLE -} 3 | foo=bar 4 | {- ORMOLU_ENABLE-} 5 | {-ORMOLU_ENABLE -} 6 | bar=baz 7 | {- ORMOLU_DISABLE-} 8 | baz=foo 9 | -------------------------------------------------------------------------------- /data/examples/other/disabling/preserve-empty-lines-out.hs: -------------------------------------------------------------------------------- 1 | {- ORMOLU_DISABLE -} 2 | bar :: Int 3 | bar = 2 4 | 5 | 6 | baz :: Int 7 | baz = 3 8 | {- ORMOLU_ENABLE -} 9 | 10 | foo :: Int 11 | foo = 1 12 | -------------------------------------------------------------------------------- /data/examples/other/disabling/preserve-empty-lines.hs: -------------------------------------------------------------------------------- 1 | {- ORMOLU_DISABLE -} 2 | bar :: Int 3 | bar = 2 4 | 5 | 6 | baz :: Int 7 | baz = 3 8 | {- ORMOLU_ENABLE -} 9 | 10 | 11 | foo :: Int 12 | foo = 1 13 | -------------------------------------------------------------------------------- /data/examples/other/disabling/preserve-trailing-whitespace-out.hs: -------------------------------------------------------------------------------- 1 | foo = 2 2 | 3 | {- ORMOLU_DISABLE -} 4 | bar = 3 5 | {- ORMOLU_ENABLE -} 6 | -------------------------------------------------------------------------------- /data/examples/other/disabling/preserve-trailing-whitespace.hs: -------------------------------------------------------------------------------- 1 | foo = 2 2 | 3 | {- ORMOLU_DISABLE -} 4 | bar = 3 5 | {- ORMOLU_ENABLE -} 6 | -------------------------------------------------------------------------------- /data/examples/other/disabling/single-definition-out.hs: -------------------------------------------------------------------------------- 1 | module Foo (foo, bar) where 2 | 3 | {- ORMOLU_DISABLE -} 4 | foo :: Int -> Int 5 | foo = (+5) 6 | {- ORMOLU_ENABLE -} 7 | 8 | bar :: Bool -> Bool 9 | bar True = True 10 | bar False = True 11 | -------------------------------------------------------------------------------- /data/examples/other/disabling/single-definition.hs: -------------------------------------------------------------------------------- 1 | module Foo (foo,bar) where 2 | 3 | {- ORMOLU_DISABLE -} 4 | foo :: Int -> Int 5 | foo = (+5) 6 | {- ORMOLU_ENABLE -} 7 | 8 | bar :: Bool -> Bool 9 | bar True = True 10 | bar False = True 11 | -------------------------------------------------------------------------------- /data/examples/other/disabling/suffix-comment-out.hs: -------------------------------------------------------------------------------- 1 | {- ORMOLU_DISABLE -} -- foo 2 | -------------------------------------------------------------------------------- /data/examples/other/disabling/suffix-comment.hs: -------------------------------------------------------------------------------- 1 | {- ORMOLU_DISABLE -} -- foo 2 | -------------------------------------------------------------------------------- /data/examples/other/disabling/whole-file-out.hs: -------------------------------------------------------------------------------- 1 | {- ORMOLU_DISABLE -} 2 | 3 | module Foo (foo,bar) where 4 | 5 | foo :: Int -> Int 6 | foo = (+5) 7 | 8 | bar :: Bool -> Bool 9 | bar True = True 10 | bar False = True 11 | -------------------------------------------------------------------------------- /data/examples/other/disabling/whole-file.hs: -------------------------------------------------------------------------------- 1 | {- ORMOLU_DISABLE -} 2 | 3 | module Foo (foo,bar) where 4 | 5 | foo :: Int -> Int 6 | foo = (+5) 7 | 8 | bar :: Bool -> Bool 9 | bar True = True 10 | bar False = True 11 | -------------------------------------------------------------------------------- /data/examples/other/empty-haddock-out.hs: -------------------------------------------------------------------------------- 1 | module Test 2 | ( test, 3 | ) 4 | where 5 | 6 | test :: 7 | test 8 | 9 | data T = T 10 | -------------------------------------------------------------------------------- /data/examples/other/empty-haddock.hs: -------------------------------------------------------------------------------- 1 | -- | 2 | module Test 3 | ( -- | 4 | test, 5 | ) 6 | where 7 | 8 | -- | 9 | test :: 10 | -- | 11 | test 12 | 13 | data T = T {- ^ -} 14 | -------------------------------------------------------------------------------- /data/examples/other/following-comment-last-0-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Another datatype... 4 | data D' 5 | -- ^ ...with two docstrings. 6 | -------------------------------------------------------------------------------- /data/examples/other/following-comment-last-0.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Another datatype... 4 | data D' 5 | -- ^ ...with two docstrings. 6 | -------------------------------------------------------------------------------- /data/examples/other/following-comment-last-1-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Another datatype... 4 | data D' 5 | deriving (Show) 6 | -- ^ ...with two docstrings. 7 | 8 | -- more 9 | -------------------------------------------------------------------------------- /data/examples/other/following-comment-last-1.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Another datatype... 4 | data D' 5 | deriving (Show) 6 | -- ^ ...with two docstrings. 7 | 8 | -- more 9 | -------------------------------------------------------------------------------- /data/examples/other/following-comment-last-2-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Another datatype... 4 | data D' 5 | deriving (Show) 6 | -- ^ ...with two docstrings. 7 | 8 | -- more 9 | 10 | data B 11 | -------------------------------------------------------------------------------- /data/examples/other/following-comment-last-2.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Another datatype... 4 | data D' 5 | deriving (Show) 6 | -- ^ ...with two docstrings. 7 | 8 | -- more 9 | 10 | data B 11 | -------------------------------------------------------------------------------- /data/examples/other/following-comment-last-3-out.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Another datatype... 4 | data D' 5 | -- ^ ...with two docstrings. 6 | -- even on second line 7 | -------------------------------------------------------------------------------- /data/examples/other/following-comment-last-3.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | -- | Another datatype... 4 | data D' 5 | -- ^ ...with two docstrings. 6 | -- even on second line 7 | -------------------------------------------------------------------------------- /data/examples/other/haddock-sections-out.hs: -------------------------------------------------------------------------------- 1 | -- $weird #anchor# 2 | -- 3 | -- Section 1 4 | 5 | -- $normal 6 | -- 7 | -- Section 2 8 | -------------------------------------------------------------------------------- /data/examples/other/haddock-sections.hs: -------------------------------------------------------------------------------- 1 | -- $weird #anchor# 2 | -- 3 | -- Section 1 4 | 5 | -- $normal 6 | -- 7 | -- Section 2 8 | -------------------------------------------------------------------------------- /data/examples/other/haddock-without-module-header-out.hs: -------------------------------------------------------------------------------- 1 | -- | Foo 2 | main = main 3 | 4 | -- | Bar 5 | data Bar 6 | -------------------------------------------------------------------------------- /data/examples/other/haddock-without-module-header.hs: -------------------------------------------------------------------------------- 1 | -- | Foo 2 | main = main 3 | 4 | -- | Bar 5 | data Bar 6 | -------------------------------------------------------------------------------- /data/examples/other/inline-comment-0-out.hs: -------------------------------------------------------------------------------- 1 | x = ({-a-} b, c) 2 | 3 | y = ({-a-} b) 4 | -------------------------------------------------------------------------------- /data/examples/other/inline-comment-0.hs: -------------------------------------------------------------------------------- 1 | x = ({-a-}b, c) 2 | 3 | y = ({-a-}b) 4 | -------------------------------------------------------------------------------- /data/examples/other/invalid-haddock-1-out.hs: -------------------------------------------------------------------------------- 1 | test = undefined 2 | where 3 | a :: 4 | -- \** foo 5 | Int -> 6 | -- \| misplaced 7 | -- blablabla 8 | Int 9 | -- \|misplaced 10 | -- blablabla 11 | a = undefined 12 | -------------------------------------------------------------------------------- /data/examples/other/invalid-haddock-1.hs: -------------------------------------------------------------------------------- 1 | test = undefined 2 | where 3 | a :: 4 | -- ** foo 5 | Int -> 6 | -- | misplaced 7 | -- blablabla 8 | Int 9 | -- |misplaced 10 | -- blablabla 11 | a = undefined 12 | -------------------------------------------------------------------------------- /data/examples/other/invalid-haddock-2-out.hs: -------------------------------------------------------------------------------- 1 | test = undefined 2 | where 3 | -- \| Comment 4 | -- 2nd invalid line 5 | a = undefined 6 | 7 | -- \| A multiline 8 | -- \| comment 9 | b = b 10 | -------------------------------------------------------------------------------- /data/examples/other/invalid-haddock-2.hs: -------------------------------------------------------------------------------- 1 | test = undefined 2 | where 3 | -- | Comment 4 | -- 2nd invalid line 5 | a = undefined 6 | 7 | -- | A multiline 8 | -- | comment 9 | b = b 10 | -------------------------------------------------------------------------------- /data/examples/other/invalid-haddock-double-trigger-out.hs: -------------------------------------------------------------------------------- 1 | test = 2 | foo 3 | -- \|| Invalid haddock, with double trigger 4 | -- \|| second line 5 | + bar 6 | -- \||Invalid haddock 2, with double trigger 7 | -- \||second line 8 | + baz 9 | -------------------------------------------------------------------------------- /data/examples/other/invalid-haddock-double-trigger.hs: -------------------------------------------------------------------------------- 1 | test = foo 2 | -- || Invalid haddock, with double trigger 3 | -- || second line 4 | + bar 5 | -- ||Invalid haddock 2, with double trigger 6 | -- ||second line 7 | + baz 8 | -------------------------------------------------------------------------------- /data/examples/other/invalid-haddock-weird-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | 3 | foo = foo 4 | 5 | -- \|# ${ 6 | -------------------------------------------------------------------------------- /data/examples/other/invalid-haddock-weird.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | 3 | foo = foo -- |# ${ 4 | -------------------------------------------------------------------------------- /data/examples/other/jsffi-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE JavaScriptFFI #-} 2 | -------------------------------------------------------------------------------- /data/examples/other/jsffi.hs: -------------------------------------------------------------------------------- 1 | {-# language JavaScriptFFI #-} 2 | -------------------------------------------------------------------------------- /data/examples/other/multiline-comments-reindent-out.hs: -------------------------------------------------------------------------------- 1 | {- 2 | And so here we have a 3 | multiline comment. 4 | 5 | Indeed. 6 | -} 7 | -------------------------------------------------------------------------------- /data/examples/other/multiline-comments-reindent.hs: -------------------------------------------------------------------------------- 1 | {- 2 | And so here we have a 3 | multiline comment. 4 | 5 | Indeed. 6 | -} 7 | -------------------------------------------------------------------------------- /data/examples/other/multiple-blank-line-comment-out.hs: -------------------------------------------------------------------------------- 1 | module A where 2 | 3 | a = 4 | b 5 | [ f 6 | {-, 7 | 8 | -} 9 | ] 10 | -------------------------------------------------------------------------------- /data/examples/other/multiple-blank-line-comment.hs: -------------------------------------------------------------------------------- 1 | module A where 2 | 3 | a = 4 | b 5 | [ f 6 | {-, 7 | 8 | 9 | -} 10 | ] 11 | -------------------------------------------------------------------------------- /data/examples/other/necessary-brackets-out.hs: -------------------------------------------------------------------------------- 1 | insertEmDash = Text.concat . map \case { x | x == "--" -> "—"; x -> x } . Text.groupBy ((==) `on` Char.isSpace) 2 | 3 | foo f a b c = f do { a } + f do { b } + f do c 4 | -------------------------------------------------------------------------------- /data/examples/other/necessary-brackets.hs: -------------------------------------------------------------------------------- 1 | insertEmDash = Text.concat . map \case{ x | x == "--" -> "—"; x -> x } . Text.groupBy ((==) `on` Char.isSpace) 2 | 3 | foo f a b c = f do {a} + f do {b} + f do {c} 4 | -------------------------------------------------------------------------------- /data/examples/other/overly-indented-out.hs: -------------------------------------------------------------------------------- 1 | tagCloudField :: 2 | -- | Destination key 3 | String -> 4 | -- | Smallest font size, in percent 5 | Double -> 6 | -- | Biggest font size, in percent 7 | Double -> 8 | -- | Input tags 9 | Tags -> 10 | -- | Context 11 | Context a 12 | -------------------------------------------------------------------------------- /data/examples/other/pragma-comments-after-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE AllowAmbiguousTypes #-} 2 | {-# LANGUAGE ConstraintKinds #-} 3 | -- TODO: Fix and delete this pragma 4 | {-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} 5 | -------------------------------------------------------------------------------- /data/examples/other/pragma-comments-after.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} -- TODO: Fix and delete this pragma 2 | {-# LANGUAGE AllowAmbiguousTypes #-} 3 | {-# LANGUAGE ConstraintKinds #-} 4 | -------------------------------------------------------------------------------- /data/examples/other/pragma-no-header-out.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DataKinds #-} 2 | {-# LANGUAGE LambdaCase #-} 3 | {-# LANGUAGE ViewPatterns #-} 4 | -------------------------------------------------------------------------------- /data/examples/other/pragma-no-header.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE LambdaCase #-} 2 | {-# LANGuagE ViewPatterns #-} 3 | {-# language DataKinds, LambdaCase #-} 4 | -------------------------------------------------------------------------------- /data/examples/other/trailing-whitespace-out.hs: -------------------------------------------------------------------------------- 1 | -- Here is a comment with trailing whitespace. 2 | foo = 5 3 | 4 | {- Block comment with trailing whitespace. 5 | Bo. 6 | -} 7 | bar = 6 8 | -------------------------------------------------------------------------------- /data/examples/other/trailing-whitespace.hs: -------------------------------------------------------------------------------- 1 | -- Here is a comment with trailing whitespace. 2 | foo = 5 3 | 4 | {- Block comment with trailing whitespace. 5 | Bo. 6 | -} 7 | bar = 6 8 | -------------------------------------------------------------------------------- /data/parse-failures/disabling-preserves-error-location.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | {- ORMOLU_DISABLE -} 4 | foo Int 5 | foo Int 6 | foo 5 EU>>>> 7 | 8 | {- ORMOLU_ENABLE -} 9 | 10 | main :: IO () 11 | main = return <<< -------------------------------------------------------------------------------- /data/parse-failures/line-pragma.hs: -------------------------------------------------------------------------------- 1 | module Foo (foo,bar,baz) where 2 | bar = foo 3 | {-# LINE 113 "Abc.hs" #-} 4 | foo = (some <$> ( automatically $ generated ))))))))) invalid Haskell code 5 | baz = bar 6 | -------------------------------------------------------------------------------- /expected-failures/esqueleto.txt: -------------------------------------------------------------------------------- 1 | src/Database/Esqueleto/Internal/Internal.hs:(433,5)-(434,0) 2 | The GHC parser (in Haddock mode) failed: 3 | [GHC-21231] lexical error at character 's' 4 | -------------------------------------------------------------------------------- /expected-failures/leksah.txt: -------------------------------------------------------------------------------- 1 | src/IDE/Find.hs:615:36-46 2 | The GHC parser (in Haddock mode) failed: 3 | [GHC-95644] Bang pattern in expression context: !matchIndex 4 | Did you mean to add a space after the '!'? 5 | -------------------------------------------------------------------------------- /expected-failures/lens.txt: -------------------------------------------------------------------------------- 1 | tests/properties.hs:117:26-28 2 | The GHC parser (in Haddock mode) failed: 3 | [GHC-58481] parse error on input `KVS' 4 | -------------------------------------------------------------------------------- /extract-hackage-info/hackage-info.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tweag/ormolu/383313eead4a1a263ad7dcb5698a14ef58bb9b43/extract-hackage-info/hackage-info.bin -------------------------------------------------------------------------------- /fixity-tests/.ormolu: -------------------------------------------------------------------------------- 1 | infixr 8 .= 2 | infixr 5 #, :> 3 | module Foo exports Control.Lens 4 | -------------------------------------------------------------------------------- /fixity-tests/dummy.cabal: -------------------------------------------------------------------------------- 1 | cabal-version: 2.4 2 | name: dummy 3 | version: 0.0.0.0 4 | license: BSD-3-Clause 5 | -------------------------------------------------------------------------------- /fixity-tests/test-1-input.hs: -------------------------------------------------------------------------------- 1 | lenses = Just $ M.fromList 2 | $ "type" .= ("user.connection" :: Text) 3 | # "connection" .= uc 4 | # "user" .= case name of 5 | Just n -> Just $ object ["name" .= n] 6 | Nothing -> Nothing 7 | # [] 8 | -------------------------------------------------------------------------------- /nix/format.sh: -------------------------------------------------------------------------------- 1 | # Format Ormolu using current version of Ormolu. 2 | 3 | export LANG="C.UTF-8" 4 | 5 | export dirs="src app tests extract-hackage-info/src ormolu-live/app" 6 | # shellcheck disable=SC2046,SC2086 7 | ormolu -m inplace $(find $dirs -type f -name "*.hs" -o -name "*.hs-boot") 8 | -------------------------------------------------------------------------------- /ormolu-live/.envrc: -------------------------------------------------------------------------------- 1 | use flake ..#ormoluLive 2 | -------------------------------------------------------------------------------- /ormolu-live/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | www/ghc_wasm_jsffi.js 3 | www/jsaddle.js 4 | .commitrev 5 | -------------------------------------------------------------------------------- /ormolu-live/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ormolu-live", 3 | "version": "0.0.0", 4 | "dependencies": { 5 | "@bjorn3/browser_wasi_shim": "^0.3.0", 6 | "ace-builds": "^1.36.3", 7 | "bulma": "^1.0.2" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ormolu-live/www/index.js: -------------------------------------------------------------------------------- 1 | require("ace-builds/src/ace.js"); 2 | require("ace-builds/src/mode-haskell.js"); 3 | require("ace-builds/src/theme-github_light_default.js"); 4 | require("ace-builds/src/theme-github_dark.js"); 5 | 6 | runJSaddle(new Worker("worker.js", { type: "module" })); 7 | -------------------------------------------------------------------------------- /src/Ormolu/Terminal/QualifiedDo.hs: -------------------------------------------------------------------------------- 1 | module Ormolu.Terminal.QualifiedDo ((>>)) where 2 | 3 | import Ormolu.Terminal 4 | import Prelude hiding ((>>)) 5 | 6 | (>>) :: Term -> Term -> Term 7 | (>>) = (<>) 8 | -------------------------------------------------------------------------------- /tests/Spec.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -F -pgmF hspec-discover #-} 2 | -------------------------------------------------------------------------------- /weeder.toml: -------------------------------------------------------------------------------- 1 | roots = [ 2 | "^Main.main$", 3 | "^Paths_", 4 | "^Ormolu.Terminal.QualifiedDo.>>$" # https://github.com/ocharles/weeder/issues/112 5 | ] 6 | type-class-roots = true 7 | --------------------------------------------------------------------------------