• File: Pointed.php
  • Full Path: /home/lef/public_html/wp-content/plugins/woocommerce-multilingual/vendor/otgs/installer/includes/utilities/FP/Traits/Pointed.php
  • File size: 457 bytes
  • MIME-type: text/x-php
  • Charset: utf-8
<?php

namespace OTGS\Installer\FP\Traits;

use function OTGS\Installer\FP\curryN;

trait Pointed {
	/**
	 * of :: a -> M a
	 *
	 * Curried function that returns an instance of the derived class
	 *
	 * @param mixed $value (optional)
	 *
	 * @return mixed|callable
	 */
	public static function of( $value = null ) {
		$of = function ( $value ) {
			return new static( $value );
		};

		return call_user_func_array( curryN( 1, $of ), func_get_args() );

	}
}