mihaimaruseac / hindent

Haskell pretty printer
Other
561 stars 113 forks source link

Removes parentheses around GADT constructors defined as operators #898

Closed jmcarthur closed 5 months ago

jmcarthur commented 6 months ago

Problem

The parentheses get removed, creating invalid syntax.

Input haskell

data FixedList n a where
  Nil :: FixedList 0 a
  (:::) :: a -> FixedList n a -> FixedList (n + 1) a

Expected output haskell

data FixedList n a where
  Nil :: FixedList 0 a
  (:::) :: a -> FixedList n a -> FixedList (n + 1) a

Actual output haskell

data FixedList n a where
  Nil :: FixedList 0 a
  ::: :: a -> FixedList n a -> FixedList (n + 1) a