Exercises
Do:
Write a test for odd length lists.
Practice our pattern matching and rewrite our
mergesort
to use pattern matching.Rewrite our
quicksort
example from Chapter 3, Modules and Functions – Creating Functional Building Blocks, usingif
,case
, andcond
.Advanced: Write a test for our
mergesort
that uses ourStream.repeatedly
... pipe andEnum.sort/1
to make sure ourmergesort
really, really works. The result of this would be a step in the right direction for fuzz testing.