Skip to content

Megaparsec 7 compat issues #20

@deepfire

Description

@deepfire

These crop up while compiling against megaparsec 7.0.4:

[ 8 of 14] Compiling LambdaCube.Compiler.Lexer ( src/LambdaCube/Compiler/Lexer.hs, dist/build/LambdaCube/Compiler/Lexer.o )

src/LambdaCube/Compiler/Lexer.hs:46:22: error:
    Variable not in scope:
      getPosition
        :: RWST
             (ParseEnv r) [w] SPos (Parsec (ErrorFancy Void) String) SourcePos
   |
46 | getSPos = toSPos <$> getPosition
   |                      ^^^^^^^^^^^

src/LambdaCube/Compiler/Lexer.hs:130:24: error:
    • Couldn't match type ‘P.ParseError Char (ErrorFancy Void)’
                     with ‘ParseErrorBundle String (ErrorFancy Void)’
      Expected type: Either
                       (ParseErrorBundle String (ErrorFancy Void)) (a, [w])
                     -> Either ParseError (a, [w])
        Actual type: Either
                       (P.ParseError Char (ErrorFancy Void)) (a, [w])
                     -> Either ParseError (a, [w])
    • In the first argument of ‘(.)’, namely ‘left ParseErr’
      In the expression: left ParseErr . snd . flip runParser' st
      In the expression:
        left ParseErr . snd . flip runParser' st
          $ evalRWST p env (error "spos")
    |
130 | runParse p (env, st) = left ParseErr . snd . flip runParser' st $ evalRWST p env (error "spos")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions