Question
Verify the monad laws for the list type. Hint: the proofs can be completed using simple properties of list comprehensions.
Step 1
In the case of the list type, `return` is equivalent to wrapping a value in a singleton list, and `>>=` is equivalent to applying a function to each element of a list and concatenating the results. So, let's start with `return a >>= f`. This can be written as Show more…
Show all steps
Your feedback will help us improve your experience
Watch the video solution with this free unlock.
EMAIL
PASSWORD