Starting from:

$20.99

CS350-Homework 4 Solved

. Prove that the Maybe Monad satisfies the monadic laws. [10]
. Prove that the List Monad satisfies the monadic laws. [10]
. Write a memoized version of the function to compute the nth Fibonacci number. Assume that the first Fibonacci number is 1. Hint: Use an appropriate monad. [10]
. Write an interactive function which takes a sequence of non-negative integers as input, one on each line. The end of sequence occurs when the user inputs -1. You should output the sum of the non-negative integers.
a . Do the above exercise using the do notation in Haskell.
[10]
b . Do the same exercise, without using the do notation.
[10]

More products