Skip to content

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

Description

@kozross

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions