fpco / yesod-fay

Utilities for using the Fay Haskell-to-JS compiler with Yesod.
MIT License
24 stars 9 forks source link

Fay unable to resolve `fromString` #19

Open cies opened 9 years ago

cies commented 9 years ago

When trying to compile, with Haskell LTS 1.15's Fay, some Haskell code that used to work with fay 0.20 and fay-text 0.3.0.2, I got the following error:

Handler/Home.hs:62:7:
    Exception when trying to run compile-time code:
      Unable to compile Fay module "Home":

unable to resolve qualified names (this might be a bug):fromString
    Code: fayFile' (Language.Haskell.TH.Syntax.ConE 'StaticR) "Home"
    In the splice: $(fayFile' (ConE 'StaticR) "Home")

I tried to qualify the import of Text to T, but then the relevant line of the error message changed to:

unable to resolve qualified names (this might be a bug):T.fromString

Thereby I knew I was at the right point, because the error did not show a line number.

cies commented 9 years ago

I fixed it by changing fromString into pack. They should be equivalent according to the fay-text code. I suspect it has something to do with the OverloadedStrings pragma that I have set on that file.

swamp-agr commented 6 years ago

Hi @cies,

Is it still actual?

Thanks, Andrey

decapo01 commented 2 years ago

Just some input, I just ran into this issue and was able to resolve it by using pack instead of fromString as well.