I'd write that, in the most generic case, something like:
projNameStr :: T24Report -> String
projName t24 = fromMaybe "" $ do
title <- projTitle $ project t24
zip title
The key point is using a do
block to factor out handling all of the Nothing
cases.
However, in this specific case, since there are only the two Maybe
s in the chain, I'd be tempted to shorten it a bit:
projNameStr :: T24Report -> String
projName t24 = fromMaybe "" $ projTitle (project t24) >>= zip
That's exactly what the previous example is converted to during compilation. Usually that sort of manual desugaring makes things worse, not better. But in this case, I would be tempted to go with this, just because it's a couple lines shorter and not too much more work to read.