From: Chris Date: Wed, 8 Apr 2015 16:50:27 +0000 (-0400) Subject: edits X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=commitdiff_plain;h=a2294b4df1fd5cab018bf234ab107f05ce54bc3e;hp=15cf1a049393b9087a14cccf4dd83dc1ebc76825 edits --- diff --git a/code/Juli8-v1.5.tgz b/code/Juli8-v1.5.tgz new file mode 100644 index 00000000..705ca626 Binary files /dev/null and b/code/Juli8-v1.5.tgz differ diff --git a/index.mdwn b/index.mdwn index 8f4a410f..5e1c25da 100644 --- a/index.mdwn +++ b/index.mdwn @@ -167,9 +167,11 @@ Practical advice for working with OCaml and/or Haskell (will be posted someday); (**Week 9**) Thursday April 2 -> Updated notes on [[Installing and Using the Juli8 Libraries|/juli8]] on Sun 5 April. The major change is to make the Monad libraries easier to use. Now you can just use `Monad.Reader(struct type env = ... end)`; you don't need to furthermore ask for the `M` submodule of that generated module. Relatedly, the `List` and `Monad.List` modules are now different; the former has lots of list-related functions and the latter only the monadic interface. Similarly for `Option` and `Monad.Option`. +> Updated notes on [[Installing and Using the Juli8 Libraries|/juli8]] on Sun 5 April. Continued to fix some bugs and improve the monad transformers. Latest version posted Tuesday evening, 7 April: [[v1.5|/code/Juli8-v1.5.tgz]]. -> Small bug fix to Juli8 on Mon 6 April. + > Topics: [[Using the OCaml Monad library|/topics/week9_using_the_monad_library]]; [[Programming with mutable state|/topics/week9_mutable_state]]; [[A State Monad Tutorial|/topics/week9_state_monad_tutorial]]; [[Using multiple monads together|/topics/week9_monad_transformers]]; [[Homework for weeks 8-9|/exercises/assignment8-9]] diff --git a/juli8.mdwn b/juli8.mdwn index b12de035..b60816d2 100644 --- a/juli8.mdwn +++ b/juli8.mdwn @@ -91,7 +91,7 @@ Below, we'll give instructions on how to install Juli8 into your existing OCaml #use "juli8.ml";; -4. Next create a folder in your `$HOME` directory named `.juli8`. **Download the Juli8 code from [[here|/code/Juli8-v1.4.tgz]].** That link will no doubt be updated frequently in April and May 2015. The current version is: 1.4, posted 6 April 2015. Copy the contents of the `Juli8` folder that you downloaded into the `$HOME/.juli8` folder that you created. (So `$HOME/.juli8` should contain folders `haskell`, `ocaml`, and so on.) +4. Next create a folder in your `$HOME` directory named `.juli8`. **Download the Juli8 code from [[here|/code/Juli8-v1.5.tgz]].** That link will no doubt be updated frequently in April and May 2015. The current version is: 1.5, posted 7 April 2015. Copy the contents of the `Juli8` folder that you downloaded into the `$HOME/.juli8` folder that you created. (So `$HOME/.juli8` should contain folders `haskell`, `ocaml`, and so on.) Now whenever you start up OCaml, the Juli8 OCaml libraries (including their monad components, which we'll be making extensive use of) will automatically be loaded. diff --git a/topics/week8_monads_and_modules.mdwn b/topics/week8_monads_and_modules.mdwn index e7372d3d..2737ed56 100644 --- a/topics/week8_monads_and_modules.mdwn +++ b/topics/week8_monads_and_modules.mdwn @@ -539,7 +539,7 @@ Here is some code showing how to generate the common monad modules, and also som module S = Monad.State(struct type store = int end) (* or any other implementation of stores *) S.(get,gets,put,modify) (* same additional interface as Haskell has; we'll explain them later *) module Ref = Monad.Ref(struct type value = string end) (* this is essentially a State monad, but with a different interface *) - Ref.(newref,deref,change) + Ref.(newref,getref,putref) module W = Monad.Writer(struct type log = string let empty = "" let append = (^) end) (* or any other implementation of logs *) W.(listen,listens,tell,censor) module E = Monad.Error(struct type err = string exception Exc = Failure end) (* or other specifications of type err and exception Exc of err *) diff --git a/topics/week9_monad_transformers.mdwn b/topics/week9_monad_transformers.mdwn index ff47d06a..f9da05ad 100644 --- a/topics/week9_monad_transformers.mdwn +++ b/topics/week9_monad_transformers.mdwn @@ -151,31 +151,28 @@ When Option is on the inside, on the other hand, as in SO, failure means the who Exception: Failure "bye". --> -