[Haskell-cafe] Mystery Parse Error in LHS file

Iæfai jptdrake at gmail.com
Thu May 6 11:02:59 EDT 2010


I have an lhs file, 'starsystem.lhs' that is not compiling because of
a parse error. Specifically:


$ cabal build
Preprocessing executables for starsystem-0.1...
Building starsystem-0.1...
[1 of 4] Compiling Render           ( Render.lhs, dist/build/
starsystem/starsystem-tmp/Render.o )
[2 of 4] Compiling Passive          ( Passive.lhs, dist/build/
starsystem/starsystem-tmp/Passive.o )
[3 of 4] Compiling Active           ( Active.lhs, dist/build/
starsystem/starsystem-tmp/Active.o )
[4 of 4] Compiling Main             ( starsystem.lhs, dist/build/
starsystem/starsystem-tmp/Main.o )

starsystem.lhs:29:0: parse error on input `main'


The location is at the first instance of main:
> data Action = Action (IO Action)

The main program is mostly book-keeping such as initializing OpenGL
and GLFW, creating window, setting up viewport, etc.

\begin{code}

main :: IO ()   -- ** line 29
main = do
 c_unbundled
 GLFW.initialize
 -- open window

I cannot figure out what the problem here is. I have tried it in a
regular hs file and it works. I have posted full source here:
http://hpaste.org/fastcgi/hpaste.fcgi/view?id=25352#a25352

Any thoughts would be welcome.


More information about the Haskell-Cafe mailing list