This Lesson is for PRO Members

Subscribe today and get access to all lessons! Plus direct HD download for offline use, enhances transcripts, member comment forums, and iTunes "podcast" RSS feed. Level up your skills now!

Unlock This Lesson

Already subscribed? Sign In

Autoplay
Hide playlist

    Decode a JSON Category Tree or Navigation Tree into Elm

    Some of our JSON data may have a recursive structure, especially trees such as the navigation trees or category trees that feature on many websites. When writing a decoder for a type with a recursive structure, you need to use the lazy function, to avoid defining a decoder in terms of itself, which would cause an infinite loop.

    This lesson assumes you're familiar with recursively defined union types in Elm.

    You must be a Member to view code