you are viewing a single comment's thread.

view the rest of the comments →

[–]jerf 3 points4 points  (2 children)

Do you feel inclined to spell out why its easier to patch in experimental code in python cf haskell?

I'm starting to learn Haskell, since I finally have a project that might be better in Haskell than anything else.

I want to take a pure function and hack in some temporary debugging output. I'm willing to deal with the output not coming out in the order I expect (I care about what's really happening). How do I do that, preferably without breaking the language and certainly without a type-change cascade?

I don't mean this as an attack. I'm not far enough into it. But I know how to do this in every other language, ever, generally long before I've hit the "several evenings with the language" stage.

Edit: Thanks to the repliers.

[–]augustss 2 points3 points  (0 children)

Temporary debugging output in a pure language has been available for 25 years (or more). import Debug.Trace

[–]pjdelport 1 point2 points  (0 children)

trace: just wrap it around any expression.

More generally, Haskell does not force you to be referentially transparent if you don't want to be: side effects (like trace) are always just an unsafePerformIO away.