v0.5.0
This release focuses on cleaning up our public API and our internal tooling. Additionally, decoders are easier to compose, so you should be able to do more mapping/flatMapping on the decode functions directly (before running the decoders), instead of needing to transform the output (after running the decoders).
🚨 Breaking
oneOfnow takes a single decoder, followed by a list of decoders instead of requiring you to construct aNonEmptyList(#28)Decode.okhas been removed, if you want to construct a decoder that always succeeds (ignoring the JSON input), useDecode.pureinstead.- Decoders that produce
NonEmptyLists of errors now useRelude.NonEmpty.Listinstead of the implementation frombs-nonemptydue to more active maintenance and a broader collection of helper functions D.ResultUtilsis no longer part of the public interface. Decode functions themselves are more easily composable (see "New stuff" below), so there's less need to transform the output after decoding. Plus better libraries exist if you want to work withoptionandresulttypes. (#33)
✨ New stuff
- Decoders (the functions from
Js.Json.ttooptionorResult.t) now havemap,apply,map2...map5, andflatMapfunctions, meaning you can transform decoders before actually running them. (#23) D.NonEmptyListis exposed for all decode modules that return aNonEmptyListof errors. This means you can do basic operations with the errors without bringing in an additional library (#24)D.Pipelinealiases most of the base decoders (e.g.string,intFromNumber, etc), so locally-openingD.Pipelineshould get you everything you need (#27)
✔️ Internal cleanup
- Internal use of infix functions has been greatly reduced to improve code clarity
- Tests have fewer global opens and fewer aliased functions