Putting It All Together

In many cases, processing your sequential data will follow a similar pattern:

  1. Figure out what question you’re trying to ask. This step is often the most difficult, as it sits in the problem or business domains. Once you have a clear question, Clojure provides the tools to process the data you have into an answer. That’s the next three steps.

  2. Filter the data to remove unneeded elements.

  3. Transform the elements into the desired form.

  4. Reduce the transformed elements to the answer.

Let’s set the stage using a shopping cart example. In an online store, you have a catalog—a list of items for sale. These items are divided into departments. Customers place them in their carts, then check out. This process creates a billing record. ...

Get Clojure Applied now with O’Reilly online learning.

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