Skip to content

Support for ghc-8.10.1#305

Closed
jneira wants to merge 6 commits intolspitzner:masterfrom
jneira:ghc-8.10.1
Closed

Support for ghc-8.10.1#305
jneira wants to merge 6 commits intolspitzner:masterfrom
jneira:ghc-8.10.1

Conversation

@jneira
Copy link
Copy Markdown
Contributor

@jneira jneira commented May 13, 2020

  • WIP, it does not compile:
13 of 32] Compiling Language.Haskell.Brittany.Internal.ExactPrintUtils ( src\Language\Haskell\Brittany\Internal\ExactPrintUtils.hs, D:\\dev\ws\haskell\brittany\dist-newstyle\build\x86_64-windows\ghc-8.10.1\brittany-0.12.1.1\build\Language\Haskell\Brittany\Internal\ExactPrintUtils.o )

src\Language\Haskell\Brittany\Internal\ExactPrintUtils.hs:101:9: error:
    • Couldn't match type ‘Bag.Bag ErrUtils.ErrMsg’ with ‘(a1, [Char])’
      Expected type: Either
                       (a1, [Char]) (ExactPrint.Anns, GHC.ParsedSource)
        Actual type: Either
                       ErrUtils.ErrorMessages (ExactPrint.Anns, GHC.ParsedSource)
    • In the second argument of ‘($)’, namely
        ‘ExactPrint.postParseTransform res opts’
      In a stmt of a 'do' block:
        either
          (\ (span, err) -> ExceptT.throwE $ show span ++ ": " ++ err)
          (\ (a, m) -> pure (a, m, x))
          $ ExactPrint.postParseTransform res opts
      In the second argument of ‘($)’, namely
        ‘do dflags0 <- lift $ GHC.getSessionDynFlags
            (dflags1, leftover, warnings) <- lift
                                               $ GHC.parseDynamicFlagsCmdLine
                                                   dflags0
                                                   (GHC.noLoc <$> ("-hide-all-packages" : args))
            void $ lift $ GHC.setSessionDynFlags dflags1
            dflags2 <- lift $ ExactPrint.initDynFlags fp
            ....’
    |
101 |       $ ExactPrint.postParseTransform res opts
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src\Language\Haskell\Brittany\Internal\ExactPrintUtils.hs:132:13: error:
    • Couldn't match type ‘(a0, [Char])’ with ‘Bag.Bag ErrUtils.ErrMsg’
      Expected type: ErrUtils.ErrorMessages
        Actual type: (a0, [Char])
    • In the pattern: (span, err)
      In the pattern: Left (span, err)
      In a case alternative:
          Left (span, err)
            -> ExceptT.throwE $ showOutputable span ++ ": " ++ err
    |
132 |       Left  (span, err) -> ExceptT.throwE $ showOutputable span ++ ": " ++ err

@infinity0
Copy link
Copy Markdown
Contributor

I've made it compile here in commit https://github.com/infinity0/brittany/commit/0807fc9b30eb9758dffdb87d2a9a9fa6a17a62b1 and it seems to work fine. Not entirely sure about my fixes though:

  • the new way of showing error messages that I'm doing is pretty hacky, perhaps there is a better way
  • not sure I dealt with qualified imports correctly, in Import.hs

Everything else should be pretty reasonable.

jneira and others added 2 commits August 6, 2020 12:24
Only data-tree-print is needed now

Co-authored-by: Luke Lau <luke_lau@icloud.com>
@lukel97
Copy link
Copy Markdown
Contributor

lukel97 commented Aug 6, 2020

@jneira Any chance I could get push access to this branch? I've rebased it and got it building on ghc-8.8

@jneira
Copy link
Copy Markdown
Contributor Author

jneira commented Aug 6, 2020

@bubba sure, feel free to open a new pr or alternatively you can do a pr against my branch

@jneira
Copy link
Copy Markdown
Contributor Author

jneira commented Aug 6, 2020

Superseded by #312

@jneira jneira closed this Aug 6, 2020
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

Successfully merging this pull request may close these issues.

3 participants