It turns out you need to delete scriptedmain.o in order for test.hs to compile.
On Sunday 06 March 2011 23:32:43, Andrew Pennebaker wrote:$ ghc -main-is ScriptedMain --make ScriptedMain
> Is there a way to compile a Haskell script with a different module name
> than Main?
>
The -main-is flag tells GHC what to regard as Main.main.
Give it a module name (Foo) to say main is Foo.main, a function name (bar)
to tell it main is Main.bar or a quailfied function name (Foo.bar) to tell
it main is function bar in module Foo.