-
Notifications
You must be signed in to change notification settings - Fork 113
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
Detect {-# LANGUAGE UnboxedTuples #-} automatically #866
Comments
Seems like HIndent 6.0.1 can detect the language extension. Could you give me an example that HIndent can't format? Input {-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnboxedTuples #-}
f :: (# Int, Int #) -> Int
f t = case t of
(# x, _ #) -> x Output {-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnboxedTuples #-}
f :: (# Int, Int #) -> Int
f t =
case t of
(# x, _ #) -> x |
It works in patterns but not in expressions, so I guess it's actually a bug. Perhaps I was wrong that this has anything to do with #419. Input f :: (# Int, Int #) -> (# Int, Int #)
f t = case t of
(# x, y #) -> (# x, y #) Output f :: (# Int, Int #) -> (# Int, Int #)
f t =
case t of
(# x, y #) -> (x, y) |
Thanks for the code. I can reproduce it, and I am fixing it now. |
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Completed checklist
Problem description
In #419, it is explained that UnboxedTuples is intentionally unsupported by default because it would be mutually exclusive with handling lens operators. Makes sense, but it would be nice if this behavior would be altered by LANGUAGE pragmas so that it doesn't have to be overridden in the command manually.
Proposed solution
If the file contains the UnboxedTuples language extension, behave as though passing -XUnboxedTuples on the command line.
Alternatives
I can't think of an alternative.
The text was updated successfully, but these errors were encountered: