Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inconsistent behaviour while using "foreign" as a variable / binding name

Tags:

haskell

elm

I'm trying to compile the Elm compiler from source and have run into a strange problem. I've managed to make it build via stack build successfully. However, when I try stack ghci it fails at a number of places where foreign has been used as a variable/binding name. For example:

/Users/saurabhnanda/projects/compiler/builder/src/File/Compile.hs:142:50: error:
    parse error on input ‘foreign’
    |
142 | makeImports project (Plan.Info _ _ _ clean dirty foreign) =
    |                                                  ^^^^^^^
Failed, 141 modules loaded.

It seems that foreign is indeed a reserved keyword. What explains this behaviour, i.e. working in stack build but throwing a parse-error in stack ghci?

like image 322
Saurabh Nanda Avatar asked Nov 17 '22 19:11

Saurabh Nanda


1 Answers

foreign is not used anymore in Elm source code, see https://github.com/elm/compiler/pull/1961.

like image 172
rlefevre Avatar answered Nov 19 '22 09:11

rlefevre