Frege / eclipse-plugin

The eclipse plugin for frege, codename fregIDE
31 stars 6 forks source link

Compilation error after upgrading to 3.22.324. #7

Closed muhuk closed 9 years ago

muhuk commented 9 years ago

After upgrading eclipse-plugin, I'm getting the same error on a number of my modules:

flipƒ59a13447 cannot be resolved or is not a field

in file/FregeEuler/src/Euler02.fr, line 1. Here's the contents of the file:

module Euler02 where

fibs :: [Long]
fibs = 0 : 1 : zipWith (+) fibs (tail fibs)

euler02seq :: [Long]
euler02seq = [x | x <- takeWhile (<= 4000000) fibs, even x] 

main :: IO ()
main = do
    println "Euler02"
    println $ sum euler02seq

By commenting in/out, I've figure it's line 9, definition of euler02seq. It was working fine before I have upgraded. If there's a problem with my code, could you please point it out to me?

BTW the word module is underlined with red.

muhuk commented 9 years ago

Changing (<= 4000000) to (\x -> x <= 4000000) solved this particular problem for me. Aren't they equal expressions?

Ingo60 commented 9 years ago

It should be the same. Well, not quite. To save a lambda, it is actually the same as

Prelude.flip (<=) 400000

Copying your code into a fresh file works for me without problems.

To me it will seem that you upgraded from a 3.21. compiler version and didn't follow the advice given in the wiki, namely to do a clean rebuild. (which is absolutly necessary in case of a major version bump where backwards compatibility with code compiled by previous versions is mostly lost).

So please, check the following:

After that, it should re-compile everything and the error should be gone.

Btw, the output of your program is:

Euler02
4613732
runtime 0.168 wallclock seconds.

Have fun!

muhuk commented 9 years ago

That solved it! Thanks.

I had a plugins/frege.ide_3.22.92.201404261407/lib/fregec.jar, now I'm using plugins/frege.ide_3.22.335.201501171835/lib/fregec.jar.

Ingo60 commented 9 years ago

Yeah, this!

I shall find a way to make things less clumsy by updating the build path automatically.