creates a generator that produces arrays with the same keys as in $map
where each corresponding value is chosen from a specified generator.

Example:
Gen::mapsWith(
'foo' => Gen::booleans(),
'bar' => Gen::ints()
)

@param array $map
@return Generator
776195
public static function mapsWith(array $map)
    {
        return self::tuples($map)->fmap(function ($vals) use ($map) {
            return array_combine(array_keys($map), $vals);
        });
    }
256060
public function mergeMapWithBinded( $map ) {

		foreach( $map as $key => $value ) {

			if( !in_array( $key, $this->binded ) ) {

				$this->binded[] = $key;
				$this->value[]	= $value;
			}
		}
	}
161439
protected function define(MapperDefinition $map)
    {
        $map->type(ObjectMetadataKeyValuePair::class);

        $map->property(ObjectMetadataKeyValuePair::KEY)->to('key')->unique()->asVarchar(500);

        $map->property(ObjectMetadataKeyValuePair::VALUE)
            ->mappedVia(function ($value) {
                return json_encode($value);
            }, function (string $json) {
                return @json_decode($json, true);
            })
            ->to('value')
            ->asMediumText();
    }
228780
public function mapParams(array $map, $params = null)
    {
        if (!isset($params)) {
            $params = $this->params;
        }

        $mapped = array();

        foreach ($params as $key => $value) {
            if (isset($map[$key]) && is_string($map[$key])) {
                gplcart_array_set($mapped, $map[$key], $value);
            }
        }

        return $mapped;
    }
88163
public function renameMany(array $map) : Assoc
    {
        $pairs = array_map(function ($a, $b) {
            return [$a, $b];
        }, array_keys($map), array_values($map));

        return array_reduce($pairs, function ($that, $pair) {
            list ($from, $to) = $pair;

            return $that->rename($from, $to);
        }, $this);
    }
977413
public static function map( $source, $destination, iterable $map ) {

    // sanity check
    if( !static::is( $source, false, true ) ) throw new \TypeError( 'The $source must be arraylike' );
    else if( !static::is( $destination, false, true ) ) throw new \TypeError( 'The $destination must be arraylike' );
    else {

      // iterate $map and fill the destination based on it
      foreach( $map as $key => $key_list ) {

        $value    = $source[ Number::is( $key ) ? $key_list : $key ] ?? null;
        $key_list = static::cast( $key_list, [ $key_list ] );
        foreach( $key_list as $_key ) {
          $destination[ $_key ] = $value;
        }
      }

      return $destination;
    }
  }
735146
public static function hashMap($map)
    {
        $cache = '';
        foreach ($map as $key => $value) {
            $cache .= 0xAB01 . $key . 0xAB02;
            if (is_array($value)) {
                $cache .= 0xAB04 . static::hashMap($value);
            } else {
                $cache .= 0xAB03 . $value;
            }
        }
        return md5($cache);
    }
1349462
function fromArray( array $map ) {
		$vars = get_object_vars( $this ); // all but static ones
		foreach ( $map as $attr => $value ) {
			if ( array_key_exists( $attr, $vars ) ) { // matches the attribute name
				$this->{ $attr } = $value;
			}
		}
		return $this;
	}
596801
public function extend_fieldmap($map)
    {
        if (is_array($map)) {
            self::$fieldmap = array_merge($map, self::$fieldmap);
        }
    }
954701
public function transformNames(array $map) {
    $new = new StaticAttributesMap();
    foreach ($this->attributes as $name => $attributes) {
      if (isset($map[$name])) {
        $new->attributes[$map[$name]] = $attributes;
      }
    }
    foreach ($this->classes as $name => $classes) {
      if (isset($map[$name])) {
        $new->classes[$map[$name]] = $classes;
      }
    }
    return $new;
  }
804856
protected function setValueMap(array $map)
    {
        $lower = array_change_key_case($map);
        $this->caseSensitive = count($lower) !== count($map);
        $this->valueMap = $this->caseSensitive ? $map : $lower;
    }
822084
public function serializer($data,$map = array()) {
		$def = array(
			'model' => null,
			'bind' => array()	
		);
		$singltion= false;
		
		if(!isset($data[0])){
		 $singltion = true;
		 $data = array( $data );
	    }
	    $out = array();
		foreach($data as $key => $val ){
			
			$rec = $val[$map['model']];
			foreach($map['bind'] as $alias => $path ){
				$x = $val[$path];
		//		if(!isset($x[0]) == 1) $x = array($x);
				$rec[$alias] = $x;
			}		
			$out[] = $rec;
		}
			if(!$singltion){
				$alias =  Inflector::tableize($map['model']);		
			} else{
				$alias = strtolower($map['model']);
				$out = $out[0];
			} 
		  return array($alias => $out);

	}
803790
protected function build(array $map) {
		$overrides = [];
		foreach ($map as $method => $array) {
			$mapDefinitions = $this->buildMapDefinitions($array);

			$overrides[] = <<<TXT
	override(
		$method,
		map([
$mapDefinitions
		])
	);
TXT;

		}
		$overrides = implode(PHP_EOL . PHP_EOL, $overrides);

		$template = <<<TXT
<?php
// @link https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Advanced+Metadata
namespace PHPSTORM_META {

$overrides

}

TXT;

		return $template;
	}
1060248
public function collect(Map $map, array $markers = [])
    {
        return $this->collectValues($map->getOverlayManager()->getMarkers(), $markers);
    }
1328963
public function set($map)
    {
        \UArray::convertToArray($map);
        $result = [];
        foreach ($map as $key => $item) {
            $validation = $this->formatItemSeed($item, $key);
            if ($validation) {
                $result[$key] = $item;
            }
        }
        $this->seed = json_encode($result);
        $this->map = $map;
        return $this;
    }
316929
public function setMap(array $map)
    {
        # Collect an array of all key lengths
        $lengths = array_map('strlen', array_keys($map));

        # Sort paths by their length descending, so the most specific
        # paths go first. `array_multisort` sorts the lengths descending and
        # uses the order on the $map
        array_multisort($lengths, SORT_DESC, $map);

        $this->map = $map;
    }
1370069
public static function createFromArray(array $array): self
    {
        $hashMap = new self;

        foreach ($array as $key => $value) {
            $hashMap->put($key, $value);
        }

        return $hashMap;
    }