Displaying # of reductions after each computation in ghci?

Hi, Is there a way to configure ghci to display the number of reuctions after each compution (as in winhugs)? Thanks!

On Tue, Jan 08, 2008 at 09:48:37PM +0000, Fernando Rodriguez wrote:
Is there a way to configure ghci to display the number of reuctions after each compution (as in winhugs)?
No. (rambling explanation snipped awaiting further request) Stefan

stefanor:
On Tue, Jan 08, 2008 at 09:48:37PM +0000, Fernando Rodriguez wrote:
Is there a way to configure ghci to display the number of reuctions after each compution (as in winhugs)?
No.
Kind of, since you probably just want stats, not some notion of reductions: Prelude> :set +s Prelude> last [1..1000000] 1000000 (0.05 secs, 87390328 bytes) -- Don

What is a reduction anyway?
On Jan 8, 2008 2:48 PM, Fernando Rodriguez
Hello Stefan O'Rear,
No.
(rambling explanation snipped awaiting further request)
Stefan
OK, I'll take the bait: why not?
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

"Lennart Augustsson"
What is a reduction anyway?
() -> o -> . -> -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited.

Lennart Augustsson wrote:
What is a reduction anyway?
I am not an expert but I thought in lambda calculus one has primitive rules for evaluation, e.g. beta reduction. So a reduction is a 'smallest step' in reducing an expression to normal form, no? Cheers Ben

Ben Franksen wrote:
Lennart Augustsson wrote:
What is a reduction anyway?
I am not an expert but I thought in lambda calculus one has primitive rules for evaluation, e.g. beta reduction. So a reduction is a 'smallest step' in reducing an expression to normal form, no?
Yes and no, a single beta reduction step like (\x.c(d(e(f(x))))) g => c(d(e(f(g)))) may take 5 steps in some reduction strategies since you have to walk down the expression tree to find the variable and replace it with its value. In the end, seconds are a better measure for time :) Regards, apfelmus

In lambda calculus you can take a beta reduction as the step.
But Haskell is not normally implemented by lambda calculus so you have to
pick something else.
There are measures of reduction that you can come up with but they will
vary, e.g., by compiler, optimization level, etc.
I think time is a much more interesting measure, since that's what you
really care about in the end.
On Jan 14, 2008 2:03 PM, Ben Franksen
Lennart Augustsson wrote:
What is a reduction anyway?
I am not an expert but I thought in lambda calculus one has primitive rules for evaluation, e.g. beta reduction. So a reduction is a 'smallest step' in reducing an expression to normal form, no?
Cheers Ben
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (7)
-
Achim Schneider
-
apfelmus
-
Ben Franksen
-
Don Stewart
-
Fernando Rodriguez
-
Lennart Augustsson
-
Stefan O'Rear