Support for ghc-8.10.1 #305

Closed
jneira wants to merge 6 commits from ghc-8.10.1 into master
jneira commented 2020-05-13 14:50:50 +02:00 (Migrated from github.com)
  • 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
* 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 ``` * Issue #269
infinity0 commented 2020-05-30 00:31:01 +02:00 (Migrated from github.com)

I've made it compile here in commit 0807fc9b30 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.

I've made it compile [here](https://github.com/infinity0/brittany/tree/ghc-8.10.1) 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.
bubba (Migrated from github.com) reviewed 2020-08-05 12:56:05 +02:00
bubba (Migrated from github.com) commented 2020-08-05 12:56:05 +02:00
allow-newer: data-tree-print:base

Looks like only data-tree-print is needed now

```suggestion allow-newer: data-tree-print:base ``` Looks like only data-tree-print is needed now
bubba commented 2020-08-06 19:42:39 +02:00 (Migrated from github.com)

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

@jneira Any chance I could get push access to this branch? I've rebased it and got it building on ghc-8.8
jneira commented 2020-08-06 21:21:25 +02:00 (Migrated from github.com)

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

@bubba sure, feel free to open a new pr or alternatively you can do a pr against my branch
jneira commented 2020-08-07 00:40:21 +02:00 (Migrated from github.com)

Superseded by #312

Superseded by #312

Pull request closed

Sign in to join this conversation.
There is no content yet.