Traverse Large Lists

Whenever you fine-tune function performance, make sure you test different inputs, especially inputs you expect in production. One input’s results may lead you to accept an implementation that performs worse on realistic inputs. In the case of dog names, you should ensure that dogNamesFilterMap performs well with larger animal lists.

In this section, you will benchmark the “dog names” code with various list sizes. You will learn about the list data structure, learn how to describe algorithm runtimes with Big O notation, discover recursion, and use list folding to write a faster dogNames implementation.

What’s in a List

I briefly compared lists to chains in Chapter 1, Get Started with Elm. Each list element “links” to the ...

Get Programming Elm now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.