411 REFERENCE · Wikibooks
99 Elm Problems/Problem 4/Solutions
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Solution 1: Recursive version
myLength list =
case list of
[] -> 0
head :: tail -> 1 + myLength tail
Solution 2: Using List.foldl
myLength = List.foldl (\_ b -> b + 1) 0