Json.Decode tricks: decode 8+ fields and nested sub-objects

Suppose you have some JSON that describes map markers:

"name": "Rixos The Palm Dubai",
"lat": 25.1212,
"lon": 55.1535

Using Json.Decode, the decoder for this JSON looks like this:

decodeMarker : Json.Decode.Decoder Marker
decodeMarker =
Json.Decode.map3 Marker
(field "name" Json.Decode.string)
(field "lat" Json.Decode.float)
(field "lon" Json.Decode.float)

If your JSON acquires another field (say, marker color), you need to add one more field decoder ((...