
Hello everybody, main: <<loop>> -> where did this come from. I know I am not printing it anywhere .. and it is not printing some of things I am tracing using Debug.Trace module. Can somebody help? Thanks, Sunil.

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 ..
On Mon, Aug 22, 2011 at 1:02 PM, Sunil S Nandihalli
Hello everybody, main: <<loop>> -> where did this come from. I know I am not printing it anywhere .. and it is not printing some of things I am tracing using Debug.Trace module. Can somebody help? Thanks, Sunil.

Hi Benjamin,
It was longer than I could post here .. but here it is ..
https://github.com/sunilnandihalli/is2/blob/master/main.hs
Sunil.
On Mon, Aug 22, 2011 at 1:11 PM, Benjamin Edwards
Where is the code?

On Monday 22 August 2011, 09:45:46, Sunil S Nandihalli wrote:
Hi Benjamin, It was longer than I could post here .. but here it is ..
Sorry for the line-mangling: advanceSweepLineTo front@(rangeToOpenTrapeziaMap,curSweepLineLocation) newSweepLineLocation = let delta = newSweepLineLocation - curSweepLineLocation (expandedTrapezia',_) = expandToAdvance front newSweepLineLocation expandedTrapezia = trace (" expandedTrapezia : "++show expandedTrapezia') $ expandedTrapezia There you have an infinite loop of the simple type, expandedTrapezia = expandedTrapezia On the right hand side, you're missing a ', should be expandedTrapezia' I don't know when you've added the trace calls, so there might well be another problem still.

thanks a lot Daniel, I had introduced a infinite loop when I added
trace to debug my program. Thanks for taking time to look through the
code to pinpoint the error.
Sunil.
On Mon, Aug 22, 2011 at 1:54 PM, Daniel Fischer
On Monday 22 August 2011, 09:45:46, Sunil S Nandihalli wrote:
Hi Benjamin, It was longer than I could post here .. but here it is ..
Sorry for the line-mangling:
advanceSweepLineTo front@(rangeToOpenTrapeziaMap,curSweepLineLocation) newSweepLineLocation = let delta = newSweepLineLocation - curSweepLineLocation (expandedTrapezia',_) = expandToAdvance front newSweepLineLocation expandedTrapezia = trace (" expandedTrapezia : "++show expandedTrapezia') $ expandedTrapezia
There you have an infinite loop of the simple type,
expandedTrapezia = expandedTrapezia
On the right hand side, you're missing a ', should be expandedTrapezia'
I don't know when you've added the trace calls, so there might well be another problem still.

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>>

On Monday 22 August 2011, 09:32:45, Sunil S Nandihalli wrote:
Hello everybody, main: <<loop>> -> where did this come from. I know I am not printing it anywhere .. and it is not printing some of things I am tracing using Debug.Trace module. Can somebody help? Thanks, Sunil.
Okay, after breaking the infinite loop by setting expandedTrapezia = expandedTrapezia' I don't get a "<<loop>>", but, depending on the input complaints about main: Prelude.last: empty list or main: Set.findMin: empty set has no minimal element

Yes Daniel I get similar errors.. Now atleast I am moving forward .. :)
Sunil.
On Mon, Aug 22, 2011 at 2:07 PM, Daniel Fischer
On Monday 22 August 2011, 09:32:45, Sunil S Nandihalli wrote:
Hello everybody, main: <<loop>> -> where did this come from. I know I am not printing it anywhere .. and it is not printing some of things I am tracing using Debug.Trace module. Can somebody help? Thanks, Sunil.
Okay, after breaking the infinite loop by setting
expandedTrapezia = expandedTrapezia'
I don't get a "<<loop>>", but, depending on the input complaints about
main: Prelude.last: empty list
or
main: Set.findMin: empty set has no minimal element
participants (4)
-
Benjamin Edwards
-
Daniel Fischer
-
David Virebayre
-
Sunil S Nandihalli