O'Reilly logo

Programming Elm by Jeremy Fairbank

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required