Skip to content

Rename foreign argument to fix compiling issue#1827

Merged
paf31 merged 1 commit intopurescript:masterfrom
anttih:fix-foreign-keyword
Jan 14, 2016
Merged

Rename foreign argument to fix compiling issue#1827
paf31 merged 1 commit intopurescript:masterfrom
anttih:fix-foreign-keyword

Conversation

@anttih
Copy link
Copy Markdown
Contributor

@anttih anttih commented Jan 14, 2016

This fixes a compilation issue with ghc 7.10.2 when running stack ghci:

/Users/antti/code/purescript/purescript/psci/Types.hs:54:29:
    parse error on input ‘foreign’

Not exactly sure why it doesn't compile in ghci but does with stack build.

@kritzcreek
Copy link
Copy Markdown
Member

I had this same problem... There was one more thing.... I think it needed a type annotation somewhere. I'll take a look.

Edit: found it. I also needed to make this change to get it to compile in psci...

diff --git a/src/Language/PureScript/Parser/Lexer.hs b/src/Language/PureScript/Parser/Lexer.hs
index 20ddf8b..0510b91 100644
--- a/src/Language/PureScript/Parser/Lexer.hs
+++ b/src/Language/PureScript/Parser/Lexer.hs
@@ -517,4 +517,4 @@ reservedTypeNames = [ "forall", "where" ]
 -- The characters allowed for use in operators
 --
 isSymbolChar :: Char -> Bool
-isSymbolChar c = (c `elem` ":!#$%&*+./<=>?@\\^|-~") || (not (isAscii c) && isSymbol c)
+isSymbolChar c = (c `elem` (":!#$%&*+./<=>?@\\^|-~" :: String)) || (not (isAscii c) && isSymbol c)

@hdgarrood
Copy link
Copy Markdown
Contributor

I've just seen the same thing that @kritzcreek had, except with cabal repl (but not cabal build) using GHC 7.10.3. I've been using 7.10.3 for a while so I have no idea how I haven't noticed this before.

paf31 added a commit that referenced this pull request Jan 14, 2016
Rename `foreign` argument to fix compiling issue
@paf31 paf31 merged commit 20ecf43 into purescript:master Jan 14, 2016
@paf31
Copy link
Copy Markdown
Contributor

paf31 commented Jan 14, 2016

Thanks!

@hdgarrood
Copy link
Copy Markdown
Contributor

Do either of you have a global .ghci file, in $HOME/.ghci? I just realised that in my case, a global .ghci file was the cause of the IsString problem that @kritzcreek mentioned in his comment. My $HOME/.ghci was enabling the OverloadedStrings extension. Removing that extension fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants