
Tech
Break the Loop, Part 4: Functional Programming With Trees, Monads, and Lazy Evaluation
We close the series by working with binary search trees end to end. Two functions — printTree and treeToList — solve opposite problems using the same recursive pattern: follow the shape of the data. Along the way we meet IO actions and see how changing the order of three lines switches between printing a rotated tree and returning a sorted list.
Read the full discussion on HackerNoon
This article was aggregated from HackerNoon. Click to join the conversation.
View on HackerNoon