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

Unusable {-# UNPACK #-} pragmas. #1

Closed
chowells79 opened this issue Apr 29, 2015 · 3 comments
Closed

Unusable {-# UNPACK #-} pragmas. #1

chowells79 opened this issue Apr 29, 2015 · 3 comments

Comments

@chowells79
Copy link

[2 of 4] Compiling Text.Earley.Parser ( Text/Earley/Parser.hs, dist/build/Text/Earley/Parser.o )

Text/Earley/Parser.hs:83:3: Warning:
    Ignoring unusable UNPACK pragma on the third argument of ‘State’
    In the definition of data constructor ‘State’
    In the data declaration for ‘State’

Text/Earley/Parser.hs:92:3: Warning:
    Ignoring unusable UNPACK pragma on the second argument of ‘Cont’
    In the definition of data constructor ‘Cont’
    In the data declaration for ‘Cont’

Text/Earley/Parser.hs:92:3: Warning:
    Ignoring unusable UNPACK pragma on the fourth argument of ‘Cont’
    In the definition of data constructor ‘Cont’
    In the data declaration for ‘Cont’

In all cases, those arguments are Arg values, and Arg is a type alias for a function type. Function types can't be unpacked, since they aren't thin wrappers around primitives.

@ollef
Copy link
Owner

ollef commented Apr 29, 2015

Thanks for your report.

You're right. In fact, I just realised that the cabal file gives the -funbox-strict-fields flag so all UNPACKs could probably be removed. Out of interest, what version of GHC are you using? I'm not getting those warnings even with -Wall running 7.10.1.

@ollef
Copy link
Owner

ollef commented Apr 29, 2015

Fixed by 6fc5388.

@ollef ollef closed this as completed Apr 29, 2015
@chowells79
Copy link
Author

GHC 7.10.1, just building with cabal. Not sure why I got the warnings and you didn't.

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