Hacker News new | past | comments | ask | show | jobs | submit login

You should study Haskell types. Debugging anything in Haskell without a basic understanding of the type system is daunting.

Additionally, Yesod relies heavily on quasiquoting and template haskell which can lead to some very cryptic code and errors. I generally prefer Snap for this reason and many others.




I find I spend most of my time on the engineering than in understanding types. (I recommend 'Types and Programming Languages by Pierce for general type stuff and Typeclassopedia for Haskell specific). Though I confess Yesod is the first real time I've seen quasiquoting and template haskell before. I haven't yet got a familiarity of what certain errors mean. 50% of the time when I get a compile error, the error message seems to be off on a complete tangent and is nowhere near where the actual error was.

Eg. I had some problem where a Data.Text was being passed into a function where Data.Text.Lazy was expected (Network.Mail.Mime.simpleMail for the record). The error message was deep in the internals of Data.Text.Lazy rather than in my code. I had to play a ridiculous pecking game of using undefine on each time I use Data.Text in turn in order to find which particular Data.Text was causing the error and then explicitly force one particular argument type to be a Data.Text.Lazy. I didn't feel like the compiler helped me at all.

Stepping through a program linearly doesn't seem possible (though not entirely sure why not) so I have no intermediate or step through capability. I also can't (normally) just stick in a println in the middle of a function or view the data structures at any particular point of the program. These are two tools I use all the time with Java and C#, but in Haskell I am rendered blind.


http://hackage.haskell.org/package/base-4.6.0.1/docs/Debug-T... is what you want to use for emitting debug text or debug data dumps.


Look into Debug.Trace for old-school println debugging.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: