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

Missing support for unboxed tuples? #419

Closed
TerrorJack opened this issue Jun 14, 2017 · 4 comments
Closed

Missing support for unboxed tuples? #419

TerrorJack opened this issue Jun 14, 2017 · 4 comments

Comments

@TerrorJack
Copy link

Minimum example:

{-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnboxedTuples #-}

f :: (# Int, Int #) -> Int
f t = case t of
    (# x, _ #) -> x

hindent-5.2.3 reports error on this. hlint recognizes it though, and they share a same version of haskell-src-exts in the same stackage nightly snapshot.

Does hindent already implement formatting unboxed tuples? Or am I missing anything here? Thanks!

@sighingnow
Copy link
Collaborator

You need enable the extension UnboxedTuples explicitly when format this code. Please try

hindent -XUnboxedTuples <your haskell  file>

Since the # symbol may conflict with the # operator in lens, we disable the extension UnboxedTuples designedly.

@TerrorJack
Copy link
Author

@sighingnow Thanks for the remainder. With hindent -XUnboxedTuples it works indeed, however it formats patterns like (# x, y #) into (#x, y#). After that hindent will fail to parse the formatted output.

sighingnow added a commit to sighingnow/hindent that referenced this issue Jun 14, 2017
Signed-off-by: Tao He <sighingnow@gmail.com>
@sighingnow
Copy link
Collaborator

Thanks for your reporting, the bug have been fixed now.

@sighingnow
Copy link
Collaborator

sighingnow commented Jun 15, 2017

@TerrorJack sorry for closing the this issue without pushing update to this repo yesterday. Please try with the latest code in master branch and this issue should be indeed fixed.

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