tweag / ormolu

A formatter for Haskell source code
https://ormolu-live.tweag.io
Other
958 stars 83 forks source link

No instance for (Bounded Extension) arising from a use of ‘minBound’ #496

Closed ad-si closed 4 years ago

ad-si commented 4 years ago

Tried to build it on macOS with stack and got following error:

[39 of 41] Compiling Ormolu.Parser

/Users/adrian/Tests/ormolu/src/Ormolu/Parser.hs:194:16: error:
    • No instance for (Bounded Extension)
        arising from a use of ‘minBound’
    • In the expression: minBound
      In the expression: [minBound .. maxBound]
      In an equation for ‘allExts’: allExts = [minBound .. maxBound]
    |
194 |     allExts = [minBound .. maxBound]
    |                ^^^^^^^^
neongreen commented 4 years ago

Which GHC version and ghc-lib-parser version were used for the build?

On Sat, Jan 11, 2020, 16:27 Adrian Sieber notifications@github.com wrote:

Tried to build it on macOS with stack and got following error:

[39 of 41] Compiling Ormolu.Parser

/Users/adrian/Tests/ormolu/src/Ormolu/Parser.hs:194:16: error:

• No instance for (Bounded Extension)

    arising from a use of ‘minBound’

• In the expression: minBound

  In the expression: [minBound .. maxBound]

  In an equation for ‘allExts’: allExts = [minBound .. maxBound]

|

194 | allExts = [minBound .. maxBound]

|                ^^^^^^^^

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tweag/ormolu/issues/496?email_source=notifications&email_token=AALT42UHEZFJ3UERGIECUJTQ5HCNTA5CNFSM4KFR76HKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IFQMEUQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALT42SFHEG4VL56Q2JLKQ3Q5HCNTANCNFSM4KFR76HA .

neongreen commented 4 years ago

Perhaps we should go back to pinning the ghc-lib-parser version.

On Sat, Jan 11, 2020, 17:16 Artyom Kazak artyom@artyom.me wrote:

Which GHC version and ghc-lib-parser version were used for the build?

On Sat, Jan 11, 2020, 16:27 Adrian Sieber notifications@github.com wrote:

Tried to build it on macOS with stack and got following error:

[39 of 41] Compiling Ormolu.Parser

/Users/adrian/Tests/ormolu/src/Ormolu/Parser.hs:194:16: error:

• No instance for (Bounded Extension)

    arising from a use of ‘minBound’

• In the expression: minBound

  In the expression: [minBound .. maxBound]

  In an equation for ‘allExts’: allExts = [minBound .. maxBound]

|

194 | allExts = [minBound .. maxBound]

|                ^^^^^^^^

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tweag/ormolu/issues/496?email_source=notifications&email_token=AALT42UHEZFJ3UERGIECUJTQ5HCNTA5CNFSM4KFR76HKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IFQMEUQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALT42SFHEG4VL56Q2JLKQ3Q5HCNTANCNFSM4KFR76HA .

ad-si commented 4 years ago

I was using the stack lts-14.3 as described in your documentation, but with 14.20 and 13.19 it didn't work either…

neongreen commented 4 years ago

Yeah, the Bounded instance only appeared in 8.8.1 and lts-14.3 includes 8.8.0.

We would either have to add a more restrictive lower bound, or go via Enum instead of Bounded if we want to keep using the ghc-lib-parser provided by Stackage.

On Sat, Jan 11, 2020, 17:22 Adrian Sieber notifications@github.com wrote:

I was using the stack lts-14.3 as described in your documentation, but with 14.20 and 13.19 it didn't work either…

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tweag/ormolu/issues/496?email_source=notifications&email_token=AALT42WQSDFV33MYLUYZOLDQ5HI2NA5CNFSM4KFR76HKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIWC7JI#issuecomment-573321125, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALT42UK4VHMB5Q6NBJEBU3Q5HI2NANCNFSM4KFR76HA .

neongreen commented 4 years ago

@mrkkrp which one should it be? Do you care about sticking to Stackage versions or not?

mrkkrp commented 4 years ago

The lower bound seems to be correct in both master and the released version on Hackage:

ghc-lib-parser >= 8.8.1 && < 8.8.2

I do not understand how it could build with 8.8.0 given these bounds.

Here is what I use:

resolver: lts-14.03
packages:
- '.'

extra-deps:
- ghc-lib-parser-8.8.1@sha256:81dc4ed6ae6b7ccfda1e62e3c2d9a8600f8ecf45e4237d4dc099ccd4b74db180
mrkkrp commented 4 years ago

Closing, since currently we have correct lower bound, unless I'm missing something here.