Skip to content

Fix parsing and pretty-printing of unboxed sums

sheaf requested to merge sheaf/ghc:T20858 into master
  1. Allow users to write the unboxed sum type constructors on their own, e.g. (# | #) and (# | | #).

  2. Fix the pretty-printing of unboxed sums: only use the special notation (# a | b | c #) for saturated unboxed sums; otherwise revert to prefix notation (# | | #) a b. This also fixes the pretty-printing of the unboxed sum OccName by adding spaces. This mirrors the term-level behaviour, where we need to write (# 1 | | #) and can't write (# 1 || #) or (#1||#).

Edited by sheaf

Merge request reports