[GHC] #9795: Debug.Trace.trace is too strict

GHC ghc-devs at haskell.org
Fri Feb 13 21:07:31 UTC 2015


#9795: Debug.Trace.trace is too strict
-------------------------------------+-------------------------------------
        Reporter:  jcpetruzza        |                   Owner:
            Type:  bug               |                  Status:  patch
        Priority:  normal            |               Milestone:  7.12.1
       Component:  libraries/base    |                 Version:  7.8.3
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:  Phab:D654
-------------------------------------+-------------------------------------

Comment (by thomie):

 My reasoning was: `withCString`, and in turn `debugBelch`, need the
 complete string to be present before printing can start. `hPutStrLn` on
 the other hand prints character for character. So it's not about `trace`
 being lazy or not, but how it handles (possibly infinite) lazy strings.

 There are some problems however:
 * with my patch, traceIO would handle lazy strings differently on non-
 Windows vs. Windows.
 * traceEventIO and traceMarkerIO still don't handle lazy strings. Both
 emit to the eventlog, for which (I'm guessing) the complete string needs
 to be ready as well .

 Maybe we should keep things the way they are. Although surprising, at
 least the story is consistent over all `trace` functions.

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


More information about the ghc-tickets mailing list