
22 Aug
2011
22 Aug
'11
3:43 a.m.
2011/8/22 Sunil S Nandihalli
I failed to tell that it prints "main : <<loop>>" and terminates... I was not clear about it in my previous email.. but that is what I meant. my appologies ..
That is exactly what ghc does. In some cases, it is able to detect a function does nothing but loop, so it prints <<loop>> and terminates. I don't know the details of how that works, I'm sure someone will be able to explain it in detail, but consider this example : david@pcdavid:~$ cat loop.hs main = main david@pcdavid:~$ ghc --make loop.hs [1 of 1] Compiling Main ( loop.hs, loop.o ) Linking loop ... david@pcdavid:~$ ./loop loop: <<loop>>