hindent icon indicating copy to clipboard operation
hindent copied to clipboard

DerivingVia gives syntax errors for valid code

Open kozross opened this issue 5 years ago • 2 comments

Problem

Suppose we have this code:

newtype Trit = Trit (Maybe Bool)
    deriving Eq via (Maybe Bool)

GHC will compile this code just fine, but hindent complains that there's a parse error on 'via'.

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

kozross avatar Nov 01 '18 03:11 kozross

This appears to be an issue upstream with haskell-src-exts.

kozross avatar Nov 15 '18 18:11 kozross

FYI: https://github.com/ennocramer/floskell (fork of hindent) seems to support derivingvia.

domenkozar avatar May 04 '19 07:05 domenkozar

Closing as the current master can format the code.

toku-sa-n avatar Jan 06 '23 02:01 toku-sa-n