mlms13 / bs-decode

Type-safe JSON decoding for ReasonML and OCaml
https://mlms13.github.io/bs-decode/docs/what-and-why
MIT License
103 stars 18 forks source link

Order of `fallback` arguments should be switched #138

Open mlms13 opened 1 year ago

mlms13 commented 1 year ago

Currently, fallback is let fallback: (decoder, fallbackValue) => decoder. If we switched the two arguments, it would make piping more intuitive, e.g.:

let roles = field("roles", list(Role.decode)) |> fallback([])