Class Union

    • Constructor Detail

      • Union

        public Union()
    • Method Detail

      • name

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

        public TypeScheme type()
        Returns the type scheme of this function.
        Specified by:
        type in class PrimitiveFunction
        Returns:
        the type scheme for a function that computes set union
      • 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()
        Provides the implementation of this primitive function.
        Specified by:
        implementation in class PrimitiveFunction
        Returns:
        a function that transforms terms to a flow of graph and term
      • apply

        public static <X> java.util.function.Function<PersistentSet<X>,​PersistentSet<X>> apply​(PersistentSet<X> s1)
        Computes the union of two sets.
        Type Parameters:
        X - the type of elements in the sets
        Parameters:
        s1 - the first set
        Returns:
        a function that takes the second set and returns the union
      • apply

        public static <X> PersistentSet<X> apply​(PersistentSet<X> s1,
                                                 PersistentSet<X> s2)
        Computes the union of two sets.
        Type Parameters:
        X - the type of elements in the sets
        Parameters:
        s1 - the first set
        s2 - the second set
        Returns:
        a new set containing all elements from both sets