Class IsJust

    • Constructor Summary

      Constructors 
      Constructor Description
      IsJust()  
    • Constructor Detail

      • IsJust

        public IsJust()
    • Method Detail

      • name

        public Name name()
        Returns the name of this primitive function.
        Specified by:
        name in class PrimitiveFunction
        Returns:
        the name "hydra.lib.maybes.isJust"
      • type

        public TypeScheme type()
        Returns the type scheme of this primitive function.
        Specified by:
        type in class PrimitiveFunction
        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:
        implementation in class PrimitiveFunction
        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