Send Beginners mailing list submissions to
        beginners@haskell.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  main: <<loop>> ....? (Sunil S Nandihalli)
   2. Re:  main: <<loop>> ....? (Sunil S Nandihalli)
   3. Re:  main: <<loop>> ....? (Benjamin Edwards)
   4. Re:  main: <<loop>> ....? (Sunil S Nandihalli)
   5. Re:  main: <<loop>> ....? (David Virebayre)
   6. Re:  main: <<loop>> ....? (Daniel Fischer)
   7. Re:  main: <<loop>> ....? (Sunil S Nandihalli)
   8. Re:  main: <<loop>> ....? (Daniel Fischer)
   9. Re:  main: <<loop>> ....? (Sunil S Nandihalli)


----------------------------------------------------------------------

Message: 1
Date: Mon, 22 Aug 2011 13:26:34 +0530
From: Sunil S Nandihalli <sunil.nandiha...@gmail.com>
Subject: Re: [Haskell-beginners] main: <<loop>> ....?
To: David Virebayre <dav.vire+hask...@gmail.com>,       Benjamin Edwards
        <edwards.b...@gmail.com>
Cc: beginners <beginners@haskell.org>
Message-ID:
        <CAP0FD71=fevqmwun65y-gkh8etq_2kw9swmmfxt481hqwmh...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Just curious if it executes the infinite loop at least once before
cutting off...

Sunil.

On Mon, Aug 22, 2011 at 1:22 PM, Sunil S Nandihalli
<sunil.nandiha...@gmail.com> wrote:
> Yes David, it is printing some stuff.. I am trying to track down where
> it is getting into infinite loop by placing a lot of trace commands ..
> Thanks
> Sunil.
>
> On Mon, Aug 22, 2011 at 1:19 PM, David Virebayre
> <dav.vire+hask...@gmail.com> wrote:
>> 2011/8/22 Sunil S Nandihalli <sunil.nandiha...@gmail.com>:
>>> Is there a way I can find out where it is in infinite loop?
>>
>> I don't know of any other way to find it than looking at the code, I
>> hope someone with more experience will be able to explain a better
>> way.
>>
>> After looking at the source code you posted, does it print anything
>> before it prints <<loop>> ?
>>
>



------------------------------

Message: 2
Date: Mon, 22 Aug 2011 13:38:16 +0530
From: Sunil S Nandihalli <sunil.nandiha...@gmail.com>
Subject: Re: [Haskell-beginners] main: <<loop>> ....?
To: David Virebayre <dav.vire+hask...@gmail.com>,
        beginners@haskell.org
Message-ID:
        <CAP0FD71hw1R0rYJKSzhzMDWRVYV+zbTZFi=z+3jeyaxx-tu...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Is there a way to disable haskell automatic infinite loop detection ..
that might make it simpler to figure out where it is happening by just
looking at the trace-output in stdout..

Thanks

On Mon, Aug 22, 2011 at 1:06 PM, David Virebayre
<dav.vire+hask...@gmail.com> wrote:
> 2011/8/22 Sunil S Nandihalli <sunil.nandiha...@gmail.com>:
>> Hello everybody,
>> main: <<loop>> ?-> where did this come from. I know I am not printing
>
> Your program has an endless loop that was detected by ghc.
>
> David.
>



------------------------------

Message: 3
Date: Mon, 22 Aug 2011 09:13:18 +0100
From: Benjamin Edwards <edwards.b...@gmail.com>
Subject: Re: [Haskell-beginners] main: <<loop>> ....?
To: Sunil S Nandihalli <sunil.nandiha...@gmail.com>
Cc: beginners@haskell.org
Message-ID:
        <can6k4ni+dnxsmdaezqbigmeushmhezgmwgmazxn-sghp+fv...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Shory answer: no.
Longer answer: google the halting problem :)

No links because I am on my phone...
On 22 Aug 2011 09:11, "Sunil S Nandihalli" <sunil.nandiha...@gmail.com>
wrote:
> Is there a way to disable haskell automatic infinite loop detection ..
> that might make it simpler to figure out where it is happening by just
> looking at the trace-output in stdout..
>
> Thanks
>
> On Mon, Aug 22, 2011 at 1:06 PM, David Virebayre
> <dav.vire+hask...@gmail.com> wrote:
>> 2011/8/22 Sunil S Nandihalli <sunil.nandiha...@gmail.com>:
>>> Hello everybody,
>>> main: <<loop>>  -> where did this come from. I know I am not printing
>>
>> Your program has an endless loop that was detected by ghc.
>>
>> David.
>>
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20110822/8849062f/attachment-0001.htm>

------------------------------

Message: 4
Date: Mon, 22 Aug 2011 13:48:16 +0530
From: Sunil S Nandihalli <sunil.nandiha...@gmail.com>
Subject: Re: [Haskell-beginners] main: <<loop>> ....?
To: Benjamin Edwards <edwards.b...@gmail.com>
Cc: beginners@haskell.org
Message-ID:
        <cap0fd712+p8_ekzsphjwo6wr2ngawuxnwkrcaf9cq9v88hv...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

you r right it is hard to determine if a program will terminate .. I
don't understand why that should make it impossible to disable
infinite loop detection..
Thanks,
Sunil.

On Mon, Aug 22, 2011 at 1:43 PM, Benjamin Edwards
<edwards.b...@gmail.com> wrote:
> Shory answer: no.
> Longer answer: google the halting problem :)
>
> No links because I am on my phone...
>
> On 22 Aug 2011 09:11, "Sunil S Nandihalli" <sunil.nandiha...@gmail.com>
> wrote:
>> Is there a way to disable haskell automatic infinite loop detection ..
>> that might make it simpler to figure out where it is happening by just
>> looking at the trace-output in stdout..
>>
>> Thanks
>>
>> On Mon, Aug 22, 2011 at 1:06 PM, David Virebayre
>> <dav.vire+hask...@gmail.com> wrote:
>>> 2011/8/22 Sunil S Nandihalli <sunil.nandiha...@gmail.com>:
>>>> Hello everybody,
>>>> main: <<loop>> ?-> where did this come from. I know I am not printing
>>>
>>> Your program has an endless loop that was detected by ghc.
>>>
>>> David.
>>>
>>
>> _______________________________________________
>> Beginners mailing list
>> Beginners@haskell.org
>> http://www.haskell.org/mailman/listinfo/beginners
>



------------------------------

Message: 5
Date: Mon, 22 Aug 2011 10:19:31 +0200
From: David Virebayre <dav.vire+hask...@gmail.com>
Subject: Re: [Haskell-beginners] main: <<loop>> ....?
To: Sunil S Nandihalli <sunil.nandiha...@gmail.com>
Cc: beginners <beginners@haskell.org>
Message-ID:
        <cam_wfvt_pwzjzvl9un-bvw1-ewiq-7wr3tuhd3dn-o3w9bl...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

2011/8/22 Sunil S Nandihalli <sunil.nandiha...@gmail.com>:
> Yes David, it is printing some stuff.. I am trying to track down where
> it is getting into infinite loop by placing a lot of trace commands ..
> Thanks
> Sunil.

Try to run it in ghci, step by step:

1) input<-getContents

better to replace this step by a

1) input <- readFile "mytestdata"


2) let w@(nstr:locPairStrs) = lines input
3) let n = read nstr::Integer
4) let locs = take (fromIntegral n) $ map (tuplify2 . (\x-> map
stringToRatio $ words x))
                     locPairStrs
5) let answer = solve n locs
6) putStrLn $ " n : "++ show n
7) putStrLn $ " locs : "++show locs
8) putStrLn $ show $ vornoiGraph locs
9) putStrLn $ plotAsString locs answer

see what happens, and where.


>
> On Mon, Aug 22, 2011 at 1:19 PM, David Virebayre
> <dav.vire+hask...@gmail.com> wrote:
>> 2011/8/22 Sunil S Nandihalli <sunil.nandiha...@gmail.com>:
>>> Is there a way I can find out where it is in infinite loop?
>>
>> I don't know of any other way to find it than looking at the code, I
>> hope someone with more experience will be able to explain a better
>> way.
>>
>> After looking at the source code you posted, does it print anything
>> before it prints <<loop>> ?
>>
>



------------------------------

Message: 6
Date: Mon, 22 Aug 2011 10:24:11 +0200
From: Daniel Fischer <daniel.is.fisc...@googlemail.com>
Subject: Re: [Haskell-beginners] main: <<loop>> ....?
To: beginners@haskell.org
Message-ID: <201108221024.12056.daniel.is.fisc...@googlemail.com>
Content-Type: Text/Plain;  charset="iso-8859-1"

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 ..
> 
> https://github.com/sunilnandihalli/is2/blob/master/main.hs

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.



------------------------------

Message: 7
Date: Mon, 22 Aug 2011 14:00:55 +0530
From: Sunil S Nandihalli <sunil.nandiha...@gmail.com>
Subject: Re: [Haskell-beginners] main: <<loop>> ....?
To: Daniel Fischer <daniel.is.fisc...@googlemail.com>
Cc: beginners@haskell.org
Message-ID:
        <CAP0FD72qtXCFkMvhkrdfJi=2CvLXcHS4CR1gFHg4H=axn-j...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

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
<daniel.is.fisc...@googlemail.com> wrote:
> 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 ..
>>
>> https://github.com/sunilnandihalli/is2/blob/master/main.hs
>
> 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.
>

------------------------------

Message: 8
Date: Mon, 22 Aug 2011 10:37:53 +0200
From: Daniel Fischer <daniel.is.fisc...@googlemail.com>
Subject: Re: [Haskell-beginners] main: <<loop>> ....?
To: beginners@haskell.org
Message-ID: <201108221037.53166.daniel.is.fisc...@googlemail.com>
Content-Type: Text/Plain;  charset="iso-8859-1"

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



------------------------------

Message: 9
Date: Mon, 22 Aug 2011 14:34:49 +0530
From: Sunil S Nandihalli <sunil.nandiha...@gmail.com>
Subject: Re: [Haskell-beginners] main: <<loop>> ....?
To: Daniel Fischer <daniel.is.fisc...@googlemail.com>
Cc: beginners@haskell.org
Message-ID:
        <cap0fd72aagvi_brbz-go+3+abcfr6hztoo3uzij2jjwjblc...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Yes Daniel I get similar errors.. Now atleast I am moving forward .. :)
Sunil.

On Mon, Aug 22, 2011 at 2:07 PM, Daniel Fischer
<daniel.is.fisc...@googlemail.com> wrote:
> 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
>



------------------------------

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 38, Issue 40
*****************************************

Reply via email to