Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data constructors made of symbols have their brackets stripped, leading to syntax errors #526

Open
2 tasks done
kozross opened this issue Nov 19, 2018 · 1 comment
Open
2 tasks done

Comments

@kozross
Copy link

kozross commented Nov 19, 2018

Problem

If you define a data constructor which is made up of : followed by symbols (that is, designed for infix use), hindent will strip away the parentheses around it, which becomes a syntax error.

  • I checked the issue tracker for existing issues about this problem.
  • I'm using the latest version of hindent.

Input haskell

data HList (ts :: [Type]) where
  HNil :: HList '[]
  (:#) :: t -> HList ts -> HList (t ': ts)

Expected output haskell

data HList (ts :: [Type]) where
  HNil :: HList '[]
  (:#) :: t -> HList ts -> HList (t  ':  ts)

Actual output haskell

data HList (ts :: [Type]) where
  HNil :: HList '[]
  :# :: t -> HList ts -> HList (t ': ts)
@kozross
Copy link
Author

kozross commented Mar 22, 2019

I just observed that this also happens to functions named to be infix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant