Closed snoyberg closed 8 years ago
The reason for this is that Data.Char.ord
is no longer implicitly available in the generated code. I wouldn't say this is an error in alex - the lexer should never have assumed that it was available (and indeed it can be fixed by just importing it manually).
It's a breaking change in behavior. Whether the behavior was intentional or not is irrelevant; code that previously compiled does not, making this a breaking change.
Yes, the change snuck in without me noticing. But since it's arguably more correct for Alex to not pollute the namespace with things it needs, I'm inclined to leave it as it is rather than change it back. It's not hard to fix, and the fix is backwards compatible.
Simon Marlow notifications@github.com writes:
Yes, the change snuck in without me noticing. But since it's arguably more correct for Alex to not pollute the namespace with things it needs, I'm inclined to leave it as it is rather than change it back. It's not hard to fix, and the fix is backwards compatible.
It looks like alex-generated code still contains some namespace pollution, notably importing all of Data.Array and GHC.Exts. Perhaps it could be considered to import all modules as qualified, to prevent lexers from depending on implementation details in the future?
\ Troels /\ Henriksen
Sure - but Alex is in maintenance mode, I accept pull requests and make Hackage releases but I don't do any significant work on it myself.
Just out of academic curiosity: do we consider the removal of the previously exported ord
function an API change or not? If it is, then the new release ought to be dubbed version 3.2 (or higher).
The example I'm seeing in Stackage is:
https://github.com/mainland/language-c-quote/issues/57
Were there any changes to alex that would explain this?