Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I determine when an expression is evaluated?

I've recently been learning haskell, and I understand the concept of lazy evaluation in general. One thing that I've discovered though is that it's often difficult to reason about exactly when an expression will be evaluated.

Is there a good way for getting information about precisely what is going on in terms of evaluation? Ideally I'd like to see something like a stack trace or a dependency list that shows when an expression needed to be evaluated, and what other expressions it depended on had to be evaluated.

like image 749
Cercerilla Avatar asked Mar 17 '11 18:03

Cercerilla


1 Answers

See here for an example of GHCi debugger session.

like image 172
horsh Avatar answered Oct 28 '22 06:10

horsh