Skip to content

Latest commit

 

History

History
17 lines (9 loc) · 872 Bytes

File metadata and controls

17 lines (9 loc) · 872 Bytes

Solutions to problems of chapter 14

Intermission: Short Exercise

In the Chapter Exercises at the end of Recursion, you were given this exercise:

Write a function that multiplies two numbers using recursive summation. The type should be (Eq a, Num a) => a -> a -> a although, depending on how you do it, you might also consider adding an Ord constraint.

If you still have your answer, great! If not, rewrite it and then write hspec tests for it.

The above examples demonstrate the basics of writing individual tests to test particular values. If you’d like to see a more developed example, you could refer to Chris’s library, Bloodhound.

Solution folder

Rest of exercises have been post poned to when I have learned Monads, Applicative, Functors and some other advanced subjects.