foldMap :: Foldable f, Semigroup s => (a -> s) -> f a -> s
761908
function foldMap(fn, m) {
  if(!isFunction(fn)) {
    throw new TypeError(
      'foldMap: Function returning Semigroups of the same type required for first argument'
    )
  }

  if(isArray(m)) {
    return _array.foldMap(fn, m)
  }

  if(m && isFunction(m.foldMap)) {
    return m.foldMap(fn)
  }

  throw new TypeError(
    'foldMap: Non-empty Foldable with at least one Semigroup required for second argument'
  )
}
1119460
def flatMap(self, f, preservesPartitioning=False):
        
        return self.mapPartitions(
            lambda p: (e for pp in p for e in f(pp)),
            preservesPartitioning,
        )
1324057
public final <U2> Tuple4<T1, U2, T3, T4> map2(Function<? super T2, ? extends U2> function) {
        return Tuple.tuple(v1, function.apply(v2), v3, v4);
    }
189869
function find(fn, foldable) {
  if(!isFunction(fn) && !isSameType(Pred, fn)) {
    throw new TypeError('find: Pred or a predicate function is required for first argument')
  }

  if(!isFoldable(foldable)) {
    throw new TypeError('find: Foldable required for second argument')
  }

  const result = foldable.reduce(accumulator(fn), { found: false })

  return result.found ? Just(result.value) : Nothing()
}
188502
def map_with_monad(lam = nil, &blk)
      bind { |v| self.class.unit((lam || blk).call(v)) }
    end
813013
function map(fn, list) {

   return list
            ? cons(fn(head(list)), map(fn,tail(list)))
            : emptyList
            ;
}
579745
private Node tryFoldInstanceof(Node n, Node left, Node right) {
    checkArgument(n.isInstanceOf());

    // TODO(johnlenz) Use type information if available to fold
    // instanceof.
    if (NodeUtil.isLiteralValue(left, true)
        && !mayHaveSideEffects(right)) {

      Node replacementNode = null;

      if (NodeUtil.isImmutableValue(left)) {
        // Non-object types are never instances.
        replacementNode = IR.falseNode();
      } else if (right.isName()
          && "Object".equals(right.getString())) {
        replacementNode = IR.trueNode();
      }

      if (replacementNode != null) {
        n.replaceWith(replacementNode);
        reportChangeToEnclosingScope(replacementNode);
        markFunctionsDeleted(n);
        return replacementNode;
      }
    }

    return n;
  }
1230146
def flat_map(iterable, func):
    """"""
    results = []
    for element in iterable:
        result = func(element)
        if len(result) > 0:
            results.extend(result)
    return results
1188219
function foldl (iter, binaryFn, seed) {
    var state, element;
    if (seed !== void 0) {
      state = seed;
    }
    else {
      state = iter();
    }
    element = iter();
    while (element != null) {
      state = binaryFn.call(element, state, element);
      element = iter();
    }
    return state;
  }
10776
function foldR1(fn, list) {
      
   return tail(list) 
            ? fn(foldR1(fn, tail(list)), head(list))
            : head(list)
            ;
}
1286420
function map ( input, inputMin, inputMax, outputMin, outputMax, clamp, ease ) {
    input = ( input - inputMin ) / ( inputMax - inputMin );
    if ( ease ) {
        input = ease(input);
    } 
    var output = input * ( outputMax - outputMin ) + outputMin;
    if ( !!clamp ) {
        if ( outputMax < outputMin ) {
            if ( output < outputMax ) {
                output = outputMax;
            }
            else if ( output > outputMin ) {
                output = outputMin;
            }
        } else {
            if ( output > outputMax ) {
                output = outputMax;
            }
            else if ( output < outputMin ) {
                output = outputMin;
            }
        }
    }
    return output;
}
776931
public final <T> T fold(Function<? super L, ? extends T> left, Function<? super R, ? extends T> right) {
		if (isLeft()) {
			return left.apply(getLeft());
		} else {
			return right.apply(getRight());
		}
	}
1349373
def compose(f: Callable[[Any], Monad], g: Callable[[Any], Monad]) -> Callable[[Any], Monad]:
    
    """
    return lambda x: g(x).bind(f)
1060317
function foldR(fn, startValue, list) {
      
   return list 
            ? fn(foldR(fn, startValue, tail(list)), head(list))
            : startValue
            ;
}
1237419
def fold_enrichment(self):
        
        expected = self.K * (self.n/float(self.N))
        return self.k / expected
783893
def map(self, f, preservesPartitioning=False):
        
        def func(_, iterator):
            return map(fail_on_stopiteration(f), iterator)
        return self.mapPartitionsWithIndex(func, preservesPartitioning)
825180
function map(array, fn) {
	const result = [];
	let length = array.length;
	while (length--) {
		result[length] = fn(array[length]);
	}
	return result;
}