Class Cat

    • Constructor Summary

      Constructors 
      Constructor Description
      Cat()  
    • Constructor Detail

      • Cat

        public Cat()
    • 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.cat"
      • type

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