Effective Haskell: Chapter 8 truncateStatus

In the description of the algorithm for truncateStatus, the third bullet says “If the length of the status line is longer than the display, replace the last three characters in the status line with eclipses.” This isn’t exactly what’s happening: you also need to truncate the status line to fit within the width of the display. Suggest rephrasing to make this clearer (and align with the actual code).

Really enjoyed this chapter. The pager really is a great example for illustrating all kinds of things about IO. I also liked the discussion about mixing do and bind, and using <$> to combine expressions. These are good tips that will help reading code in the wild and writing idiomatic Haskell.

1 Like