Hacker News new | ask | show | jobs
by progman 4355 days ago
I just started to work with Haskell seriously, and after some trouble I discovered exactly the same development approach as DerpDerpDerp. However since I am not yet experienced I wish I had an "observer" to print debug messages (I know that there is a debugger in EclipseFP but I prefer Emacs for performance reasons). With observer I mean a compiler pragma that lets me print Haskell values without violating the functional nature of the code.

By the way, you don't need to live without static typing in Lisp. Shen provides a powerful type-safe layer on top of Lisp.

http://www.shenlanguage.org/learn-shen/types/types_functions...

2 comments

If you want to be pure, you can add a strict WriterT to your monad stack, or something similar.

If you don't mind temporary impurity, Debug.Trace provides some helper functions, but they call unsafePerformIO, which can do unexpected things.

Sounds like you're looking for the Debug.Trace module
Thanks, I'll take a look at it.