Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Broken parsers with ghc 7.8.2 #41

Closed
thomasdziedzic opened this Issue · 1 comment

2 participants

@thomasdziedzic

I recently upgraded ghc and reinstalled yesod-dsl.

I got the following error:

[ 2 of 27] Compiling Lexer ( dist/build/yesod-dsl/yesod-dsl-tmp/Lexer.hs, dist/build/yesod-dsl/yesod-dsl-tmp/Lexer.o )

dist/build/yesod-dsl/yesod-dsl-tmp/Lexer.hs:565:34:
Couldn't match expected type ‘Bool’ with actual type ‘Int#’
In the first argument of ‘(&&)’, namely ‘(offset >=# 0#)’
In the expression: (offset >=# 0#) && (check ==# ord_c)
In the expression:
if (offset >=# 0#) && (check ==# ord_c) then
alexIndexInt16OffAddr alex_table offset
else
alexIndexInt16OffAddr alex_deflt s

dist/build/yesod-dsl/yesod-dsl-tmp/Lexer.hs:565:53:
Couldn't match expected type ‘Bool’ with actual type ‘Int#’
In the second argument of ‘(&&)’, namely ‘(check ==# ord_c)’
In the expression: (offset >=# 0#) && (check ==# ord_c)
In the expression:
if (offset >=# 0#) && (check ==# ord_c) then
alexIndexInt16OffAddr alex_table offset
else
alexIndexInt16OffAddr alex_deflt s

This error happens because ghc 7.6.3 used ghc-prim 0.3.0.0 which defined >=# as Int# -> Int# -> Bool
ghc 7.8.2 used ghc-prim 0.3.1.0 which defined >=# as Int# -> Int# -> Int#

Relevant lines:
https://github.com/simonmar/alex/blob/master/src/Scan.hs#L349
https://github.com/simonmar/alex/blob/master/templates/GenericTemplate.hs#L170

@simonmar
Owner

You either need to update alex to the latest version, or ask the maintainer of yesod-dsl to repackage it using a newer version of alex (if yesod-dsl is shipped with a prebuilt Lexer.hs)

@simonmar simonmar closed this
@thomasdziedzic thomasdziedzic referenced this issue in tlaitinen/yesod-dsl
Closed

Broken Lexer.hs output with ghc 7.8.2 #4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.