ParallelListComp leads to syntactically invalid result #372

Open
opened 2022-05-31 10:12:18 +02:00 by StefanFehrenbach · 0 comments
StefanFehrenbach commented 2022-05-31 10:12:18 +02:00 (Migrated from github.com)

This Haskell file compiles just fine with ghc 8.10.

{-# LANGUAGE ParallelListComp #-}

         main = undefined
         b = undefined
         c = undefined
         d = undefined
         e = undefined

         a      =  [ b
                            |  c
                            | d <- e
                           ]
        

But running brittany 0.13.1.1 on it causes it to print an error: ERROR: brittany pretty printer returned syntactically invalid result.
Running with --output-on-errors produces this output

{-# LANGUAGE ParallelListComp #-}

main = undefined
b = undefined
c = undefined
d = undefined
e = undefined

a = [ b | c d <- e ]


brittany.yaml
conf_debug:
  dconf_roundtrip_exactprint_only: false
  dconf_dump_bridoc_simpl_par: false
  dconf_dump_ast_unknown: false
  dconf_dump_bridoc_simpl_floating: false
  dconf_dump_config: false
  dconf_dump_bridoc_raw: false
  dconf_dump_bridoc_final: false
  dconf_dump_bridoc_simpl_alt: false
  dconf_dump_bridoc_simpl_indent: false
  dconf_dump_annotations: false
  dconf_dump_bridoc_simpl_columns: false
  dconf_dump_ast_full: false
conf_forward:
  options_ghc:
  - -XBangPatterns
  - -XBlockArguments
  - -XExplicitForAll
  - -XExplicitNamespaces
  - -XGADTs
  - -XImplicitParams
  - -XLambdaCase
  - -XMultiWayIf
  - -XNumericUnderscores
  - -XParallelListComp
  - -XPatternGuards
  - -XQuasiQuotes
  - -XRecursiveDo
  - -XTemplateHaskell
  - -XTupleSections
  - -XTypeApplications
  - -XViewPatterns
conf_errorHandling:
  econf_ExactPrintFallback: ExactPrintFallbackModeInline
  econf_Werror: false
  econf_omit_output_valid_check: false
  econf_produceOutputOnErrors: false
conf_preprocessor:
  ppconf_CPPMode: CPPModeAbort
  ppconf_hackAroundIncludes: false
conf_version: 1
conf_layout:
  lconfig_altChooser:
    tag: AltChooserBoundedSearch
    contents: 3
  lconfig_importColumn: 50
  lconfig_alignmentLimit: 30
  lconfig_indentListSpecial: true
  lconfig_indentAmount: 2
  lconfig_alignmentBreakOnMultiline: true
  lconfig_cols: 80
  lconfig_indentPolicy: IndentPolicyFree
  lconfig_indentWhereSpecial: true
  lconfig_columnAlignMode:
    tag: ColumnAlignModeMajority
    contents: 0.7
This Haskell file compiles just fine with ghc 8.10. ```hs {-# LANGUAGE ParallelListComp #-} main = undefined b = undefined c = undefined d = undefined e = undefined a = [ b | c | d <- e ] ``` But running brittany 0.13.1.1 on it causes it to print an error: `ERROR: brittany pretty printer returned syntactically invalid result. ` Running with `--output-on-errors` produces this output ```hs {-# LANGUAGE ParallelListComp #-} main = undefined b = undefined c = undefined d = undefined e = undefined a = [ b | c d <- e ] ``` <details> <summary>brittany.yaml</summary> ```yaml conf_debug: dconf_roundtrip_exactprint_only: false dconf_dump_bridoc_simpl_par: false dconf_dump_ast_unknown: false dconf_dump_bridoc_simpl_floating: false dconf_dump_config: false dconf_dump_bridoc_raw: false dconf_dump_bridoc_final: false dconf_dump_bridoc_simpl_alt: false dconf_dump_bridoc_simpl_indent: false dconf_dump_annotations: false dconf_dump_bridoc_simpl_columns: false dconf_dump_ast_full: false conf_forward: options_ghc: - -XBangPatterns - -XBlockArguments - -XExplicitForAll - -XExplicitNamespaces - -XGADTs - -XImplicitParams - -XLambdaCase - -XMultiWayIf - -XNumericUnderscores - -XParallelListComp - -XPatternGuards - -XQuasiQuotes - -XRecursiveDo - -XTemplateHaskell - -XTupleSections - -XTypeApplications - -XViewPatterns conf_errorHandling: econf_ExactPrintFallback: ExactPrintFallbackModeInline econf_Werror: false econf_omit_output_valid_check: false econf_produceOutputOnErrors: false conf_preprocessor: ppconf_CPPMode: CPPModeAbort ppconf_hackAroundIncludes: false conf_version: 1 conf_layout: lconfig_altChooser: tag: AltChooserBoundedSearch contents: 3 lconfig_importColumn: 50 lconfig_alignmentLimit: 30 lconfig_indentListSpecial: true lconfig_indentAmount: 2 lconfig_alignmentBreakOnMultiline: true lconfig_cols: 80 lconfig_indentPolicy: IndentPolicyFree lconfig_indentWhereSpecial: true lconfig_columnAlignMode: tag: ColumnAlignModeMajority contents: 0.7 ``` </details>
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: hexagoxel/brittany#372
There is no content yet.