Efficiency in Haskell

I constantly worry about efficiency in my haskell code. Lazy evaluation helps here. Many algorithms that look like they loop repeatedly are actually linear because of haskell’s laziness. Recursive string manipulations that return concatenated strings are usually linear despite strings being represented as linked lists. Laziness helps you avoid needleesly higher order implementations but has its own costs in memory allocation. Haskell’s own Show class implements conversions to strings using a tail recursive showsPrec function instead of a lazily concatenating strings. The lazy functions are prettier though.

Container types can be horribly inefficent in haskell. I am trying to learn to use the ST monad to avoid unnecessary copying. This drops me back into an imperative world-view for the duration of the ST run.

Worrying about efficiency changes the way you think about the overall structure of your programme. Not necessarily for the better. These are not genuine concerns about higher order algorithms but about not implementing lower order algorithms properly.