I have learned that point-free style is preferred in the Haskell community, and I often write expressions like this:
naive = (slugifyUnicode . T.take maxFilenameSize . T.pack . stripHtmlTags . T.unpack . plainToHtml) sfld
However, while debugging, I find myself repeatedly converting expressions like this into chains of $ operators in order to use some variant of trace, and I am starting to think it is preferable to forgo the point-free style and just write lots of $s to start with, in order to make debugging less cumbersome. After all, it ends up being about the same number of characters.
Does anyone know of a way to debug long chains of composed functions without de-composing them?
And more generally, any comments on this inconvenience are very welcome.
f . g . h $ xworks as expected and is quite idiomatic.naivelook like after you un-point-free'd it and inserted atrace?whereclause,traceit there, and then do the rest of the computation at the original site of the expression.