Instructor: 00:01 One of the things that you may have noticed and that is slightly annoying is that every time that you add a field to your record, then you need to change which mapx function you use. We started using map2, and then, as we've added more fields, we're now using map6.
00:16 The other thing you might wonder is, "How many of these functions exist? If I have a record with 40 values, then would I use map40?" The answer is that the limit is eight. Json.decode has mapx functions up to map8. If you need a construct a record that combines more than eight decoders, you need to use a different library.
00:40 One solution is to use the json.extra package, which we've already imported, and to additionally expose this operator with the |:, which you should read apply or nmap. Then, rather than using map6, you use succeed. This effectively wraps your function that creates a user into a decoder that always succeeds.
01:06 Then you apply the other decoders with this operator |: . Let me save. You can see this works just as before. Furthermore, if you add the new field now, you don't need to change from, say, map6 to map7. Secondly, you no longer have this ceiling of eight fields maximum.