Prevent Impossible States with JSON Decoders in Elm

4 Likes

The part how it proposes to do the decoding with different constructors of a custom type is interesting.

In general the problem is the typical problem, how to encode tagged sum types in languages that don’t have them. In this case json. What status is in this example is often called kind or type. See https://github.com/gcanti/fp-ts/blob/master/fp-ts-for-purescripters.md#data

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.