Returns a monad whose elements are the results of applying the given function to each element in this monad

 NOTE: normally aliased as +map+ when +Monad+ is mixed into a class
188502
def map_with_monad(lam = nil, &blk)
      bind { |v| self.class.unit((lam || blk).call(v)) }
    end
784620
function () {
        return function () {
          var args = Array.prototype.slice.call(arguments, 0);
          var sig = (function () {
            var ret = [];
            for (var i = 0, len = args.length; i < len; i++) {
              ret.push(toType(args[i]));
            }
            return ret;
          })().join('::');

          if (map[sig]) {
            if (map[sig].inject) args.unshift(input);
            return map[sig].fn.apply(ctx || null, args);
          }

          return input && input.apply(ctx || null, args);
        }
      }
650057
function mapObject(f, obj) {
  return reduce(function mapObjectExecute_(sum, v) {
    sum[v] = f(obj[v], v);
    return sum;
  }, objectKeys(obj), {});
}
1371124
def map(self, fn: Callable[[Any], Any]) -> 'Reader':
        
        """
        def _compose(x: Any) -> Any:
            try:
                ret = fn(self.run(x))
            except TypeError:
                ret = partial(fn, self.run(x))
            return ret
        return Reader(_compose)
539027
function mix(self, ref, expanded) {
	switch (typeof(ref)) {
		case 'undefined': return self;
		case 'function': return expanded ? ref : undefined;
		case 'object':
			if (isValueObject(ref)) return (ref !== null) ? ref.valueOf() : null;
			if (expanded && ((ref instanceof Promise) || (self instanceof Promise))) return ref;
			if (typeof(self) != 'object' || isValueObject(self)) self = {};
			Object.keys(ref).forEach(function(key) {
				self[key] = mix(self[key], ref[key], expanded)
			})
			return self
	}
	return ref;
}
1191879
function (a) {

      // inlined from peanut, maybe a micro-optimisation?
      var constant_a = function () { return a; };

      var self = function () {
        // can't Fun.constant this one
        return me;
      };

      var map = function (f) {
        return some(f(a));
      };

      var bind = function (f) {
        return f(a);
      };

      var me = {
        fold: function (n, s) { return s(a); },
        is: function (v) { return a === v; },
        isSome: always,
        isNone: never,
        getOr: constant_a,
        getOrThunk: constant_a,
        getOrDie: constant_a,
        or: self,
        orThunk: self,
        map: map,
        ap: function (optfab) {
          return optfab.fold(none, function(fab) {
            return some(fab(a));
          });
        },
        each: function (f) {
          f(a);
        },
        bind: bind,
        flatten: constant_a,
        exists: bind,
        forall: bind,
        filter: function (f) {
          return f(a) ? me : NONE;
        },
        equals: function (o) {
          return o.is(a);
        },
        equals_: function (o, elementEq) {
          return o.fold(
            never,
            function (b) { return elementEq(a, b); }
          );
        },
        toArray: function () {
          return [a];
        },
        toString: function () {
          return 'some(' + a + ')';
        }
      };
      return me;
    }
1096750
def compose(*fs):
    
    # Pull the iterator out into a tuple so we can call `composed`
    # more than once.
    rs = tuple(reversed(fs))

    def composed(n):
        return reduce(lambda a, b: b(a), rs, n)

    # Attempt to make the function look pretty with
    # a fresh docstring and name.
    try:
        composed.__doc__ = 'lambda n: ' + _composed_doc(fs)
    except AttributeError:
        # One of our callables does not have a `__name__`, whatever.
        pass
    else:
        # We already know that for all `f` in `fs`, there exists `f.__name__`
        composed.__name__ = '_of_'.join(f.__name__ for f in fs)

    return composed
808112
def map(self, fn: Callable[[Any], Any]) -> 'Cont':
        
        """
        return Cont(lambda c: self.run(compose(c, fn)))
566640
def _wrap_result(self, func):
        
        def wrapper(*args):
            result = func(*args)
            if hasattr(result, '__iter__') and not isinstance(result, etree._Element):
                return [self._wrap_element(element) for element in result]
            else:
                return self._wrap_element(result)
        return wrapper
948044
public final <R> R map(Function<? super T1, ? extends R> function) {
        return function.apply(v1);
    }
978829
def behavior(f):
    
    @wraps(f)
    def wrapper(*args):
        message = args[-1]
        if isinstance(message, MutableMapping):
            message = Message(message)
        f(*(args[:-1] + (message,)))
    return wrapper
1327850
public static <K, V, P> V getIfAbsentPutWith(
            Map<K, V> map,
            K key,
            Function<? super P, ? extends V> function,
            P parameter)
    {
        V result = map.get(key);
        if (MapIterate.isAbsent(result, map, key))
        {
            result = function.valueOf(parameter);
            map.put(key, result);
        }
        return result;
    }
587461
def flat_map(include_self = false, &block)
      result = []

      each_expression(include_self) do |exp, index|
        if block_given?
          result << yield(exp, index)
        else
          result << [exp, index]
        end
      end

      result
    end
637506
def representation_function_compiler(self, func_name):
        """"""

        def get_col_accessor(col):
            return ALCHEMY_TEMPLATES.col_accessor.safe_substitute(col=col)

        def get_col_evaluator(col):
            return ALCHEMY_TEMPLATES.col_evaluator.safe_substitute(col=col)

        col_evaluators = ", ".join([get_col_evaluator(n) for n in self.primary_keys])
        col_accessors = ", ".join([get_col_accessor(n) for n in self.primary_keys])

        return ALCHEMY_TEMPLATES.representor_function.safe_substitute(func_name=func_name,
                                                                      col_accessors=col_accessors,
                                                                      col_evaluators=col_evaluators,
                                                                      class_name=self.class_name)
1128948
public final <R> R map(Function5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R> function) {
        return function.apply(v1, v2, v3, v4, v5);
    }
1362095
def flat_map_t(func):
    
    return Transformation(
        'flat_map({0})'.format(name(func)),
        partial(flat_map_impl, func),
        {ExecutionStrategies.PARALLEL}
    )
405030
function(behavior) {
    return function(obj, iteratee, context) {
      var result = {};
      iteratee = _.iteratee(iteratee, context);
      _.each(obj, function(value, index) {
        var key = iteratee(value, index, obj);
        behavior(result, value, key);
      });
      return result;
    };
  }