mihaimaruseac / hindent

Haskell pretty printer
Other
563 stars 113 forks source link

Breaking template haskell #973

Open constrictorum opened 1 month ago

constrictorum commented 1 month 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 month ago

hindent version 6.1.1, ghc 9.6.6