to modify the eagerness level of haskell compiler..

Hi everybody, May be I am doing it wrong being a beginner.. but here is what I want.. I am trying to debug a stack overflow problem by printing a lot using "trace" commands. But it does not seem to seem to be printing in the expected order. so it has been misleading quiet a bit. Can somebody guide me as to how to modify the laziness of the program or some pointers on how to debug the stack overflow errors. Thanks in advance. Sunil.

the code for the same can be found at https://github.com/sunilnandihalli/is2 it is a single main.hs file so compilation is simply * ghc main.hs --make* thanks, Sunil. On Tue, Aug 30, 2011 at 3:39 PM, Sunil S Nandihalli < sunil.nandihalli@gmail.com> wrote:
Hi everybody, May be I am doing it wrong being a beginner.. but here is what I want.. I am trying to debug a stack overflow problem by printing a lot using "trace" commands. But it does not seem to seem to be printing in the expected order. so it has been misleading quiet a bit. Can somebody guide me as to how to modify the laziness of the program or some pointers on how to debug the stack overflow errors. Thanks in advance. Sunil.

I failed to mention that the case I was trying it on is inp10.b.txt run it as main < inp10.b.txt Sunil. On Tue, Aug 30, 2011 at 3:42 PM, Sunil S Nandihalli < sunil.nandihalli@gmail.com> wrote:
the code for the same can be found at https://github.com/sunilnandihalli/is2 it is a single main.hs file so compilation is simply * ghc main.hs --make* thanks, Sunil.
On Tue, Aug 30, 2011 at 3:39 PM, Sunil S Nandihalli < sunil.nandihalli@gmail.com> wrote:
Hi everybody, May be I am doing it wrong being a beginner.. but here is what I want.. I am trying to debug a stack overflow problem by printing a lot using "trace" commands. But it does not seem to seem to be printing in the expected order. so it has been misleading quiet a bit. Can somebody guide me as to how to modify the laziness of the program or some pointers on how to debug the stack overflow errors. Thanks in advance. Sunil.

Sunil S Nandihalli wrote:
the code for the same can be found at https://github.com/sunilnandihalli/is2 it is a single main.hs file so compilation is simply * ghc main.hs --make* thanks, Sunil.
Sunil S Nandihalli wrote:
Hi everybody, May be I am doing it wrong being a beginner.. but here is what I want.. I am trying to debug a stack overflow problem by printing a lot using "trace" commands. But it does not seem to seem to be printing in the expected order. so it has been misleading quiet a bit. Can somebody guide me as to how to modify the laziness of the program or some pointers on how to debug the stack overflow errors.
Woah, your code is way too complicated. I doubt that debugging support will help you much. My recommendation is to use abstract data types and to keep your functions much shorter. For instance, what is the type Integral a, Integral b => M.Map (Ratio a,Ratio a) b supposed to mean? Give it a descriptive name type Length = Ratio Integer -- coordinate type Node = Int -- unique id's for points type VoronoiSomething = M.Map (Length, Length) Node and create many small utility functions that operate on this new abstraction. One thing that strikes out is the repeated test M.valid . You should never need to call that. Likewise, you should never need to write or call a function validTrapeziaMap if you have made good use of abstract data types and the type system. Best regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com
participants (2)
-
Heinrich Apfelmus
-
Sunil S Nandihalli