News for hackers. Stuff that matters.
Re:Professor Frisby's mostly adequate guide to functional pr... by awinter-py on Sunday March 22, 2020 @03:24PM (#22657766)
ack sorry, I meant how to add a debug statement to an existing pure function

while still having it return the original value

EDIT per comment below, I totally misread this! yes exactly, traceShow ftw

You saved me another N hours

Re:Professor Frisby's mostly adequate guide to functional pr... by tome on Sunday March 22, 2020 @04:03PM (#22658107)
Isn't that exactly what unhammer is demonstrating?
Re:Professor Frisby's mostly adequate guide to functional pr... by awinter-py on Sunday March 22, 2020 @04:11PM (#22658189)
oops yes
Re:Professor Frisby's mostly adequate guide to functional pr... by smabie on Sunday March 22, 2020 @05:04PM (#22658635)
You could also use unsafePerformIO
Re:Professor Frisby's mostly adequate guide to functional pr... by tome on Monday March 23, 2020 @06:22AM (#22662570)
Really don't.
Re:Professor Frisby's mostly adequate guide to functional pr... by hopia on Sunday March 22, 2020 @07:04PM (#22659610)
In principle, you wouldn't do any logging, even debug logging, in a pure function. It always returns the same output for the same input anyway. You'd just check its output.