The particular line which makes the error is:
import Foreign.C.Types( CFloat )
And the error is:
-----------------------------------------------------------
LSystem.hs:130:4:
No instance for (ColorComponent CFloat)
arising from a use of `color' at LSystem.hs:130:4-26
Possible fix:
add an instance declaration for (ColorComponent CFloat)
.....
-------------------------------------------------------------
If I write "import Foreign.C.Types" at the Prelude it says nothing. If
I write "import Foreign.C.Types( CFloat )" at the Prelude, it says
<interactive>:1:0: parse error on input `import'
What can it be?
Cheers,
Zsolt
_______________________________________________
Beginners mailing list
Begi...@haskell.org
http://www.haskell.org/mailman/listinfo/beginners
The problem is not Foreign.C.Types, it's in your OpenGL lib.
Probably different versions at home and university.
Try adding
instance ColorComponent CFloat
to LSystem.hs
If that doesn't work, replacing (color x) with (color $ realToFrac x) in all pertinent
places should make it work.
>
> If I write "import Foreign.C.Types" at the Prelude it says nothing. If
> I write "import Foreign.C.Types( CFloat )" at the Prelude, it says
> <interactive>:1:0: parse error on input `import'
Yes, the import at the ghci-prompt is restricted, you can only do
import Module
there, no import lists, no hiding, no import qualified M as P.