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

[Haskell] Strictness annotations (e.g. !) not recognized as syntactic changes #607

Closed
GeorgeFlerovsky opened this issue Dec 22, 2023 · 2 comments

Comments

@GeorgeFlerovsky
Copy link

When I run difft X.hs Y.hs with the files below, I expect it to detect the strictness annotations (!) that I've applied to the a and b fields of the X datatype in Y.hs. However, what I get instead is:

❯ difft X.hs Y.hs
Y.hs --- Haskell
No syntactic changes.

This is problematic because strictness annotations in Haskell are important syntax that can have implications for program performance and can even result in compilation errors when certain compiler plugins are used.

Example file X.hs:

module X where

data X = X
  { a :: Int
  , b :: String
  }

Example file Y.hs:

module X where

data X = X
 { a :: !Int
 , b :: !String
 }

Difftastic version:

❯ difft --version
Difftastic 0.53.1
@Wilfred
Copy link
Owner

Wilfred commented Dec 29, 2023

I can work around this, but in general the Haskell parser doesn't keep all the tokens that would really help difftastic work as well as possible.

I've opened tree-sitter/tree-sitter-haskell#107 for this, and tree-sitter/tree-sitter-haskell#102 is kinda similar.

@GeorgeFlerovsky
Copy link
Author

Thank you, Wilfred!

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

2 participants