bos/aeson — comment on commit 461d898948418c9092edd3d9e1e13a662f43eddd
File:  line 0
By hvr:

jfyi, I've been using the following combinator-like approach throughout my code for the last months. I tried first with a `.:/`-like approach, but it didn't feel right to me.

```haskell
-- |Helper for use in combination with '.:?' operator
(.!=) :: Parser (Maybe a) -> a -> Parser a
(.!=) p dfl = fromMaybe dfl <$> p
{-# INLINE (.!=) #-}
```

This allows code to be written in a ternary-operator style such as:

```haskell
do
v1 <- o .:? "opt_field_with_dfl" .!= "default_val"
v2 <- o .: "mandatory_field"
v3 <- o .:? "opt_field2"

-- whereas the `.:/` operator looks weird in comparision:
v1' <- o .:/ ("opt_field_with_dfl", "default_val")
```