tweag/ormolu

Unparseable output with ticked `DataKinds` and char literals

amesgen opened this issue · 1 comments

Describe the bug
Formatting this valid type family

type family Foo a where Foo '( 'x', a) = a

yields

<input>:2:12
  Parsing of formatted code failed:
  parse error on input `,'

Unsafe output:

type family Foo a where
  Foo '('x', a) = a

Expected behavior
This should be supported by inserting a space before the second ' as in the original input; we are already handling similar cases, see #631.

Environment

  • Version of the code: 0.5.3.0, or 13f11d0 (current master)

The same problem also appears in a type expression context:

type Foo = '[ 'a']