-- generated file, do not modify! -- {{ dateTime }} module {{ moduleName }}Encode where {% for t in definitions %} instance encodeJson{{ t.value.dataName }} :: EncodeJson {{ t.value.dataName }} where encodeJson v = case v of{% for c in t.value.constructors %}{% if c.value.fields | hasFieldNames %} {{ c.value.name }} r -> "tag" := "{{ c.value.name }}" ~>{% for f in c.value.fields %} "{{ f.value.fieldName }}" := r.{{ f.value.fieldName }} ~>{% endfor %} jsonEmptyObject{% else %} {{ c.value.name }}{% for f in c.value.fields %} arg{{ f.index0 }}{% endfor %} -> "tag" := "{{ c.value.name }}"{% for f in c.value.fields %} ~> "arg{{ f.index0 }}" := arg{{ f.index0 }}{% endfor %} ~> jsonEmptyObject{% endif %}{% endfor %} {% endfor %}