All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.eusashead.parquet.util.Monad Maven / Gradle / Ivy

The newest version!
package net.eusashead.parquet.util;

/**
 * A very poor generic 
 * monad implementation in 
 * Java. I think it's not
 * possible to do this properly
 * without higher-kinded types 
 * or type classes.
 * @author patrickvk
 *
 * @param 
 */
public interface Monad {

	/**
	 * Returns a {@link Monad}
	 * wrapping the supplied type T
	 * given a {@link Function} of
	 * that takes a parameter of F
	 * and returns a T. I believe 
	 * for this to be a true monad
	 * it should really take a 
	 * Monad rather than a raw F.
	 * I don't see a way to do this in 
	 * Java without higher-kinded types
	 * @param function
	 * @return a {@link Monad} wrapping the result of the supplied {@link Function}
	 */
	abstract  Monad bind(Function function);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy