hydra.lib.maps.Empty Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hydra-java Show documentation
Show all versions of hydra-java Show documentation
The Hydra language for strongly-typed transformations
package hydra.lib.maps;
import hydra.Flows;
import hydra.compute.Flow;
import hydra.core.Name;
import hydra.core.Term;
import hydra.core.Type;
import hydra.dsl.Terms;
import hydra.graph.Graph;
import hydra.tools.PrimitiveFunction;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import static hydra.dsl.Types.lambda;
import static hydra.dsl.Types.map;
public class Empty extends PrimitiveFunction {
public Name name() {
return new Name("hydra/lib/maps.empty");
}
@Override
public Type type() {
return lambda("k", "v", map("k", "v"));
}
@Override
protected Function, Flow> implementation() {
return ignored -> Flows.pure(Terms.map(apply()));
}
public static Map apply() {
return Collections.emptyMap();
}
}