Package hydra.lib.maybes
Class IsJust
- java.lang.Object
-
- hydra.tools.PrimitiveFunction
-
- hydra.lib.maybes.IsJust
-
public class IsJust extends PrimitiveFunction
Checks if value is Just.
-
-
Constructor Summary
Constructors Constructor Description IsJust()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <X> booleanapply(Maybe<X> opt)Checks if an optional value is present (Just).protected java.util.function.Function<java.util.List<Term>,java.util.function.Function<Context,java.util.function.Function<Graph,Either<InContext<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
term, toNative
-
-
-
-
Method Detail
-
name
public Name name()
Returns the name of this primitive function.- Specified by:
namein classPrimitiveFunction- Returns:
- the name "hydra.lib.maybes.isJust"
-
type
public TypeScheme type()
Returns the type scheme of this primitive function.- Specified by:
typein classPrimitiveFunction- Returns:
- the type scheme for checking if an optional is present
-
implementation
protected java.util.function.Function<java.util.List<Term>,java.util.function.Function<Context,java.util.function.Function<Graph,Either<InContext<Error_>,Term>>>> implementation()
Returns the implementation of this primitive function.- Specified by:
implementationin classPrimitiveFunction- Returns:
- a function that checks if an optional value is present
-
apply
public static <X> boolean apply(Maybe<X> opt)
Checks if an optional value is present (Just).- Type Parameters:
X- the value type- Parameters:
opt- the optional value to check- Returns:
- true if the optional contains a value, false otherwise
-
-