Monads/Writer monad: Difference between revisions

Content added Content deleted
Line 37:
 
// DERIVE LOGGING VERSIONS OF EACH FUNCTION
 
function loggingVersion(f, strLog) {
return function (v) {
Line 68:
// to the contents of a wrapped value
// and return a wrapped result (with extended log)
 
// Writer a -> (a -> Writer b) -> Writer b
function writerBind(w, f) {
Line 90:
 
var half_of_addOne_of_root = function (v) {
return logCompose([log_half, log_addOne, log_root], v);
};