mihaimaruseac / hindent

Haskell pretty printer
Other
561 stars 113 forks source link

Breaking template haskell #973

Open constrictorum opened 1 week ago

constrictorum commented 1 week ago

Problem

Description of problem here.

When using the polysemy package in Haskell and formatting code in VS Code, the formatter adds a $ symbol to the makeSem function, making the code invalid. This occurs when the makeSem function is used without arguments, for example: makeSem ''ModFiles.

It's the same with the deriveJSON generator from aeson

Input haskell

makeSem ''MyData
deriveJSON

Expected output haskell

makeSem ''MyData
deriveJSON

Actual output haskell

$makeSem ''MyData
$deriveJSON
constrictorum commented 1 week ago

hindent version 6.1.1, ghc 9.6.6