Stream: beginners

Topic: How to parse tag unions from JSON?


view this post on Zulip notramo (Nov 15 2026 at 23:11):

A server returns a JSON payload:

null | string | Array<object>

How to deserialize this in Roc into the following?

Body := [
  Empty,
  Content(Str),
  Multipart(List(ContentPart)),
]

Last updated: Nov 26 2026 at 20:35 UTC