Source: functional_utils.js

// Generated by CoffeeScript 1.10.0

/**
 * @module functional_utils
 */
var t;

t = this;

this.compose = function(f, g) {
  return (function(_this) {
    return function() {
      var args;
      args = Array.prototype.slice.call(arguments);
      return f(g.apply(_this, args));
    };
  })(this);
};

this.createLiftFunctions = function(arg) {
  var unwrap, wrap;
  wrap = arg.wrap, unwrap = arg.unwrap;
  return {
    liftInput: function(f) {
      return function(i) {
        return f(unwrap(i));
      };
    },
    lift1: function(f1) {
      return function(i) {
        return wrap(f1(unwrap(i)));
      };
    },
    lift2: function(f1) {
      return function(i1, i2) {
        return wrap(f1(unwrap(i1), unwrap(i2)));
      };
    },
    lift2Infix: function(f2) {
      return function(i2) {
        return function(i1) {
          return wrap(f2(unwrap(i1), unwrap(i2)));
        };
      };
    },
    liftAllOutputs: function(f) {
      return function(i) {
        var k, outputs, v, wrappedOutputs;
        outputs = f(unwrap(i));
        wrappedOutputs = {};
        for (k in outputs) {
          v = outputs[k];
          wrappedOutputs[k] = wrap(v);
        }
        return wrappedOutputs;
      };
    }
  };
};