bjpop / language-python

A parser for Python 2.x and 3.x written in Haskell
157 stars 45 forks source link

Build failure: take is ambiguous #35

Closed DanBurton closed 6 years ago

DanBurton commented 7 years ago

Build failure with GHC 8.2.1 as seen on the Stackage build server:

[12 of 23] Compiling Language.Python.Common.LexerUtils ( src/Language/Python/Common/LexerU
tils.hs, dist/build/Language/Python/Common/LexerUtils.o )

src/Language/Python/Common/LexerUtils.hs:98:14: error:
    Ambiguous occurrence ‘take’
    It could refer to either ‘Prelude.take’,
                             imported from ‘Prelude’ at src/Language/Python/Common/LexerUtils.hs:14:8-40
                             (and originally defined in ‘GHC.List’)
                          or ‘Map.take’,
                             imported from ‘Data.Map’ at src/Language/Python/Common/LexerUtils.hs:19:1-49
                             (and originally defined in ‘Data.Map.Internal’)
   |
98 |    literal = take len str
   |              ^^^^

src/Language/Python/Common/LexerUtils.hs:123:17: error:
    Ambiguous occurrence ‘drop’
    It could refer to either ‘Prelude.drop’,
                             imported from ‘Prelude’ at src/Language/Python/Common/LexerUtils.hs:14:8-40
                             (and originally defined in ‘GHC.List’)
                          or ‘Map.drop’,
                             imported from ‘Data.Map’ at src/Language/Python/Common/LexerUtils.hs:19:1-49
                             (and originally defined in ‘Data.Map.Internal’)
    |
123 |    = toBinary . drop 2
    |                 ^^^^

src/Language/Python/Common/LexerUtils.hs:139:26: error:
    Ambiguous occurrence ‘take’
    It could refer to either ‘Prelude.take’,
                             imported from ‘Prelude’ at src/Language/Python/Common/LexerUtils.hs:14:8-40
                             (and originally defined in ‘GHC.List’)
                          or ‘Map.take’,
                             imported from ‘Data.Map’ at src/Language/Python/Common/LexerUtils.hs:19:1-49
                             (and originally defined in ‘Data.Map.Internal’)
    |
139 |    return $ toToken loc (take len str)
    |                          ^^^^
bjpop commented 7 years ago

Thanks @DanBurton. If you have time to send a pull request to fix this issue it would be greatly appreciated.

sergv commented 7 years ago

@bjpop Please review my PR #36 that fixes this.

bjpop commented 7 years ago

Thanks @sergv. I will check out the pull request. Much appreciated.

bjpop commented 6 years ago

I think this is solved now. Thanks @sergv and @DanBurton.