Generate a Json.Decode.map function based on the number of expressions passed.
If there are 8 or less items in the passed list, this function will return a call to a native Json.Decode.mapX
function (X being the number of passed arguments). If there are more than 8 arguments, a custom jsonDecodeMapX
function will be returned along with its declaration.
The generated type is returned by the
generatefunction. If there is no built-inJson.Decodefunction in theelm-lang/jsonpackage, a declaration will be returned. This should be put somewhere in the generated code!The returned declaration field is a
Dictto avoid duplicate declarations when callinggeneraterecursively. You can useDict.unionto combine different generated declarations to ensure no duplicates.