I'm looking for a way to decode a tuple with two elements in elm.
[[String, Bool]]
The outer list is easy enough to parse with Json.list, but how do I decode the array as a tuple ? I tried the solution from Decode a JSON tuple to Elm tuple but all I get is errors about types of Decoder and Maybe, I assume something changed in elm since that answer. Or maybe I'm missing an import, I don't know.
Thanks
simplest is
map2 (,) (index 0 string) (index 1 string)
As of elm 0.19 use:
map2 (Tuple.pair) (index 0 string) (index 1 string)
https://github.com/elm/compiler/blob/master/docs/upgrade-instructions/0.19.0.md#changes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With