I have created a small Roc library for doing Elm-style JSON decoding. The word "Decoder" was already taken in Roc :) , so you make Recipes in this library that describe how you want to try to decode the JSON. Those Recipes can then be used to decode bytes, Strs, or even JSON Values (a data type in this library, for valid-but-unknown JSON).
The API is basically Elm's Json.Decode, with a few helpers from Elm's Json.Decode.Extra. It also has functions for making JSON Values, so it can be used similarly to Elm's Json.Encode.
This uses lukewilliamboswell/roc-json under the hood for the actual serialization/deserialization. If you can just use that directly, you should! But if you find yourself needing to decode variably shaped JSON, then I hope this library can be useful to you.
Awesome! I had been thinking recently about how it would be great to have this
Last updated: Nov 28 2025 at 12:16 UTC