Class Pure

    • Constructor Detail

      • Pure

        public Pure()
    • Method Detail

      • name

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

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