Friday, August 15, 2014

Practising recursion with accumulate, filter and map for deeply nested lists

I'm practising recursion going through some of the exercises in David Evans book Introduction to Computing, Explorations in Language, Logic, and Machines.

These are the solutions to three of those exercises:

  1. An accumulate (reduce) function for a list which can contain arbitrarily deeply nested lists.

  2. A map function for a list which can contain arbitrarily deeply nested lists.

  3. A filter function for a list which can contain arbitrarily deeply nested lists.

You can find these and other exercises and examples from the book in this GitHub repository.

I'm loving the book.

No comments:

Post a Comment