Package hydra.lib.optionals
Class Cat
- java.lang.Object
-
- hydra.tools.PrimitiveFunction
-
- hydra.lib.optionals.Cat
-
public class Cat extends PrimitiveFunction
Filters and extracts Just values.
-
-
Constructor Summary
Constructors Constructor Description Cat()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <X> java.util.List<X>apply(java.util.List<Optional<X>> opt)Filters and extracts Just values from a list of optionals.protected java.util.function.Function<java.util.List<Term>,java.util.function.Function<InferenceContext,java.util.function.Function<Graph,Either<Error_,Term>>>>implementation()Returns the implementation of this primitive function.Namename()Returns the name of this primitive function.TypeSchemetype()Returns the type scheme of this primitive function.-
Methods inherited from class hydra.tools.PrimitiveFunction
lazyParams, term, toNative
-
-
-
-
Method Detail
-
name
public Name name()
Returns the name of this primitive function.- Specified by:
namein classPrimitiveFunction- Returns:
- the name "hydra.lib.optionals.cat"
-
type
public TypeScheme type()
Returns the type scheme of this primitive function.- Specified by:
typein classPrimitiveFunction- Returns:
- the type scheme for extracting present values from a list of optionals
-
implementation
protected java.util.function.Function<java.util.List<Term>,java.util.function.Function<InferenceContext,java.util.function.Function<Graph,Either<Error_,Term>>>> implementation()
Returns the implementation of this primitive function.- Specified by:
implementationin classPrimitiveFunction- Returns:
- a function that filters and extracts Just values from a list
-
apply
public static <X> java.util.List<X> apply(java.util.List<Optional<X>> opt)
Filters and extracts Just values from a list of optionals.- Type Parameters:
X- the element type- Parameters:
opt- the list of optional values- Returns:
- a list containing only the present values
-
-