Monads/Writer monad: Difference between revisions
→ES5
(→ES5) |
(→ES5) |
||
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);
};
|