Skip to content

doesn't compile with ghc 8.2.1 #7

@JakeWheat

Description

@JakeWheat

When compiling the latest version on hackage (0.9.22) with ghc 8.2.1, I get the following error:

src/UU/Parsing/Offside.hs:128:9: error:
    • Could not deduce (Position pos)
      from the context: (InputState t1 s p1, Position p1,
                         InputState t1 s1 t0, InputState t1 s pos)
        bound by the inferred type for ‘sameln’:
                   forall pos s1 p1.
                   (InputState t1 s p1, Position p1, InputState t1 s1 t0,
                    InputState t1 s pos) =>
                   t1 -> [a0] -> OffsideInput t1 s t0
        at src/UU/Parsing/Offside.hs:(128,9)-(145,37)
    • In the ambiguity check for the inferred type for ‘sameln’
      To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
      When checking the inferred type
        sameln :: forall pos s1 p.
                  (InputState t1 s p, Position p, InputState t1 s1 t0,
                   InputState t1 s pos) =>
                  t1 -> [a0] -> OffsideInput t1 s t0
      In an equation for ‘layoutL’:
          layoutL ln ts ms
            | ln /= sln = startln (column pos) ts ms
            | otherwise = sameln ts ms
            where
                sln = line pos
                pos = getPosition ts
                layout = layoutL ln
                implicit = implicitL ln
                ....
    |
128 |         sameln tts ms
    |         ^^^^^^^^^^^^^...

Adding 'AllowAmbiguousTypes' to the language pragma at the top of the file 'src/UU/Parsing/Offside.hs' seems to work, but I have no idea if this is the correct fix.

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