Claus and Evan ++; that was very helpful.
FWIW, my gut feeling is that Claus's first version was easier to
understand than the revision with printf, which seems to me to involve
a lot more monadic wizardry (Functor, MonadError, fmap, mapm). The
first version, which just used maybe, was clear to me within seconds.
But again, I learned a lot. Thanks.