Lists are used in Elm to represent sequences of data. The List library comes with a toolbox of useful functions. Here we cover list transformation (map), and getting single values from lists (fold).
In this case, I wanted to get a particular single result from the list, which is what a fold is designed for, taking a list and turning it into just one value. Filter takes a list, and returns a different list, so that wasn't quite what I wanted. If you didn't want to use
foldl, you could
filter, and then use
List.head on the result of the filter to get the first item from the filtered result.