X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=exercises%2Fassignment8-9.mdwn;h=c41ee9baec98b62d115571ae6fc87fa97e104aca;hp=e6d24837152d055c60418c522bf980dd800a13b1;hb=356cd0ed65c71922aecc155ddab88896c4e0629d;hpb=df299f52afabeb6cadc607443b16e93a3aadb727 diff --git a/exercises/assignment8-9.mdwn b/exercises/assignment8-9.mdwn index e6d24837..c41ee9ba 100644 --- a/exercises/assignment8-9.mdwn +++ b/exercises/assignment8-9.mdwn @@ -33,7 +33,7 @@ you should be able to execute the following expression: # match eval t2 with Leaf (Num f) -> f 2 4;; - : int = 13 -2. Based on the evaluator code from the assignment from week 7, and what you've learned about the Reader monad, +2. Based on [[the evaluator code from assignment 7|/exercises/assignment7/#index3h2]], and what you've learned about the Reader monad, enhance the arithmetic tree code to handle an arbitrary set of free variables. Don't use Juli8 libraries for this; just do it by hand. Return to the original code (that is, before the modifications required by the previous problem). @@ -137,7 +137,7 @@ Return to the original code (that is, before the modifications required by the p -- substitute your own choices for the type Env and value env0 let { xx :: ReaderT Env Maybe Int; xx = return 1 } in runReaderT xx env0 - Okay, here are some questions about various monad transformers. Use OCaml to help you answer them. Which combined monad has the type of an optional list (that is, either `None` or `Some [...]`): an Option transformer wrapped around an underlying List monad, or a List transformer wrapped around an underlying Option monad? Which combined monad has the type of a function from `store`s to a pair `('a list, store)`: a List transformer wrapped around an underlying State monad or a State transformer wrapped around an underlying List monad? + Okay, here are some questions about various monad transformers. Use OCaml or Haskell to help you answer them. Which combined monad has the type of an optional list (that is, either `None` or `Some [...]`): an Option transformer wrapped around an underlying List monad, or a List transformer wrapped around an underlying Option monad? Which combined monad has the type of a function from `store`s to a pair `('a list, store)`: a List transformer wrapped around an underlying State monad or a State transformer wrapped around an underlying List monad? The last two problems are non-monadic.