showing execution steps

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

showing execution steps

Luc Duponcheel
Hi,

Is there a way to let ghci (or executable code generated by ghc)
show all intermediate rewrite results when an expression 
is evaluated to its final result?

Luc

--
   __~O
  -\ <,
(*)/ (*)

reality goes far beyond imagination

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: showing execution steps

Henning Thielemann

On Mon, 5 Oct 2020, Luc Duponcheel wrote:

> Is there a way to let ghci (or executable code generated by ghc)
> show all intermediate rewrite results when an expression 
> is evaluated to its final result?

I don't know the answer for GHCi - but for an extremely simple subset of
Haskell that is non-strict but lacks sharing, you may try our
live-sequencer:

    https://www.youtube.com/watch?v=0EQCgi5qa3E

    https://hackage.haskell.org/package/live-sequencer
    https://sim.mathematik.uni-halle.de/henning/flatpak/bundle/live-sequencer-0.0.6.2.x86_64.flatpak
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: showing execution steps

Francesco Ariis
In reply to this post by Luc Duponcheel
Hello Luc,

Il 05 ottobre 2020 alle 00:24 Luc Duponcheel ha scritto:
> Is there a way to let ghci (or executable code generated by ghc)
> show all intermediate rewrite results when an expression
> is evaluated to its final result?

Do you mean the «rewrite rules» [1]? If so, -ddump-rules.

If you instead mean how expressions are evaluated step by :step
and :list can be used inside ghci [2]

Even better in my opinion is the `debug` [3] package which gives you a nice and
interactive HTML page with all the steps.


[1] https://downloads.haskell.org/~ghc/7.0.3/docs/html/users_guide/rewrite-rules.html
[2] https://downloads.haskell.org/~ghc/7.0.3/docs/html/users_guide/ghci-debugger.html
[3] https://github.com/ndmitchell/debug/
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.