Aeson with types that have lots of "maybes", v2

The previous edition of this post was cleaned up by a suggestion from another Haskeller. I share it with you here.

Previously

The last article this is riffing off of

First, a new function thanks to this comment.

Here’s the old code

The new code speaks for itself, I think.

The moral of the story

Post your bad code. People will help you improve and you must not pass up that opportunity!

I know this site is a bit of a disaster zone, but if you like my writing or think you could learn something useful from me, please take a look at the Haskell book I've been writing. There's a free sample available too!