From 34d8bc24e33aa373acb6fdeef51427d968f28c0c Mon Sep 17 00:00:00 2001 From: sheaf Date: Tue, 11 Jan 2022 10:42:17 +0100 Subject: Fix parsing & printing of unboxed sums The pretty-printing of partially applied unboxed sums was incorrect, as we incorrectly dropped the first half of the arguments, even for a partial application such as (# | #) @IntRep @DoubleRep Int# which lead to the nonsensical (# DoubleRep | Int# #). This patch also allows users to write unboxed sum type constructors such as (# | #) :: TYPE r1 -> TYPE r2 -> TYPE (SumRep '[r1,r2]). Fixes #20858 and #20859. --- compiler/Language/Haskell/Syntax/Expr.hs | 1 - 1 file changed, 1 deletion(-) (limited to 'compiler/Language') diff --git a/compiler/Language/Haskell/Syntax/Expr.hs b/compiler/Language/Haskell/Syntax/Expr.hs index e51e327866..e6ce12f8ae 100644 --- a/compiler/Language/Haskell/Syntax/Expr.hs +++ b/compiler/Language/Haskell/Syntax/Expr.hs @@ -1635,7 +1635,6 @@ data HsBracket p | TypBr (XTypBr p) (LHsType p) -- [t| type |] | VarBr (XVarBr p) Bool (LIdP p) -- True: 'x, False: ''T - -- (The Bool flag is used only in pprHsBracket) | TExpBr (XTExpBr p) (LHsExpr p) -- [|| expr ||] | XBracket !(XXBracket p) -- Extension point; see Note [Trees That Grow] -- in Language.Haskell.Syntax.Extension -- cgit v1.2.1