3 ms·
Eventlog is just `unsafePerfemIO*`, so you could just use that instead and not "hide" it and feel better about that. The "correct" answer to `foldl` would be `
by ReleaseCandidat 3y ago
Eventlog is just `unsafePerfemIO*`, so you could just use that instead and not "hide" it and feel better about that.
The "correct" answer to `foldl` would be `scanl` and printing the result of it.
https://hackage.haskell.org/package/base-4.18.0.0/docs/Prelude.html#v:scanl https://hackage.haskell.org/package/base-4.18.0.0/docs/Prelu...
- thesz 3y agoEventlog traces are RTS calls wrapped into unsafePerformIO, you are right. The trace part of eventlog is optimized for, well, tracing and is very, very lightweight. It is also safe from races, whereas simple unsafePerformIO (putStrLn $ "did you meant that? " ++ show (a,b,c)) is not. In my opinion, eventlog traces make much better logging than almost anything I've seen. Right now, developing with C++, I miss the power of Haskell's RTS.
- ReleaseCandidat 3y agoThe point I was trying to make was, that if all you want/need is a `putStr`, just use `unsafePerformIO`. Haskell's (GHC's) Eventlog is nice, but a binary format and not comparable to text output.