1 / 5
Apr 2007

Hi, I'm using SPOJ to learn Haskell, I already got many problems working flawlessly.
However I tried to make KPEQU and got an "internal error".
Could you please check if there's anything wrong with the haskell environment?
My submission is the 764687, it runs fine at home using ghc 6.6

  • created

    Apr '07
  • last reply

    Jun '07
  • 4

    replies

  • 336

    views

  • 4

    users

It was a glitch on SPOJ's side.
Your solution has been rejudged and it got "AC".

Sorry for the problem, I'll look into what could cause it.

2 months later

I also got an "internal error" when submitting TEST

module SPOJ.TEST where
import System.IO
main = do l <- getLine
          case l of
            "42" -> hClose stdin
            _    -> do putStrLn l
                       main

Is it because of hClose ?

"Internal error" was a result of ghc not generating any output for this code.
It was updated to instead exit with:

[1 of 1] Compiling SPOJ.TEST        ( /tmp/tested.hs, /tmp/tested.o )
Warning: output was redirected with -o, but no output will be generated
because there is no Main module.

I think that now it's informative enough...

I don't know Haskell, but I bet it's "module" that breaks it smile
Note that there's a working "TEST" solution in this forum - you might want to compare it with yours.

That's right. use "module Main ..."

ghc allows you to change this on the command line, but why make things more complicated.

Alternatively, you can simply drop the module line, and it will assume "Main".