Package hydra.lib.optionals
Class Pure
- java.lang.Object
-
- hydra.tools.PrimitiveFunction
-
- hydra.lib.optionals.Pure
-
public class Pure extends PrimitiveFunction
Wraps a value in a flow.
-
-
Constructor Summary
Constructors Constructor Description Pure()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <X> Optional<X>apply(X arg)Wraps a value in an optional (Just constructor).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.pure"
-
type
public TypeScheme type()
Returns the type scheme of this primitive function.- Specified by:
typein classPrimitiveFunction- Returns:
- the type scheme for wrapping a value in an optional
-
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 wraps a value in an optional
-
apply
public static <X> Optional<X> apply(X arg)
Wraps a value in an optional (Just constructor).- Type Parameters:
X- the value type- Parameters:
arg- the value to wrap- Returns:
- an optional containing the value
-
-