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

Broken on GHC 7.8 #1

Closed
sethfowler opened this issue Apr 11, 2014 · 7 comments
Closed

Broken on GHC 7.8 #1

sethfowler opened this issue Apr 11, 2014 · 7 comments

Comments

@sethfowler
Copy link
Contributor

Trying to build greencard-3.0.4.1 on GHC 7.8, I get the following output:

Building greencard-3.0.4.1...
Preprocessing library greencard-3.0.4.1...
[1 of 1] Compiling Foreign.GreenCard ( lib/Foreign/GreenCard.hs, dist/build/Foreign/GreenCard.o )
In-place registering greencard-3.0.4.1...
Preprocessing executable 'greencard' for greencard-3.0.4.1...
[ 1 of 21] Compiling ErrMonad         ( src/ErrMonad.lhs, dist/build/greencard/greencard-tmp/ErrMonad.o )

src/ErrMonad.lhs:42:10: Warning:
    ‘ErrM’ is an instance of Monad but not Applicative - this will become an error in GHC 7.10, under the Applicative-Monad Proposal.
[ 2 of 21] Compiling PrettyUtils      ( src/PrettyUtils.lhs, dist/build/greencard/greencard-tmp/PrettyUtils.o )
[ 3 of 21] Compiling Name             ( src/Name.lhs, dist/build/greencard/greencard-tmp/Name.o )
[ 4 of 21] Compiling Type             ( src/Type.lhs, dist/build/greencard/greencard-tmp/Type.o )
[ 5 of 21] Compiling NameSupply       ( src/NameSupply.lhs, dist/build/greencard/greencard-tmp/NameSupply.o )

src/NameSupply.lhs:39:10: Warning:
    ‘NSM’ is an instance of Monad but not Applicative - this will become an error in GHC 7.10, under the Applicative-Monad Proposal.
[ 6 of 21] Compiling ListUtils        ( src/ListUtils.lhs, dist/build/greencard/greencard-tmp/ListUtils.o )
[ 7 of 21] Compiling Target           ( src/Target.lhs, dist/build/greencard/greencard-tmp/Target.o )
[ 8 of 21] Compiling Casm             ( src/Casm.lhs, dist/build/greencard/greencard-tmp/Casm.o )

src/Casm.lhs:544:2: Warning:
    Pattern match(es) are overlapped
    In a case alternative: _ -> ...

src/Casm.lhs:577:2: Warning:
    Pattern match(es) are overlapped
    In a case alternative: _ -> ...

src/Casm.lhs:616:5: Warning:
    Pattern match(es) are overlapped
    In a case alternative: _ -> ...

src/Casm.lhs:631:6: Warning:
    Pattern match(es) are overlapped
    In a case alternative: _ -> ...
[ 9 of 21] Compiling DIS              ( src/DIS.lhs, dist/build/greencard/greencard-tmp/DIS.o )
[10 of 21] Compiling Decl             ( src/Decl.lhs, dist/build/greencard/greencard-tmp/Decl.o )
[11 of 21] Compiling LexM             ( src/LexM.lhs, dist/build/greencard/greencard-tmp/LexM.o )

src/LexM.lhs:115:10: Warning:
    ‘LexM’ is an instance of Monad but not Applicative - this will become an error in GHC 7.10, under the Applicative-Monad Proposal.
[12 of 21] Compiling FillInMonad      ( src/FillInMonad.lhs, dist/build/greencard/greencard-tmp/FillInMonad.o )

src/FillInMonad.lhs:76:10: Warning:
    ‘FilM’ is an instance of Monad but not Applicative - this will become an error in GHC 7.10, under the Applicative-Monad Proposal.
[13 of 21] Compiling FillIn           ( src/FillIn.lhs, dist/build/greencard/greencard-tmp/FillIn.o )
[14 of 21] Compiling GCToken          ( src/GCToken.lhs, dist/build/greencard/greencard-tmp/GCToken.o )
[15 of 21] Compiling Lex              ( src/Lex.lhs, dist/build/greencard/greencard-tmp/Lex.o )
[16 of 21] Compiling Parse            ( dist/build/greencard/greencard-tmp/Parse.hs, dist/build/greencard/greencard-tmp/Parse.o )

templates/GenericTemplate.hs:104:22:
    Couldn't match expected type ‘Bool’
                with actual type ‘Happy_GHC_Exts.Int#’
    In the expression:
      (n Happy_GHC_Exts.<# (0# :: Happy_GHC_Exts.Int#))
    In a stmt of a pattern guard for
                   a case alternative:
      (n Happy_GHC_Exts.<# (0# :: Happy_GHC_Exts.Int#))
    In a case alternative:
        n | (n Happy_GHC_Exts.<# (0# :: Happy_GHC_Exts.Int#))
          -> (happyReduceArr Happy_Data_Array.! rule) i tk st
          where
              rule
                = (Happy_GHC_Exts.I#
                     ((Happy_GHC_Exts.negateInt#
                         ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#))))))

templates/GenericTemplate.hs:115:23:
    Couldn't match expected type ‘Bool’
                with actual type ‘Happy_GHC_Exts.Int#’
    In the expression:
      (off_i Happy_GHC_Exts.>=# (0# :: Happy_GHC_Exts.Int#))
    In the expression:
      if (off_i Happy_GHC_Exts.>=# (0# :: Happy_GHC_Exts.Int#)) then
          (indexShortOffAddr happyCheck off_i Happy_GHC_Exts.==# i)
      else
          False
    In an equation for ‘check’:
        check
          = if (off_i Happy_GHC_Exts.>=# (0# :: Happy_GHC_Exts.Int#)) then
                (indexShortOffAddr happyCheck off_i Happy_GHC_Exts.==# i)
            else
                False

templates/GenericTemplate.hs:117:30:
    Couldn't match expected type ‘Happy_GHC_Exts.Int#’
                with actual type ‘Bool’
    In the expression: False
    In the expression:
      if (off_i Happy_GHC_Exts.>=# (0# :: Happy_GHC_Exts.Int#)) then
          (indexShortOffAddr happyCheck off_i Happy_GHC_Exts.==# i)
      else
          False

templates/GenericTemplate.hs:119:13:
    Couldn't match expected type ‘Bool’
                with actual type ‘Happy_GHC_Exts.Int#’
    In the expression: check
    In a stmt of a pattern guard for
                   a pattern binding:
      check

templates/GenericTemplate.hs:212:14:
    Pattern bindings containing unlifted types should use an outermost bang pattern:
      (sts1@((HappyCons (st1@(action)) (_))))
        = happyDrop k (HappyCons (st) (sts))
    In an equation for ‘happyMonadReduce’:
        happyMonadReduce k nt fn j tk st sts stk
          = happyThen1
              (fn stk tk)
              (\ r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk))
          where
              (sts1@((HappyCons (st1@(action)) (_))))
                = happyDrop k (HappyCons (st) (sts))
              drop_stk = happyDropStk k stk

templates/GenericTemplate.hs:219:14:
    Pattern bindings containing unlifted types should use an outermost bang pattern:
      (sts1@((HappyCons (st1@(action)) (_))))
        = happyDrop k (HappyCons (st) (sts))
    In an equation for ‘happyMonad2Reduce’:
        happyMonad2Reduce k nt fn j tk st sts stk
          = happyThen1
              (fn stk tk)
              (\ r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk))
          where
              (sts1@((HappyCons (st1@(action)) (_))))
                = happyDrop k (HappyCons (st) (sts))
              drop_stk = happyDropStk k stk
              (off) = indexShortOffAddr happyGotoOffsets st1
              (off_i) = (off Happy_GHC_Exts.+# nt)
              ....
@sethfowler
Copy link
Contributor Author

I forked this intending to fix it and noticed that the version in this repo actually compiles fine. Probably you just need to make a new release on Hackage.

@sethfowler
Copy link
Contributor Author

@sof Pinging about this issue. Is there anything I can do to help move this forward?

@sethfowler
Copy link
Contributor Author

@sof I investigated this a little bit further and there's actually no difference in the code at all. The real problem is haskell/cabal/issues/1685 - generated sources produced with an older version of happy are baked into the sdist. All you need to do to fix this is bump the version number and regenerate the sdist on a machine with GHC 7.8.

If you don't have time to do this right now, I'd be happy to do the upload for you if you add me to the maintainers group on Hackage.

@sethfowler
Copy link
Contributor Author

I submitted a pull request, #2, which takes care of all the cabal file changes needed to fix this. All that's necessary is to merge that pull request, generate an sdist on a system with GHC 7.8.x, and upload the new package to Hackage.

@sof
Copy link
Owner

sof commented May 3, 2014

Thanks Seth! Now merged.

(Sorry about the tardiness in dealing with this; a side-effect of C++ occupying my brain most hours of the day atm. Evil.)

@sof
Copy link
Owner

sof commented May 3, 2014

..and refreshed hackage, http://hackage.haskell.org/package/greencard-3.0.4.2

Verify & close?

@sethfowler
Copy link
Contributor Author

No worries. =) Thanks for taking care of this!

I've now verified that everything works fine on both GHC 7.6.x and GHC 7.8.x. So it looks like we can close this bug.

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