[GHC] #13037: Single-Stepping evaluation in GHCi

GHC ghc-devs at haskell.org
Tue Dec 27 04:58:08 UTC 2016


#13037: Single-Stepping evaluation in GHCi
-------------------------------------+-------------------------------------
        Reporter:  vanto             |                Owner:
            Type:  feature request   |               Status:  closed
        Priority:  normal            |            Milestone:
       Component:  GHCi              |              Version:  8.0.1
      Resolution:  invalid           |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Iceland_jack):

 You can get somewhat close using libraries like
 [https://hackage.haskell.org/package/simple-reflect-0.3.2/docs/Debug-
 SimpleReflect.html simple-reflect] (or
 [https://hackage.haskell.org/package/ap-reflect ap-reflect])

 {{{
 > import Debug.SimpleReflect
 > g op n [] = n ; g op n (h:t) = h `op` g op n t
 > g (*) 2 [1..3] :: Expr
 1 * (2 * (3 * 2))
 }}}

 you can even `reduce`

 {{{
 > reduce (g (*) 2 [1..3])
 1 * (2 * 6)
 > reduce (reduce (g (*) 2 [1..3]))
 1 * 12
 > reduce (reduce (reduce (g (*) 2 [1..3])))
 12
 }}}

 {{{
 > traverse_ print $ reduction (g (*) 2 [1..3])
 1 * (2 * (3 * 2))
 1 * (2 * 6)
 1 * 12
 12
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13037#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list