quchen / stgi

A user-centric visual STG implementation to help understand GHC/Haskell's execution model.
Other
527 stars 26 forks source link

Couldn't match type `ErrInfo` with `Doc` #94

Closed metaleap closed 7 years ago

metaleap commented 7 years ago

Hi, trying to grab this via stack install stgi (not GitHub directly; in stack's "implicit-global-config") and got the above error message, here's the output screen-page for more context:

Using resolver: lts-7.6 from implicit global project's config file: C:\sr\global-project\stack.yaml
stgi-1.0.1: configure
stgi-1.0.1: build

--  While building package stgi-1.0.1 using:
      C:\sr\setup-exe-cache\x86_64-windows\setup-Simple-Cabal-1.24.0.0-ghc-8.0.1.exe --builddir=.stack-work\dist\b7fec021 build --
ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: C:\sr\global-project\.stack-work\logs\stgi-1.0.1.log

    Configuring stgi-1.0.1...
    Building stgi-1.0.1...
    Preprocessing library stgi-1.0.1...
    [ 1 of 26] Compiling Stg.Util         ( src\Stg\Util.hs, .stack-work\dist\b7fec021\build\Stg\Util.o )
    [ 2 of 26] Compiling Stg.Language.Prettyprint ( src\Stg\Language\Prettyprint.hs, .stack-work\dist\b7fec021\build\Stg\Language\
Prettyprint.o )
    [ 3 of 26] Compiling Stg.Language     ( src\Stg\Language.hs, .stack-work\dist\b7fec021\build\Stg\Language.o )
    [ 4 of 26] Compiling Stg.Parser.Parser ( src\Stg\Parser\Parser.hs, .stack-work\dist\b7fec021\build\Stg\Parser\Parser.o )

    D:\__mstmp\stack4300\stgi-1.0.1\src\Stg\Parser\Parser.hs:73:18: error:
        * Couldn't match type `ErrInfo' with `Doc'
          Expected type: Either Doc ast
            Actual type: Either ErrInfo ast
        * In the expression: Left e
          In a case alternative: Failure e -> Left e
          In the expression:
            case
                parseString (whiteSpace *> p <* eof) mempty (T.unpack input)
            of {
              Success a -> Right a
              Failure e -> Left e }

Will play around some more directly from source (not stack install) tomorrow but thought I'd let ya know in case it really is a fresh bug with the version/repo stack(age?) downloads.. or maybe it's due to running on Windows but while possibly erroneous that shouldn't be a type error ;)

metaleap commented 7 years ago

Well it built and runs just fine when just using the github repo instead of whatever stack install downloads.. feel free to close this --- was possibly just a weird side-effect glitch of using stack on Win 8.1 with at least a broken/failing/buggy pkg-config at my end =)

quchen commented 7 years ago

Hey there, sorry, I completely missed your ticket!

I think the problem is that STGi brings its own stack.yaml, which has a working LTS snapshot stored. Installing STGi from Hackage however will use your current snapshot, and Trifecta (somewhat) recently extended its error type.

I should update the constraints, since older Trifecta is clearly incompatible with the code.