@hyperrealgopher And this is why I prefer do notation over applicative.
But at least the body of that case can be extracted from the expression.
And with for instead of traverse `makeRenderAs` could be a \case in a final position.
(o .:? "renderAs" >>= renderAsP)
renderAsP = traverse \case
String "menu" ->
It is sometimes beneficial to try `for` instead of `traverse`.
@dpwiz I didn't want to have `makeRenderAs` handle the type plumbing of the `Maybe`, was my rationale. That is an interesting way of handling the issue, though (putting everything in `traverse`). Thank you for sharing!
@hyperrealgopher I regularly use Foldable, Traversable and other well-known instances of Maybe and Either. It is liberating to think in instance methods instead of making a fuss about some stuff being a Monad.
Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.